diff --git a/lib/services/eventHubManagement/LICENSE.txt b/lib/services/eventHubManagement/LICENSE.txt index 5431ba98b9..8f3d856145 100644 --- a/lib/services/eventHubManagement/LICENSE.txt +++ b/lib/services/eventHubManagement/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2018 Microsoft +Copyright (c) 2019 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/services/eventHubManagement/README.md b/lib/services/eventHubManagement/README.md index 0ece8ea377..a9795aa7e0 100644 --- a/lib/services/eventHubManagement/README.md +++ b/lib/services/eventHubManagement/README.md @@ -3,41 +3,41 @@ uid: azure-arm-eventhub summary: *content --- -# Microsoft Azure SDK for Node.js - EventHubManagementClient +**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://github.com/Azure/azure-sdk-for-js) which works on Node.js and browsers.** +## Microsoft Azure SDK for Node.js - EventHubManagementClient + This project provides a Node.js package for accessing Azure. Right now it supports: - **Node.js version 6.x.x or higher** -## Features +### Features -## How to Install +### How to Install ```bash npm install azure-arm-eventhub ``` -## How to use +### How to use -### Authentication, client creation and list operations as an example. +#### Authentication, client creation, and list operations as an example. ```javascript const msRestAzure = require("ms-rest-azure"); const EventHubManagementClient = require("azure-arm-eventhub"); msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new EventHubManagementClient(creds, subscriptionId); - return client.operations.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); + const subscriptionId = ""; + const client = new EventHubManagementClient(creds, subscriptionId); + + return client.operations.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); }).catch((err) => { console.log('An error occurred:'); console.dir(err, {depth: null, colors: true}); }); - -## Related projects +``` +### Related projects - [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) - - -![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-node%2Flib%2Fservices%2FeventHubManagement%2FREADME.png) diff --git a/lib/services/eventHubManagement/lib/models/accessKeys.js b/lib/services/eventHubManagement/lib/models/accessKeys.js index 04186749c9..234551912b 100644 --- a/lib/services/eventHubManagement/lib/models/accessKeys.js +++ b/lib/services/eventHubManagement/lib/models/accessKeys.js @@ -17,19 +17,20 @@ class AccessKeys { /** * Create a AccessKeys. - * @member {string} [primaryConnectionString] Primary connection string of + * @property {string} [primaryConnectionString] Primary connection string of * the created namespace AuthorizationRule. - * @member {string} [secondaryConnectionString] Secondary connection string + * @property {string} [secondaryConnectionString] Secondary connection string * of the created namespace AuthorizationRule. - * @member {string} [aliasPrimaryConnectionString] Primary connection string - * of the alias if GEO DR is enabled - * @member {string} [aliasSecondaryConnectionString] Secondary connection + * @property {string} [aliasPrimaryConnectionString] Primary connection * string of the alias if GEO DR is enabled - * @member {string} [primaryKey] A base64-encoded 256-bit primary key for + * @property {string} [aliasSecondaryConnectionString] Secondary connection + * string of the alias if GEO DR is enabled + * @property {string} [primaryKey] A base64-encoded 256-bit primary key for * signing and validating the SAS token. - * @member {string} [secondaryKey] A base64-encoded 256-bit primary key for + * @property {string} [secondaryKey] A base64-encoded 256-bit primary key for * signing and validating the SAS token. - * @member {string} [keyName] A string that describes the AuthorizationRule. + * @property {string} [keyName] A string that describes the + * AuthorizationRule. */ constructor() { } diff --git a/lib/services/eventHubManagement/lib/models/armDisasterRecovery.js b/lib/services/eventHubManagement/lib/models/armDisasterRecovery.js index 7c48b7e114..ce672327ba 100644 --- a/lib/services/eventHubManagement/lib/models/armDisasterRecovery.js +++ b/lib/services/eventHubManagement/lib/models/armDisasterRecovery.js @@ -20,18 +20,18 @@ const models = require('./index'); class ArmDisasterRecovery extends models['Resource'] { /** * Create a ArmDisasterRecovery. - * @member {string} [provisioningState] Provisioning state of the + * @property {string} [provisioningState] Provisioning state of the * Alias(Disaster Recovery configuration) - possible values 'Accepted' or * 'Succeeded' or 'Failed'. Possible values include: 'Accepted', 'Succeeded', * 'Failed' - * @member {string} [partnerNamespace] ARM Id of the Primary/Secondary - * eventhub namespace name, which is part of GEO DR pairning - * @member {string} [alternateName] Alternate name specified when alias and + * @property {string} [partnerNamespace] ARM Id of the Primary/Secondary + * eventhub namespace name, which is part of GEO DR pairing + * @property {string} [alternateName] Alternate name specified when alias and * namespace names are same. - * @member {string} [role] role of namespace in GEO DR - possible values + * @property {string} [role] role of namespace in GEO DR - possible values * 'Primary' or 'PrimaryNotReplicating' or 'Secondary'. Possible values * include: 'Primary', 'PrimaryNotReplicating', 'Secondary' - * @member {number} [pendingReplicationOperationsCount] Number of entities + * @property {number} [pendingReplicationOperationsCount] Number of entities * pending to be replicated. */ constructor() { diff --git a/lib/services/eventHubManagement/lib/models/armDisasterRecoveryListResult.js b/lib/services/eventHubManagement/lib/models/armDisasterRecoveryListResult.js index d8a87a64ce..ecb9cdd1cc 100644 --- a/lib/services/eventHubManagement/lib/models/armDisasterRecoveryListResult.js +++ b/lib/services/eventHubManagement/lib/models/armDisasterRecoveryListResult.js @@ -16,8 +16,9 @@ class ArmDisasterRecoveryListResult extends Array { /** * Create a ArmDisasterRecoveryListResult. - * @member {string} [nextLink] Link to the next set of results. Not empty if - * Value contains incomplete list of Alias(Disaster Recovery configuration) + * @property {string} [nextLink] Link to the next set of results. Not empty + * if Value contains incomplete list of Alias(Disaster Recovery + * configuration) */ constructor() { super(); diff --git a/lib/services/eventHubManagement/lib/models/authorizationRule.js b/lib/services/eventHubManagement/lib/models/authorizationRule.js index 5ae4684d80..3d1e0cc450 100644 --- a/lib/services/eventHubManagement/lib/models/authorizationRule.js +++ b/lib/services/eventHubManagement/lib/models/authorizationRule.js @@ -20,7 +20,7 @@ const models = require('./index'); class AuthorizationRule extends models['Resource'] { /** * Create a AuthorizationRule. - * @member {array} rights The rights associated with the rule. + * @property {array} rights The rights associated with the rule. */ constructor() { super(); diff --git a/lib/services/eventHubManagement/lib/models/authorizationRuleListResult.js b/lib/services/eventHubManagement/lib/models/authorizationRuleListResult.js index 67b55c3c09..ebcc06918f 100644 --- a/lib/services/eventHubManagement/lib/models/authorizationRuleListResult.js +++ b/lib/services/eventHubManagement/lib/models/authorizationRuleListResult.js @@ -16,8 +16,8 @@ class AuthorizationRuleListResult extends Array { /** * Create a AuthorizationRuleListResult. - * @member {string} [nextLink] Link to the next set of results. Not empty if - * Value contains an incomplete list of Authorization Rules + * @property {string} [nextLink] Link to the next set of results. Not empty + * if Value contains an incomplete list of Authorization Rules */ constructor() { super(); diff --git a/lib/services/eventHubManagement/lib/models/captureDescription.js b/lib/services/eventHubManagement/lib/models/captureDescription.js index d79e75eaac..57878509c1 100644 --- a/lib/services/eventHubManagement/lib/models/captureDescription.js +++ b/lib/services/eventHubManagement/lib/models/captureDescription.js @@ -17,29 +17,31 @@ class CaptureDescription { /** * Create a CaptureDescription. - * @member {boolean} [enabled] A value that indicates whether capture + * @property {boolean} [enabled] A value that indicates whether capture * description is enabled. - * @member {string} [encoding] Enumerates the possible values for the + * @property {string} [encoding] Enumerates the possible values for the * encoding format of capture description. Note: 'AvroDeflate' will be * deprecated in New API Version. Possible values include: 'Avro', * 'AvroDeflate' - * @member {number} [intervalInSeconds] The time window allows you to set the - * frequency with which the capture to Azure Blobs will happen, value should - * between 60 to 900 seconds - * @member {number} [sizeLimitInBytes] The size window defines the amount of - * data built up in your Event Hub before an capture operation, value should - * be between 10485760 to 524288000 bytes - * @member {object} [destination] Properties of Destination where capture + * @property {number} [intervalInSeconds] The time window allows you to set + * the frequency with which the capture to Azure Blobs will happen, value + * should between 60 to 900 seconds + * @property {number} [sizeLimitInBytes] The size window defines the amount + * of data built up in your Event Hub before an capture operation, value + * should be between 10485760 to 524288000 bytes + * @property {object} [destination] Properties of Destination where capture * will be stored. (Storage Account, Blob Names) - * @member {string} [destination.name] Name for capture destination - * @member {string} [destination.storageAccountResourceId] Resource id of the - * storage account to be used to create the blobs - * @member {string} [destination.blobContainer] Blob container Name - * @member {string} [destination.archiveNameFormat] Blob naming convention + * @property {string} [destination.name] Name for capture destination + * @property {string} [destination.storageAccountResourceId] Resource id of + * the storage account to be used to create the blobs + * @property {string} [destination.blobContainer] Blob container Name + * @property {string} [destination.archiveNameFormat] Blob naming convention * for archive, e.g. * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. * Here all the parameters (Namespace,EventHub .. etc) are mandatory * irrespective of order + * @property {boolean} [skipEmptyArchives] A value that indicates whether to + * Skip Empty Archives */ constructor() { } @@ -102,6 +104,13 @@ class CaptureDescription { name: 'Composite', className: 'Destination' } + }, + skipEmptyArchives: { + required: false, + serializedName: 'skipEmptyArchives', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/eventHubManagement/lib/models/checkNameAvailabilityParameter.js b/lib/services/eventHubManagement/lib/models/checkNameAvailabilityParameter.js index f4c4ee769e..2dde28e794 100644 --- a/lib/services/eventHubManagement/lib/models/checkNameAvailabilityParameter.js +++ b/lib/services/eventHubManagement/lib/models/checkNameAvailabilityParameter.js @@ -17,7 +17,7 @@ class CheckNameAvailabilityParameter { /** * Create a CheckNameAvailabilityParameter. - * @member {string} name Name to check the namespace name availability + * @property {string} name Name to check the namespace name availability */ constructor() { } diff --git a/lib/services/eventHubManagement/lib/models/checkNameAvailabilityResult.js b/lib/services/eventHubManagement/lib/models/checkNameAvailabilityResult.js index f7b04c6226..6a3362fe79 100644 --- a/lib/services/eventHubManagement/lib/models/checkNameAvailabilityResult.js +++ b/lib/services/eventHubManagement/lib/models/checkNameAvailabilityResult.js @@ -17,11 +17,11 @@ class CheckNameAvailabilityResult { /** * Create a CheckNameAvailabilityResult. - * @member {string} [message] The detailed info regarding the reason + * @property {string} [message] The detailed info regarding the reason * associated with the Namespace. - * @member {boolean} [nameAvailable] Value indicating Namespace is + * @property {boolean} [nameAvailable] Value indicating Namespace is * availability, true if the Namespace is available; otherwise, false. - * @member {string} [reason] The reason for unavailability of a Namespace. + * @property {string} [reason] The reason for unavailability of a Namespace. * Possible values include: 'None', 'InvalidName', 'SubscriptionIsDisabled', * 'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription' */ diff --git a/lib/services/eventHubManagement/lib/models/consumerGroup.js b/lib/services/eventHubManagement/lib/models/consumerGroup.js index 05fc8e1fcf..46abfa839f 100644 --- a/lib/services/eventHubManagement/lib/models/consumerGroup.js +++ b/lib/services/eventHubManagement/lib/models/consumerGroup.js @@ -20,9 +20,9 @@ const models = require('./index'); class ConsumerGroup extends models['Resource'] { /** * Create a ConsumerGroup. - * @member {date} [createdAt] Exact time the message was created. - * @member {date} [updatedAt] The exact time the message was updated. - * @member {string} [userMetadata] Usermetadata is a placeholder to store + * @property {date} [createdAt] Exact time the message was created. + * @property {date} [updatedAt] The exact time the message was updated. + * @property {string} [userMetadata] User Metadata is a placeholder to store * user-defined string data with maximum length 1024. e.g. it can be used to * store descriptive data, such as list of teams and their contact * information also user-defined configuration settings can be stored. diff --git a/lib/services/eventHubManagement/lib/models/consumerGroupListResult.js b/lib/services/eventHubManagement/lib/models/consumerGroupListResult.js index 4d89b2ceb7..0057efb738 100644 --- a/lib/services/eventHubManagement/lib/models/consumerGroupListResult.js +++ b/lib/services/eventHubManagement/lib/models/consumerGroupListResult.js @@ -16,8 +16,8 @@ class ConsumerGroupListResult extends Array { /** * Create a ConsumerGroupListResult. - * @member {string} [nextLink] Link to the next set of results. Not empty if - * Value contains incomplete list of Consumer Group + * @property {string} [nextLink] Link to the next set of results. Not empty + * if Value contains incomplete list of Consumer Group */ constructor() { super(); diff --git a/lib/services/eventHubManagement/lib/models/destination.js b/lib/services/eventHubManagement/lib/models/destination.js index 58e8dbaf5b..7e128de431 100644 --- a/lib/services/eventHubManagement/lib/models/destination.js +++ b/lib/services/eventHubManagement/lib/models/destination.js @@ -17,11 +17,11 @@ class Destination { /** * Create a Destination. - * @member {string} [name] Name for capture destination - * @member {string} [storageAccountResourceId] Resource id of the storage + * @property {string} [name] Name for capture destination + * @property {string} [storageAccountResourceId] Resource id of the storage * account to be used to create the blobs - * @member {string} [blobContainer] Blob container Name - * @member {string} [archiveNameFormat] Blob naming convention for archive, + * @property {string} [blobContainer] Blob container Name + * @property {string} [archiveNameFormat] Blob naming convention for archive, * e.g. * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. * Here all the parameters (Namespace,EventHub .. etc) are mandatory diff --git a/lib/services/eventHubManagement/lib/models/eHNamespace.js b/lib/services/eventHubManagement/lib/models/eHNamespace.js index 5dfab37ad4..17680c5f33 100644 --- a/lib/services/eventHubManagement/lib/models/eHNamespace.js +++ b/lib/services/eventHubManagement/lib/models/eHNamespace.js @@ -20,25 +20,26 @@ const models = require('./index'); class EHNamespace extends models['TrackedResource'] { /** * Create a EHNamespace. - * @member {object} [sku] Properties of sku resource - * @member {string} [sku.name] Name of this SKU. Possible values include: + * @property {object} [sku] Properties of sku resource + * @property {string} [sku.name] Name of this SKU. Possible values include: * 'Basic', 'Standard' - * @member {string} [sku.tier] The billing tier of this particular SKU. + * @property {string} [sku.tier] The billing tier of this particular SKU. * Possible values include: 'Basic', 'Standard' - * @member {number} [sku.capacity] The Event Hubs throughput units, vaule + * @property {number} [sku.capacity] The Event Hubs throughput units, value * should be 0 to 20 throughput units. - * @member {string} [provisioningState] Provisioning state of the Namespace. - * @member {date} [createdAt] The time the Namespace was created. - * @member {date} [updatedAt] The time the Namespace was updated. - * @member {string} [serviceBusEndpoint] Endpoint you can use to perform + * @property {string} [provisioningState] Provisioning state of the + * Namespace. + * @property {date} [createdAt] The time the Namespace was created. + * @property {date} [updatedAt] The time the Namespace was updated. + * @property {string} [serviceBusEndpoint] Endpoint you can use to perform * Service Bus operations. - * @member {string} [metricId] Identifier for Azure Insights metrics. - * @member {boolean} [isAutoInflateEnabled] Value that indicates whether + * @property {string} [metricId] Identifier for Azure Insights metrics. + * @property {boolean} [isAutoInflateEnabled] Value that indicates whether * AutoInflate is enabled for eventhub namespace. - * @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 + * @property {number} [maximumThroughputUnits] Upper limit of throughput + * units when AutoInflate is enabled, value should be within 0 to 20 + * throughput units. ( '0' if AutoInflateEnabled = true) + * @property {boolean} [kafkaEnabled] Value that indicates whether Kafka is * enabled for eventhub namespace. */ constructor() { diff --git a/lib/services/eventHubManagement/lib/models/eHNamespaceListResult.js b/lib/services/eventHubManagement/lib/models/eHNamespaceListResult.js index 1cdaf92fcc..24147ce5c0 100644 --- a/lib/services/eventHubManagement/lib/models/eHNamespaceListResult.js +++ b/lib/services/eventHubManagement/lib/models/eHNamespaceListResult.js @@ -16,8 +16,8 @@ class EHNamespaceListResult extends Array { /** * Create a EHNamespaceListResult. - * @member {string} [nextLink] Link to the next set of results. Not empty if - * Value contains incomplete list of namespaces. + * @property {string} [nextLink] Link to the next set of results. Not empty + * if Value contains incomplete list of namespaces. */ constructor() { super(); diff --git a/lib/services/eventHubManagement/lib/models/errorResponse.js b/lib/services/eventHubManagement/lib/models/errorResponse.js index 0c3fec6c0e..c9c5515831 100644 --- a/lib/services/eventHubManagement/lib/models/errorResponse.js +++ b/lib/services/eventHubManagement/lib/models/errorResponse.js @@ -11,15 +11,15 @@ 'use strict'; /** - * Error reponse indicates EventHub service is not able to process the incoming - * request. The reason is provided in the error message. + * Error response indicates EventHub service is not able to process the + * incoming request. The reason is provided in the error message. * */ class ErrorResponse { /** * Create a ErrorResponse. - * @member {string} [code] Error code. - * @member {string} [message] Error message indicating why the operation + * @property {string} [code] Error code. + * @property {string} [message] Error message indicating why the operation * failed. */ constructor() { diff --git a/lib/services/eventHubManagement/lib/models/eventHubListResult.js b/lib/services/eventHubManagement/lib/models/eventHubListResult.js index b98084b96a..94a286dc73 100644 --- a/lib/services/eventHubManagement/lib/models/eventHubListResult.js +++ b/lib/services/eventHubManagement/lib/models/eventHubListResult.js @@ -16,8 +16,8 @@ class EventHubListResult extends Array { /** * Create a EventHubListResult. - * @member {string} [nextLink] Link to the next set of results. Not empty if - * Value contains incomplete list of EventHubs. + * @property {string} [nextLink] Link to the next set of results. Not empty + * if Value contains incomplete list of EventHubs. */ constructor() { super(); diff --git a/lib/services/eventHubManagement/lib/models/eventhub.js b/lib/services/eventHubManagement/lib/models/eventhub.js index 3559b74469..c95abc3ddd 100644 --- a/lib/services/eventHubManagement/lib/models/eventhub.js +++ b/lib/services/eventHubManagement/lib/models/eventhub.js @@ -20,43 +20,47 @@ const models = require('./index'); class Eventhub extends models['Resource'] { /** * Create a Eventhub. - * @member {array} [partitionIds] Current number of shards on the Event Hub. - * @member {date} [createdAt] Exact time the Event Hub was created. - * @member {date} [updatedAt] The exact time the message was updated. - * @member {number} [messageRetentionInDays] Number of days to retain the + * @property {array} [partitionIds] Current number of shards on the Event + * Hub. + * @property {date} [createdAt] Exact time the Event Hub was created. + * @property {date} [updatedAt] The exact time the message was updated. + * @property {number} [messageRetentionInDays] Number of days to retain the * events for this Event Hub, value should be 1 to 7 days - * @member {number} [partitionCount] Number of partitions created for the + * @property {number} [partitionCount] Number of partitions created for the * Event Hub, allowed values are from 1 to 32 partitions. - * @member {string} [status] Enumerates the possible values for the status of - * the Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', - * 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', - * 'Unknown' - * @member {object} [captureDescription] Properties of capture description - * @member {boolean} [captureDescription.enabled] A value that indicates + * @property {string} [status] Enumerates the possible values for the status + * of the Event Hub. Possible values include: 'Active', 'Disabled', + * 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', + * 'Renaming', 'Unknown' + * @property {object} [captureDescription] Properties of capture description + * @property {boolean} [captureDescription.enabled] A value that indicates * whether capture description is enabled. - * @member {string} [captureDescription.encoding] Enumerates the possible + * @property {string} [captureDescription.encoding] Enumerates the possible * values for the encoding format of capture description. Note: 'AvroDeflate' * will be deprecated in New API Version. Possible values include: 'Avro', * 'AvroDeflate' - * @member {number} [captureDescription.intervalInSeconds] The time window + * @property {number} [captureDescription.intervalInSeconds] The time window * allows you to set the frequency with which the capture to Azure Blobs will * happen, value should between 60 to 900 seconds - * @member {number} [captureDescription.sizeLimitInBytes] The size window + * @property {number} [captureDescription.sizeLimitInBytes] The size window * defines the amount of data built up in your Event Hub before an capture * operation, value should be between 10485760 to 524288000 bytes - * @member {object} [captureDescription.destination] Properties of + * @property {object} [captureDescription.destination] Properties of * Destination where capture will be stored. (Storage Account, Blob Names) - * @member {string} [captureDescription.destination.name] Name for capture + * @property {string} [captureDescription.destination.name] Name for capture * destination - * @member {string} [captureDescription.destination.storageAccountResourceId] - * Resource id of the storage account to be used to create the blobs - * @member {string} [captureDescription.destination.blobContainer] Blob + * @property {string} + * [captureDescription.destination.storageAccountResourceId] Resource id of + * the storage account to be used to create the blobs + * @property {string} [captureDescription.destination.blobContainer] Blob * container Name - * @member {string} [captureDescription.destination.archiveNameFormat] Blob + * @property {string} [captureDescription.destination.archiveNameFormat] Blob * naming convention for archive, e.g. * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. * Here all the parameters (Namespace,EventHub .. etc) are mandatory * irrespective of order + * @property {boolean} [captureDescription.skipEmptyArchives] A value that + * indicates whether to Skip Empty Archives */ constructor() { super(); diff --git a/lib/services/eventHubManagement/lib/models/index.d.ts b/lib/services/eventHubManagement/lib/models/index.d.ts index 7449e3f50f..a0cb08dc15 100644 --- a/lib/services/eventHubManagement/lib/models/index.d.ts +++ b/lib/services/eventHubManagement/lib/models/index.d.ts @@ -1,546 +1,559 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * 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. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { BaseResource } from 'ms-rest-azure'; -import { CloudError } from 'ms-rest-azure'; -import * as moment from 'moment'; +import { BaseResource, CloudError } from "ms-rest-azure"; +import * as moment from "moment"; -export { BaseResource } from 'ms-rest-azure'; -export { CloudError } from 'ms-rest-azure'; +export { + BaseResource, + CloudError +}; /** - * @class - * Initializes a new instance of the Resource class. - * @constructor * The Resource definition - * - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type */ export interface Resource extends BaseResource { + /** + * Resource Id + */ readonly id?: string; + /** + * Resource name + */ readonly name?: string; + /** + * Resource type + */ readonly type?: string; } /** - * @class - * Initializes a new instance of the TrackedResource class. - * @constructor * Definition of Resource - * - * @member {string} [location] Resource location - * @member {object} [tags] Resource tags */ export interface TrackedResource extends Resource { + /** + * Resource location + */ location?: string; + /** + * Resource tags + */ tags?: { [propertyName: string]: string }; } /** - * @class - * Initializes a new instance of the Sku class. - * @constructor * SKU parameters supplied to the create namespace operation - * - * @member {string} name Name of this SKU. Possible values include: 'Basic', - * 'Standard' - * @member {string} [tier] The billing tier of this particular SKU. Possible - * values include: 'Basic', 'Standard' - * @member {number} [capacity] The Event Hubs throughput units, vaule should be - * 0 to 20 throughput units. */ export interface Sku { + /** + * Name of this SKU. Possible values include: 'Basic', 'Standard' + */ name: string; + /** + * The billing tier of this particular SKU. Possible values include: 'Basic', 'Standard' + */ tier?: string; + /** + * The Event Hubs throughput units, value should be 0 to 20 throughput units. + */ capacity?: number; } /** - * @class - * Initializes a new instance of the EHNamespace class. - * @constructor * Single Namespace item in List or Get Operation - * - * @member {object} [sku] Properties of sku resource - * @member {string} [sku.name] Name of this SKU. Possible values include: - * 'Basic', 'Standard' - * @member {string} [sku.tier] The billing tier of this particular SKU. - * Possible values include: 'Basic', 'Standard' - * @member {number} [sku.capacity] The Event Hubs throughput units, vaule - * should be 0 to 20 throughput units. - * @member {string} [provisioningState] Provisioning state of the Namespace. - * @member {date} [createdAt] The time the Namespace was created. - * @member {date} [updatedAt] The time the Namespace was updated. - * @member {string} [serviceBusEndpoint] Endpoint you can use to perform - * Service Bus operations. - * @member {string} [metricId] Identifier for Azure Insights metrics. - * @member {boolean} [isAutoInflateEnabled] Value that indicates whether - * AutoInflate is enabled for eventhub namespace. - * @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 { + /** + * Properties of sku resource + */ sku?: Sku; + /** + * Provisioning state of the Namespace. + */ readonly provisioningState?: string; + /** + * The time the Namespace was created. + */ readonly createdAt?: Date; + /** + * The time the Namespace was updated. + */ readonly updatedAt?: Date; + /** + * Endpoint you can use to perform Service Bus operations. + */ readonly serviceBusEndpoint?: string; + /** + * Identifier for Azure Insights metrics. + */ readonly metricId?: string; + /** + * Value that indicates whether AutoInflate is enabled for eventhub namespace. + */ isAutoInflateEnabled?: boolean; + /** + * Upper limit of throughput units when AutoInflate is enabled, value should be within 0 to 20 + * throughput units. ( '0' if AutoInflateEnabled = true) + */ maximumThroughputUnits?: number; + /** + * Value that indicates whether Kafka is enabled for eventhub namespace. + */ kafkaEnabled?: boolean; } /** - * @class - * Initializes a new instance of the AuthorizationRule class. - * @constructor * Single item in a List or Get AuthorizationRule operation - * - * @member {array} rights The rights associated with the rule. */ export interface AuthorizationRule extends Resource { + /** + * The rights associated with the rule. + */ rights: string[]; } /** - * @class - * Initializes a new instance of the AccessKeys class. - * @constructor * Namespace/EventHub Connection String - * - * @member {string} [primaryConnectionString] Primary connection string of the - * created namespace AuthorizationRule. - * @member {string} [secondaryConnectionString] Secondary connection string of - * the created namespace AuthorizationRule. - * @member {string} [aliasPrimaryConnectionString] Primary connection string of - * the alias if GEO DR is enabled - * @member {string} [aliasSecondaryConnectionString] Secondary connection - * string of the alias if GEO DR is enabled - * @member {string} [primaryKey] A base64-encoded 256-bit primary key for - * signing and validating the SAS token. - * @member {string} [secondaryKey] A base64-encoded 256-bit primary key for - * signing and validating the SAS token. - * @member {string} [keyName] A string that describes the AuthorizationRule. */ export interface AccessKeys { + /** + * Primary connection string of the created namespace AuthorizationRule. + */ readonly primaryConnectionString?: string; + /** + * Secondary connection string of the created namespace AuthorizationRule. + */ readonly secondaryConnectionString?: string; + /** + * Primary connection string of the alias if GEO DR is enabled + */ readonly aliasPrimaryConnectionString?: string; + /** + * Secondary connection string of the alias if GEO DR is enabled + */ readonly aliasSecondaryConnectionString?: string; + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS token. + */ readonly primaryKey?: string; + /** + * A base64-encoded 256-bit primary key for signing and validating the SAS token. + */ readonly secondaryKey?: string; + /** + * A string that describes the AuthorizationRule. + */ readonly keyName?: string; } /** - * @class - * Initializes a new instance of the RegenerateAccessKeyParameters class. - * @constructor - * Parameters supplied to the Regenerate Authorization Rule operation, - * specifies which key neeeds to be reset. - * - * @member {string} keyType The access key to regenerate. Possible values - * include: 'PrimaryKey', 'SecondaryKey' - * @member {string} [key] Optional, if the key value provided, is set for - * KeyType or autogenerated Key value set for keyType + * Parameters supplied to the Regenerate Authorization Rule operation, specifies which key needs to + * be reset. */ export interface RegenerateAccessKeyParameters { + /** + * The access key to regenerate. Possible values include: 'PrimaryKey', 'SecondaryKey' + */ keyType: string; + /** + * Optional, if the key value provided, is set for KeyType or autogenerated Key value set for + * keyType + */ key?: string; } /** - * @class - * Initializes a new instance of the Destination class. - * @constructor * Capture storage details for capture description - * - * @member {string} [name] Name for capture destination - * @member {string} [storageAccountResourceId] Resource id of the storage - * account to be used to create the blobs - * @member {string} [blobContainer] Blob container Name - * @member {string} [archiveNameFormat] Blob naming convention for archive, - * e.g. - * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. - * Here all the parameters (Namespace,EventHub .. etc) are mandatory - * irrespective of order */ export interface Destination { + /** + * Name for capture destination + */ name?: string; + /** + * Resource id of the storage account to be used to create the blobs + */ storageAccountResourceId?: string; + /** + * Blob container Name + */ blobContainer?: string; + /** + * Blob naming convention for archive, e.g. + * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. Here all + * the parameters (Namespace,EventHub .. etc) are mandatory irrespective of order + */ archiveNameFormat?: string; } /** - * @class - * Initializes a new instance of the CaptureDescription class. - * @constructor * Properties to configure capture description for eventhub - * - * @member {boolean} [enabled] A value that indicates whether capture - * description is enabled. - * @member {string} [encoding] Enumerates the possible values for the encoding - * format of capture description. Note: 'AvroDeflate' will be deprecated in New - * API Version. Possible values include: 'Avro', 'AvroDeflate' - * @member {number} [intervalInSeconds] The time window allows you to set the - * frequency with which the capture to Azure Blobs will happen, value should - * between 60 to 900 seconds - * @member {number} [sizeLimitInBytes] The size window defines the amount of - * data built up in your Event Hub before an capture operation, value should be - * between 10485760 to 524288000 bytes - * @member {object} [destination] Properties of Destination where capture will - * be stored. (Storage Account, Blob Names) - * @member {string} [destination.name] Name for capture destination - * @member {string} [destination.storageAccountResourceId] Resource id of the - * storage account to be used to create the blobs - * @member {string} [destination.blobContainer] Blob container Name - * @member {string} [destination.archiveNameFormat] Blob naming convention for - * archive, e.g. - * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. - * Here all the parameters (Namespace,EventHub .. etc) are mandatory - * irrespective of order */ export interface CaptureDescription { + /** + * A value that indicates whether capture description is enabled. + */ enabled?: boolean; + /** + * Enumerates the possible values for the encoding format of capture description. Note: + * 'AvroDeflate' will be deprecated in New API Version. Possible values include: 'Avro', + * 'AvroDeflate' + */ encoding?: string; + /** + * The time window allows you to set the frequency with which the capture to Azure Blobs will + * happen, value should between 60 to 900 seconds + */ intervalInSeconds?: number; + /** + * The size window defines the amount of data built up in your Event Hub before an capture + * operation, value should be between 10485760 to 524288000 bytes + */ sizeLimitInBytes?: number; + /** + * Properties of Destination where capture will be stored. (Storage Account, Blob Names) + */ destination?: Destination; + /** + * A value that indicates whether to Skip Empty Archives + */ + skipEmptyArchives?: boolean; } /** - * @class - * Initializes a new instance of the Eventhub class. - * @constructor * Single item in List or Get Event Hub operation - * - * @member {array} [partitionIds] Current number of shards on the Event Hub. - * @member {date} [createdAt] Exact time the Event Hub was created. - * @member {date} [updatedAt] The exact time the message was updated. - * @member {number} [messageRetentionInDays] Number of days to retain the - * events for this Event Hub, value should be 1 to 7 days - * @member {number} [partitionCount] Number of partitions created for the Event - * Hub, allowed values are from 1 to 32 partitions. - * @member {string} [status] Enumerates the possible values for the status of - * the Event Hub. Possible values include: 'Active', 'Disabled', 'Restoring', - * 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', 'Renaming', - * 'Unknown' - * @member {object} [captureDescription] Properties of capture description - * @member {boolean} [captureDescription.enabled] A value that indicates - * whether capture description is enabled. - * @member {string} [captureDescription.encoding] Enumerates the possible - * values for the encoding format of capture description. Note: 'AvroDeflate' - * will be deprecated in New API Version. Possible values include: 'Avro', - * 'AvroDeflate' - * @member {number} [captureDescription.intervalInSeconds] The time window - * allows you to set the frequency with which the capture to Azure Blobs will - * happen, value should between 60 to 900 seconds - * @member {number} [captureDescription.sizeLimitInBytes] The size window - * defines the amount of data built up in your Event Hub before an capture - * operation, value should be between 10485760 to 524288000 bytes - * @member {object} [captureDescription.destination] Properties of Destination - * where capture will be stored. (Storage Account, Blob Names) - * @member {string} [captureDescription.destination.name] Name for capture - * destination - * @member {string} [captureDescription.destination.storageAccountResourceId] - * Resource id of the storage account to be used to create the blobs - * @member {string} [captureDescription.destination.blobContainer] Blob - * container Name - * @member {string} [captureDescription.destination.archiveNameFormat] Blob - * naming convention for archive, e.g. - * {Namespace}/{EventHub}/{PartitionId}/{Year}/{Month}/{Day}/{Hour}/{Minute}/{Second}. - * Here all the parameters (Namespace,EventHub .. etc) are mandatory - * irrespective of order */ export interface Eventhub extends Resource { + /** + * Current number of shards on the Event Hub. + */ readonly partitionIds?: string[]; + /** + * Exact time the Event Hub was created. + */ readonly createdAt?: Date; + /** + * The exact time the message was updated. + */ readonly updatedAt?: Date; + /** + * Number of days to retain the events for this Event Hub, value should be 1 to 7 days + */ messageRetentionInDays?: number; + /** + * Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions. + */ partitionCount?: number; + /** + * Enumerates the possible values for the status of the Event Hub. Possible values include: + * 'Active', 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating', 'Deleting', + * 'Renaming', 'Unknown' + */ status?: string; + /** + * Properties of capture description + */ captureDescription?: CaptureDescription; } /** - * @class - * Initializes a new instance of the ConsumerGroup class. - * @constructor * Single item in List or Get Consumer group operation - * - * @member {date} [createdAt] Exact time the message was created. - * @member {date} [updatedAt] The exact time the message was updated. - * @member {string} [userMetadata] Usermetadata is a placeholder to store - * user-defined string data with maximum length 1024. e.g. it can be used to - * store descriptive data, such as list of teams and their contact information - * also user-defined configuration settings can be stored. */ export interface ConsumerGroup extends Resource { + /** + * Exact time the message was created. + */ readonly createdAt?: Date; + /** + * The exact time the message was updated. + */ readonly updatedAt?: Date; + /** + * User Metadata is a placeholder to store user-defined string data with maximum length 1024. + * e.g. it can be used to store descriptive data, such as list of teams and their contact + * information also user-defined configuration settings can be stored. + */ userMetadata?: string; } /** - * @class - * Initializes a new instance of the CheckNameAvailabilityParameter class. - * @constructor * Parameter supplied to check Namespace name availability operation - * - * @member {string} name Name to check the namespace name availability */ export interface CheckNameAvailabilityParameter { + /** + * Name to check the namespace name availability + */ name: string; } /** - * @class - * Initializes a new instance of the CheckNameAvailabilityResult class. - * @constructor * The Result of the CheckNameAvailability operation - * - * @member {string} [message] The detailed info regarding the reason associated - * with the Namespace. - * @member {boolean} [nameAvailable] Value indicating Namespace is - * availability, true if the Namespace is available; otherwise, false. - * @member {string} [reason] The reason for unavailability of a Namespace. - * Possible values include: 'None', 'InvalidName', 'SubscriptionIsDisabled', - * 'NameInUse', 'NameInLockdown', 'TooManyNamespaceInCurrentSubscription' */ export interface CheckNameAvailabilityResult { + /** + * The detailed info regarding the reason associated with the Namespace. + */ readonly message?: string; + /** + * Value indicating Namespace is availability, true if the Namespace is available; otherwise, + * false. + */ nameAvailable?: boolean; + /** + * The reason for unavailability of a Namespace. Possible values include: 'None', 'InvalidName', + * 'SubscriptionIsDisabled', 'NameInUse', 'NameInLockdown', + * 'TooManyNamespaceInCurrentSubscription' + */ reason?: string; } /** - * @class - * Initializes a new instance of the OperationDisplay class. - * @constructor * The object that represents the operation. - * - * @member {string} [provider] Service provider: Microsoft.EventHub - * @member {string} [resource] Resource on which the operation is performed: - * Invoice, etc. - * @member {string} [operation] Operation type: Read, write, delete, etc. */ export interface OperationDisplay { + /** + * Service provider: Microsoft.EventHub + */ readonly provider?: string; + /** + * Resource on which the operation is performed: Invoice, etc. + */ readonly resource?: string; + /** + * Operation type: Read, write, delete, etc. + */ readonly operation?: string; } /** - * @class - * Initializes a new instance of the Operation class. - * @constructor * A Event Hub REST API operation - * - * @member {string} [name] Operation name: {provider}/{resource}/{operation} - * @member {object} [display] The object that represents the operation. - * @member {string} [display.provider] Service provider: Microsoft.EventHub - * @member {string} [display.resource] Resource on which the operation is - * performed: Invoice, etc. - * @member {string} [display.operation] Operation type: Read, write, delete, - * etc. */ export interface Operation { + /** + * Operation name: {provider}/{resource}/{operation} + */ readonly name?: string; + /** + * The object that represents the operation. + */ display?: OperationDisplay; } /** - * @class - * Initializes a new instance of the ErrorResponse class. - * @constructor - * Error reponse indicates EventHub service is not able to process the incoming - * request. The reason is provided in the error message. - * - * @member {string} [code] Error code. - * @member {string} [message] Error message indicating why the operation - * failed. + * Error response indicates EventHub service is not able to process the incoming request. The + * reason is provided in the error message. */ export interface ErrorResponse { + /** + * Error code. + */ code?: string; + /** + * Error message indicating why the operation failed. + */ message?: string; } /** - * @class - * Initializes a new instance of the ArmDisasterRecovery class. - * @constructor * Single item in List or Get Alias(Disaster Recovery configuration) operation - * - * @member {string} [provisioningState] Provisioning state of the - * Alias(Disaster Recovery configuration) - possible values 'Accepted' or - * 'Succeeded' or 'Failed'. Possible values include: 'Accepted', 'Succeeded', - * 'Failed' - * @member {string} [partnerNamespace] ARM Id of the Primary/Secondary eventhub - * namespace name, which is part of GEO DR pairning - * @member {string} [alternateName] Alternate name specified when alias and - * namespace names are same. - * @member {string} [role] role of namespace in GEO DR - possible values - * 'Primary' or 'PrimaryNotReplicating' or 'Secondary'. Possible values - * include: 'Primary', 'PrimaryNotReplicating', 'Secondary' - * @member {number} [pendingReplicationOperationsCount] Number of entities - * pending to be replicated. */ export interface ArmDisasterRecovery extends Resource { + /** + * Provisioning state of the Alias(Disaster Recovery configuration) - possible values 'Accepted' + * or 'Succeeded' or 'Failed'. Possible values include: 'Accepted', 'Succeeded', 'Failed' + */ readonly provisioningState?: string; + /** + * ARM Id of the Primary/Secondary eventhub namespace name, which is part of GEO DR pairing + */ partnerNamespace?: string; + /** + * Alternate name specified when alias and namespace names are same. + */ alternateName?: string; + /** + * role of namespace in GEO DR - possible values 'Primary' or 'PrimaryNotReplicating' or + * 'Secondary'. Possible values include: 'Primary', 'PrimaryNotReplicating', 'Secondary' + */ readonly role?: string; + /** + * Number of entities pending to be replicated. + */ readonly pendingReplicationOperationsCount?: number; } -/** - * @class - * Initializes a new instance of the MessagingRegionsProperties class. - * @constructor - * @member {string} [code] Region code - * @member {string} [fullName] Full name of the region - */ export interface MessagingRegionsProperties { + /** + * Region code + */ readonly code?: string; + /** + * Full name of the region + */ readonly fullName?: string; } /** - * @class - * Initializes a new instance of the MessagingRegions class. - * @constructor * Messaging Region - * - * @member {object} [properties] - * @member {string} [properties.code] Region code - * @member {string} [properties.fullName] Full name of the region - */ +*/ export interface MessagingRegions extends TrackedResource { properties?: MessagingRegionsProperties; } /** - * @class - * Initializes a new instance of the MessagingPlan class. - * @constructor * Messaging Plan for the namespace - * - * @member {number} [sku] Sku type - * @member {number} [selectedEventHubUnit] Selected event hub unit - * @member {date} [updatedAt] The exact time the messaging plan was updated. - * @member {number} [revision] revision number - */ +*/ export interface MessagingPlan extends TrackedResource { + /** + * Sku type + */ readonly sku?: number; + /** + * Selected event hub unit + */ readonly selectedEventHubUnit?: number; + /** + * The exact time the messaging plan was updated. + */ readonly updatedAt?: Date; + /** + * revision number + */ readonly revision?: number; } +/** + * Properties supplied for Subnet +*/ +export interface Subnet { + /** + * Resource ID of Virtual Network Subnet + */ + id?: string; +} + +/** + * The response from the List namespace operation. +*/ +export interface NWRuleSetIpRules { + /** + * IP Mask + */ + ipMask?: string; + /** + * The IP Filter Action. Possible values include: 'Allow' + */ + action?: string; +} /** - * @class - * Initializes a new instance of the OperationListResult class. - * @constructor - * Result of the request to list Event Hub operations. It contains a list of - * operations and a URL link to get the next set of results. - * - * @member {string} [nextLink] URL to get the next set of operation list - * results if there are any. - */ + * The response from the List namespace operation. +*/ +export interface NWRuleSetVirtualNetworkRules { + /** + * Subnet properties + */ + subnet?: Subnet; + /** + * Value that indicates whether to ignore missing Vnet Service Endpoint + */ + ignoreMissingVnetServiceEndpoint?: boolean; +} + +/** + * Description of topic resource. +*/ +export interface NetworkRuleSet extends Resource { + /** + * Default Action for Network Rule Set. Possible values include: 'Allow', 'Deny' + */ + defaultAction?: string; + /** + * List VirtualNetwork Rules + */ + virtualNetworkRules?: NWRuleSetVirtualNetworkRules[]; + /** + * List of IpRules + */ + ipRules?: NWRuleSetIpRules[]; +} + +/** + * Result of the request to list Event Hub operations. It contains a list of operations and a URL + * link to get the next set of results. +*/ export interface OperationListResult extends Array { + /** + * URL to get the next set of operation list results if there are any. + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the EHNamespaceListResult class. - * @constructor * The response of the List Namespace operation - * - * @member {string} [nextLink] Link to the next set of results. Not empty if - * Value contains incomplete list of namespaces. - */ +*/ export interface EHNamespaceListResult extends Array { + /** + * Link to the next set of results. Not empty if Value contains incomplete list of namespaces. + */ nextLink?: string; } /** - * @class - * Initializes a new instance of the AuthorizationRuleListResult 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 Authorization Rules - */ +*/ export interface AuthorizationRuleListResult extends Array { + /** + * Link to the next set of results. Not empty if Value contains an incomplete list of + * Authorization Rules + */ nextLink?: string; } /** - * @class - * Initializes a new instance of the ArmDisasterRecoveryListResult class. - * @constructor * The result of the List Alias(Disaster Recovery configuration) operation. - * - * @member {string} [nextLink] Link to the next set of results. Not empty if - * Value contains incomplete list of Alias(Disaster Recovery configuration) - */ +*/ export interface ArmDisasterRecoveryListResult extends Array { + /** + * Link to the next set of results. Not empty if Value contains incomplete list of Alias(Disaster + * Recovery configuration) + */ readonly nextLink?: string; } /** - * @class - * Initializes a new instance of the EventHubListResult class. - * @constructor * The result of the List EventHubs operation. - * - * @member {string} [nextLink] Link to the next set of results. Not empty if - * Value contains incomplete list of EventHubs. - */ +*/ export interface EventHubListResult extends Array { + /** + * Link to the next set of results. Not empty if Value contains incomplete list of EventHubs. + */ nextLink?: string; } /** - * @class - * Initializes a new instance of the ConsumerGroupListResult class. - * @constructor * The result to the List Consumer Group operation. - * - * @member {string} [nextLink] Link to the next set of results. Not empty if - * Value contains incomplete list of Consumer Group - */ +*/ export interface ConsumerGroupListResult extends Array { + /** + * Link to the next set of results. Not empty if Value contains incomplete list of Consumer Group + */ nextLink?: string; } /** - * @class - * Initializes a new instance of the MessagingRegionsListResult class. - * @constructor * The response of the List MessagingRegions operation. - * - * @member {string} [nextLink] Link to the next set of results. Not empty if - * Value contains incomplete list of MessagingRegions. - */ +*/ export interface MessagingRegionsListResult extends Array { + /** + * Link to the next set of results. Not empty if Value contains incomplete list of + * MessagingRegions. + */ readonly nextLink?: string; } diff --git a/lib/services/eventHubManagement/lib/models/index.js b/lib/services/eventHubManagement/lib/models/index.js index 04a95dd33d..f80a7af101 100644 --- a/lib/services/eventHubManagement/lib/models/index.js +++ b/lib/services/eventHubManagement/lib/models/index.js @@ -38,6 +38,10 @@ exports.ArmDisasterRecovery = require('./armDisasterRecovery'); exports.MessagingRegionsProperties = require('./messagingRegionsProperties'); exports.MessagingRegions = require('./messagingRegions'); exports.MessagingPlan = require('./messagingPlan'); +exports.Subnet = require('./subnet'); +exports.NWRuleSetIpRules = require('./nWRuleSetIpRules'); +exports.NWRuleSetVirtualNetworkRules = require('./nWRuleSetVirtualNetworkRules'); +exports.NetworkRuleSet = require('./networkRuleSet'); exports.OperationListResult = require('./operationListResult'); exports.EHNamespaceListResult = require('./eHNamespaceListResult'); exports.AuthorizationRuleListResult = require('./authorizationRuleListResult'); diff --git a/lib/services/eventHubManagement/lib/models/messagingPlan.js b/lib/services/eventHubManagement/lib/models/messagingPlan.js index 000cfcf0e5..343580d4fc 100644 --- a/lib/services/eventHubManagement/lib/models/messagingPlan.js +++ b/lib/services/eventHubManagement/lib/models/messagingPlan.js @@ -20,10 +20,11 @@ const models = require('./index'); class MessagingPlan extends models['TrackedResource'] { /** * Create a MessagingPlan. - * @member {number} [sku] Sku type - * @member {number} [selectedEventHubUnit] Selected event hub unit - * @member {date} [updatedAt] The exact time the messaging plan was updated. - * @member {number} [revision] revision number + * @property {number} [sku] Sku type + * @property {number} [selectedEventHubUnit] Selected event hub unit + * @property {date} [updatedAt] The exact time the messaging plan was + * updated. + * @property {number} [revision] revision number */ constructor() { super(); diff --git a/lib/services/eventHubManagement/lib/models/messagingRegions.js b/lib/services/eventHubManagement/lib/models/messagingRegions.js index a0dd9f3e6f..3c17768876 100644 --- a/lib/services/eventHubManagement/lib/models/messagingRegions.js +++ b/lib/services/eventHubManagement/lib/models/messagingRegions.js @@ -20,9 +20,9 @@ const models = require('./index'); class MessagingRegions extends models['TrackedResource'] { /** * Create a MessagingRegions. - * @member {object} [properties] - * @member {string} [properties.code] Region code - * @member {string} [properties.fullName] Full name of the region + * @property {object} [properties] + * @property {string} [properties.code] Region code + * @property {string} [properties.fullName] Full name of the region */ constructor() { super(); diff --git a/lib/services/eventHubManagement/lib/models/messagingRegionsListResult.js b/lib/services/eventHubManagement/lib/models/messagingRegionsListResult.js index 9cf897ab11..71cf3a02e5 100644 --- a/lib/services/eventHubManagement/lib/models/messagingRegionsListResult.js +++ b/lib/services/eventHubManagement/lib/models/messagingRegionsListResult.js @@ -16,8 +16,8 @@ class MessagingRegionsListResult extends Array { /** * Create a MessagingRegionsListResult. - * @member {string} [nextLink] Link to the next set of results. Not empty if - * Value contains incomplete list of MessagingRegions. + * @property {string} [nextLink] Link to the next set of results. Not empty + * if Value contains incomplete list of MessagingRegions. */ constructor() { super(); diff --git a/lib/services/eventHubManagement/lib/models/messagingRegionsProperties.js b/lib/services/eventHubManagement/lib/models/messagingRegionsProperties.js index fa59c1be04..db9a2da29b 100644 --- a/lib/services/eventHubManagement/lib/models/messagingRegionsProperties.js +++ b/lib/services/eventHubManagement/lib/models/messagingRegionsProperties.js @@ -16,8 +16,8 @@ class MessagingRegionsProperties { /** * Create a MessagingRegionsProperties. - * @member {string} [code] Region code - * @member {string} [fullName] Full name of the region + * @property {string} [code] Region code + * @property {string} [fullName] Full name of the region */ constructor() { } diff --git a/lib/services/eventHubManagement/lib/models/nWRuleSetIpRules.js b/lib/services/eventHubManagement/lib/models/nWRuleSetIpRules.js new file mode 100644 index 0000000000..8c2099c21d --- /dev/null +++ b/lib/services/eventHubManagement/lib/models/nWRuleSetIpRules.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The response from the List namespace operation. + * + */ +class NWRuleSetIpRules { + /** + * Create a NWRuleSetIpRules. + * @property {string} [ipMask] IP Mask + * @property {string} [action] The IP Filter Action. Possible values include: + * 'Allow' + */ + constructor() { + } + + /** + * Defines the metadata of NWRuleSetIpRules + * + * @returns {object} metadata of NWRuleSetIpRules + * + */ + mapper() { + return { + required: false, + serializedName: 'NWRuleSetIpRules', + type: { + name: 'Composite', + className: 'NWRuleSetIpRules', + modelProperties: { + ipMask: { + required: false, + serializedName: 'ipMask', + type: { + name: 'String' + } + }, + action: { + required: false, + serializedName: 'action', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = NWRuleSetIpRules; diff --git a/lib/services/eventHubManagement/lib/models/nWRuleSetVirtualNetworkRules.js b/lib/services/eventHubManagement/lib/models/nWRuleSetVirtualNetworkRules.js new file mode 100644 index 0000000000..3362e3298b --- /dev/null +++ b/lib/services/eventHubManagement/lib/models/nWRuleSetVirtualNetworkRules.js @@ -0,0 +1,63 @@ +/* + * 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 NWRuleSetVirtualNetworkRules { + /** + * Create a NWRuleSetVirtualNetworkRules. + * @property {object} [subnet] Subnet properties + * @property {string} [subnet.id] Resource ID of Virtual Network Subnet + * @property {boolean} [ignoreMissingVnetServiceEndpoint] Value that + * indicates whether to ignore missing Vnet Service Endpoint + */ + constructor() { + } + + /** + * Defines the metadata of NWRuleSetVirtualNetworkRules + * + * @returns {object} metadata of NWRuleSetVirtualNetworkRules + * + */ + mapper() { + return { + required: false, + serializedName: 'NWRuleSetVirtualNetworkRules', + type: { + name: 'Composite', + className: 'NWRuleSetVirtualNetworkRules', + modelProperties: { + subnet: { + required: false, + serializedName: 'subnet', + type: { + name: 'Composite', + className: 'Subnet' + } + }, + ignoreMissingVnetServiceEndpoint: { + required: false, + serializedName: 'ignoreMissingVnetServiceEndpoint', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = NWRuleSetVirtualNetworkRules; diff --git a/lib/services/eventHubManagement/lib/models/networkRuleSet.js b/lib/services/eventHubManagement/lib/models/networkRuleSet.js new file mode 100644 index 0000000000..9dbcccdf41 --- /dev/null +++ b/lib/services/eventHubManagement/lib/models/networkRuleSet.js @@ -0,0 +1,113 @@ +/* + * 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'); + +/** + * Description of topic resource. + * + * @extends models['Resource'] + */ +class NetworkRuleSet extends models['Resource'] { + /** + * Create a NetworkRuleSet. + * @property {string} [defaultAction] Default Action for Network Rule Set. + * Possible values include: 'Allow', 'Deny' + * @property {array} [virtualNetworkRules] List VirtualNetwork Rules + * @property {array} [ipRules] List of IpRules + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NetworkRuleSet + * + * @returns {object} metadata of NetworkRuleSet + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkRuleSet', + type: { + name: 'Composite', + className: 'NetworkRuleSet', + 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' + } + }, + defaultAction: { + required: false, + serializedName: 'properties.defaultAction', + type: { + name: 'String' + } + }, + virtualNetworkRules: { + required: false, + serializedName: 'properties.virtualNetworkRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NWRuleSetVirtualNetworkRulesElementType', + type: { + name: 'Composite', + className: 'NWRuleSetVirtualNetworkRules' + } + } + } + }, + ipRules: { + required: false, + serializedName: 'properties.ipRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NWRuleSetIpRulesElementType', + type: { + name: 'Composite', + className: 'NWRuleSetIpRules' + } + } + } + } + } + } + }; + } +} + +module.exports = NetworkRuleSet; diff --git a/lib/services/eventHubManagement/lib/models/operation.js b/lib/services/eventHubManagement/lib/models/operation.js index 6cafc8ff9f..5762e224b0 100644 --- a/lib/services/eventHubManagement/lib/models/operation.js +++ b/lib/services/eventHubManagement/lib/models/operation.js @@ -17,13 +17,14 @@ class Operation { /** * Create a Operation. - * @member {string} [name] Operation name: {provider}/{resource}/{operation} - * @member {object} [display] The object that represents the operation. - * @member {string} [display.provider] Service provider: Microsoft.EventHub - * @member {string} [display.resource] Resource on which the operation is + * @property {string} [name] Operation name: + * {provider}/{resource}/{operation} + * @property {object} [display] The object that represents the operation. + * @property {string} [display.provider] Service provider: Microsoft.EventHub + * @property {string} [display.resource] Resource on which the operation is * performed: Invoice, etc. - * @member {string} [display.operation] Operation type: Read, write, delete, - * etc. + * @property {string} [display.operation] Operation type: Read, write, + * delete, etc. */ constructor() { } diff --git a/lib/services/eventHubManagement/lib/models/operationDisplay.js b/lib/services/eventHubManagement/lib/models/operationDisplay.js index cf82fbf8dd..5e5153ef73 100644 --- a/lib/services/eventHubManagement/lib/models/operationDisplay.js +++ b/lib/services/eventHubManagement/lib/models/operationDisplay.js @@ -17,10 +17,10 @@ class OperationDisplay { /** * Create a OperationDisplay. - * @member {string} [provider] Service provider: Microsoft.EventHub - * @member {string} [resource] Resource on which the operation is performed: - * Invoice, etc. - * @member {string} [operation] Operation type: Read, write, delete, etc. + * @property {string} [provider] Service provider: Microsoft.EventHub + * @property {string} [resource] Resource on which the operation is + * performed: Invoice, etc. + * @property {string} [operation] Operation type: Read, write, delete, etc. */ constructor() { } diff --git a/lib/services/eventHubManagement/lib/models/operationListResult.js b/lib/services/eventHubManagement/lib/models/operationListResult.js index 70bf9673ac..016b21cc2b 100644 --- a/lib/services/eventHubManagement/lib/models/operationListResult.js +++ b/lib/services/eventHubManagement/lib/models/operationListResult.js @@ -17,7 +17,7 @@ class OperationListResult extends Array { /** * Create a OperationListResult. - * @member {string} [nextLink] URL to get the next set of operation list + * @property {string} [nextLink] URL to get the next set of operation list * results if there are any. */ constructor() { diff --git a/lib/services/eventHubManagement/lib/models/regenerateAccessKeyParameters.js b/lib/services/eventHubManagement/lib/models/regenerateAccessKeyParameters.js index ea6c4ce958..0e25d94d46 100644 --- a/lib/services/eventHubManagement/lib/models/regenerateAccessKeyParameters.js +++ b/lib/services/eventHubManagement/lib/models/regenerateAccessKeyParameters.js @@ -12,15 +12,15 @@ /** * Parameters supplied to the Regenerate Authorization Rule operation, - * specifies which key neeeds to be reset. + * specifies which key needs to be reset. * */ class RegenerateAccessKeyParameters { /** * Create a RegenerateAccessKeyParameters. - * @member {string} keyType The access key to regenerate. Possible values + * @property {string} keyType The access key to regenerate. Possible values * include: 'PrimaryKey', 'SecondaryKey' - * @member {string} [key] Optional, if the key value provided, is set for + * @property {string} [key] Optional, if the key value provided, is set for * KeyType or autogenerated Key value set for keyType */ constructor() { diff --git a/lib/services/eventHubManagement/lib/models/resource.js b/lib/services/eventHubManagement/lib/models/resource.js index e5f775beac..1a030ec760 100644 --- a/lib/services/eventHubManagement/lib/models/resource.js +++ b/lib/services/eventHubManagement/lib/models/resource.js @@ -20,9 +20,9 @@ const models = require('./index'); class Resource extends models['BaseResource'] { /** * Create a Resource. - * @member {string} [id] Resource Id - * @member {string} [name] Resource name - * @member {string} [type] Resource type + * @property {string} [id] Resource Id + * @property {string} [name] Resource name + * @property {string} [type] Resource type */ constructor() { super(); diff --git a/lib/services/eventHubManagement/lib/models/sku.js b/lib/services/eventHubManagement/lib/models/sku.js index 1aa924e22e..24e4156d9c 100644 --- a/lib/services/eventHubManagement/lib/models/sku.js +++ b/lib/services/eventHubManagement/lib/models/sku.js @@ -17,12 +17,12 @@ class Sku { /** * Create a Sku. - * @member {string} name Name of this SKU. Possible values include: 'Basic', - * 'Standard' - * @member {string} [tier] The billing tier of this particular SKU. Possible - * values include: 'Basic', 'Standard' - * @member {number} [capacity] The Event Hubs throughput units, vaule should - * be 0 to 20 throughput units. + * @property {string} name Name of this SKU. Possible values include: + * 'Basic', 'Standard' + * @property {string} [tier] The billing tier of this particular SKU. + * Possible values include: 'Basic', 'Standard' + * @property {number} [capacity] The Event Hubs throughput units, value + * should be 0 to 20 throughput units. */ constructor() { } diff --git a/lib/services/eventHubManagement/lib/models/subnet.js b/lib/services/eventHubManagement/lib/models/subnet.js new file mode 100644 index 0000000000..3973e46360 --- /dev/null +++ b/lib/services/eventHubManagement/lib/models/subnet.js @@ -0,0 +1,52 @@ +/* + * 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'; + +/** + * Properties supplied for Subnet + * + */ +class Subnet { + /** + * Create a Subnet. + * @property {string} [id] Resource ID of Virtual Network Subnet + */ + constructor() { + } + + /** + * Defines the metadata of Subnet + * + * @returns {object} metadata of Subnet + * + */ + mapper() { + return { + required: false, + serializedName: 'Subnet', + type: { + name: 'Composite', + className: 'Subnet', + modelProperties: { + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Subnet; diff --git a/lib/services/eventHubManagement/lib/models/trackedResource.js b/lib/services/eventHubManagement/lib/models/trackedResource.js index 3629139d75..6602e4f038 100644 --- a/lib/services/eventHubManagement/lib/models/trackedResource.js +++ b/lib/services/eventHubManagement/lib/models/trackedResource.js @@ -20,8 +20,8 @@ const models = require('./index'); class TrackedResource extends models['Resource'] { /** * Create a TrackedResource. - * @member {string} [location] Resource location - * @member {object} [tags] Resource tags + * @property {string} [location] Resource location + * @property {object} [tags] Resource tags */ constructor() { super(); diff --git a/lib/services/eventHubManagement/lib/operations/consumerGroups.js b/lib/services/eventHubManagement/lib/operations/consumerGroups.js index a83230ad40..5d9859f1cd 100644 --- a/lib/services/eventHubManagement/lib/operations/consumerGroups.js +++ b/lib/services/eventHubManagement/lib/operations/consumerGroups.js @@ -30,7 +30,7 @@ const WebResource = msRest.WebResource; * @param {object} parameters Parameters supplied to create or update a * consumer group resource. * - * @param {string} [parameters.userMetadata] Usermetadata is a placeholder to + * @param {string} [parameters.userMetadata] User Metadata is a placeholder to * store user-defined string data with maximum length 1024. e.g. it can be used * to store descriptive data, such as list of teams and their contact * information also user-defined configuration settings can be stored. @@ -991,7 +991,7 @@ class ConsumerGroups { * @param {object} parameters Parameters supplied to create or update a * consumer group resource. * - * @param {string} [parameters.userMetadata] Usermetadata is a placeholder to + * @param {string} [parameters.userMetadata] User Metadata is a placeholder to * store user-defined string data with maximum length 1024. e.g. it can be used * to store descriptive data, such as list of teams and their contact * information also user-defined configuration settings can be stored. @@ -1037,7 +1037,7 @@ class ConsumerGroups { * @param {object} parameters Parameters supplied to create or update a * consumer group resource. * - * @param {string} [parameters.userMetadata] Usermetadata is a placeholder to + * @param {string} [parameters.userMetadata] User Metadata is a placeholder to * store user-defined string data with maximum length 1024. e.g. it can be used * to store descriptive data, such as list of teams and their contact * information also user-defined configuration settings can be stored. diff --git a/lib/services/eventHubManagement/lib/operations/disasterRecoveryConfigs.js b/lib/services/eventHubManagement/lib/operations/disasterRecoveryConfigs.js index 381fbe55ca..3aa7df420c 100644 --- a/lib/services/eventHubManagement/lib/operations/disasterRecoveryConfigs.js +++ b/lib/services/eventHubManagement/lib/operations/disasterRecoveryConfigs.js @@ -387,7 +387,7 @@ function _list(resourceGroupName, namespaceName, options, callback) { * Recovery configuration) * * @param {string} [parameters.partnerNamespace] ARM Id of the - * Primary/Secondary eventhub namespace name, which is part of GEO DR pairning + * Primary/Secondary eventhub namespace name, which is part of GEO DR pairing * * @param {string} [parameters.alternateName] Alternate name specified when * alias and namespace names are same. @@ -1098,7 +1098,7 @@ function _breakPairing(resourceGroupName, namespaceName, alias, options, callbac } /** - * envokes GEO DR failover and reconfigure the alias to point to the secondary + * Invokes GEO DR failover and reconfigure the alias to point to the secondary * namespace * * @param {string} resourceGroupName Name of the resource group within the @@ -2321,7 +2321,7 @@ class DisasterRecoveryConfigs { * Recovery configuration) * * @param {string} [parameters.partnerNamespace] ARM Id of the - * Primary/Secondary eventhub namespace name, which is part of GEO DR pairning + * Primary/Secondary eventhub namespace name, which is part of GEO DR pairing * * @param {string} [parameters.alternateName] Alternate name specified when * alias and namespace names are same. @@ -2365,7 +2365,7 @@ class DisasterRecoveryConfigs { * Recovery configuration) * * @param {string} [parameters.partnerNamespace] ARM Id of the - * Primary/Secondary eventhub namespace name, which is part of GEO DR pairning + * Primary/Secondary eventhub namespace name, which is part of GEO DR pairing * * @param {string} [parameters.alternateName] Alternate name specified when * alias and namespace names are same. @@ -2696,7 +2696,7 @@ class DisasterRecoveryConfigs { } /** - * envokes GEO DR failover and reconfigure the alias to point to the secondary + * Invokes GEO DR failover and reconfigure the alias to point to the secondary * namespace * * @param {string} resourceGroupName Name of the resource group within the @@ -2732,7 +2732,7 @@ class DisasterRecoveryConfigs { } /** - * envokes GEO DR failover and reconfigure the alias to point to the secondary + * Invokes GEO DR failover and reconfigure the alias to point to the secondary * namespace * * @param {string} resourceGroupName Name of the resource group within the diff --git a/lib/services/eventHubManagement/lib/operations/eventHubs.js b/lib/services/eventHubManagement/lib/operations/eventHubs.js index e5aff41072..c5f069d1fd 100644 --- a/lib/services/eventHubManagement/lib/operations/eventHubs.js +++ b/lib/services/eventHubManagement/lib/operations/eventHubs.js @@ -286,6 +286,9 @@ function _listByNamespace(resourceGroupName, namespaceName, options, callback) { * Here all the parameters (Namespace,EventHub .. etc) are mandatory * irrespective of order * + * @param {boolean} [parameters.captureDescription.skipEmptyArchives] A value + * that indicates whether to Skip Empty Archives + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2422,6 +2425,9 @@ class EventHubs { * Here all the parameters (Namespace,EventHub .. etc) are mandatory * irrespective of order * + * @param {boolean} [parameters.captureDescription.skipEmptyArchives] A value + * that indicates whether to Skip Empty Archives + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2510,6 +2516,9 @@ class EventHubs { * Here all the parameters (Namespace,EventHub .. etc) are mandatory * irrespective of order * + * @param {boolean} [parameters.captureDescription.skipEmptyArchives] A value + * that indicates whether to Skip Empty Archives + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the diff --git a/lib/services/eventHubManagement/lib/operations/index.d.ts b/lib/services/eventHubManagement/lib/operations/index.d.ts index a5c329d48a..2d8d7edd67 100644 --- a/lib/services/eventHubManagement/lib/operations/index.d.ts +++ b/lib/services/eventHubManagement/lib/operations/index.d.ts @@ -332,13 +332,13 @@ export interface Namespaces { * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether @@ -381,13 +381,13 @@ export interface Namespaces { * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether @@ -572,13 +572,13 @@ export interface Namespaces { * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether @@ -621,13 +621,13 @@ export interface Namespaces { * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether @@ -1144,6 +1144,146 @@ export interface Namespaces { regenerateKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, parameters: models.RegenerateAccessKeyParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name + * + * @param {object} parameters The Namespace IpFilterRule. + * + * @param {string} [parameters.defaultAction] Default Action for Network Rule + * Set. Possible values include: 'Allow', 'Deny' + * + * @param {array} [parameters.virtualNetworkRules] List VirtualNetwork Rules + * + * @param {array} [parameters.ipRules] List of IpRules + * + * @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. + */ + createOrUpdateNetworkRuleSetWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, parameters: models.NetworkRuleSet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name + * + * @param {object} parameters The Namespace IpFilterRule. + * + * @param {string} [parameters.defaultAction] Default Action for Network Rule + * Set. Possible values include: 'Allow', 'Deny' + * + * @param {array} [parameters.virtualNetworkRules] List VirtualNetwork Rules + * + * @param {array} [parameters.ipRules] List of IpRules + * + * @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 {NetworkRuleSet} - 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. + * + * {NetworkRuleSet} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkRuleSet} 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. + */ + createOrUpdateNetworkRuleSet(resourceGroupName: string, namespaceName: string, parameters: models.NetworkRuleSet, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateNetworkRuleSet(resourceGroupName: string, namespaceName: string, parameters: models.NetworkRuleSet, callback: ServiceCallback): void; + createOrUpdateNetworkRuleSet(resourceGroupName: string, namespaceName: string, parameters: models.NetworkRuleSet, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getNetworkRuleSetWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkRuleSet} - 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. + * + * {NetworkRuleSet} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkRuleSet} 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. + */ + getNetworkRuleSet(resourceGroupName: string, namespaceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkRuleSet(resourceGroupName: string, namespaceName: string, callback: ServiceCallback): void; + getNetworkRuleSet(resourceGroupName: string, namespaceName: 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. @@ -1164,13 +1304,13 @@ export interface Namespaces { * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether @@ -1213,13 +1353,13 @@ export interface Namespaces { * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether @@ -1656,7 +1796,7 @@ export interface DisasterRecoveryConfigs { * Recovery configuration) * * @param {string} [parameters.partnerNamespace] ARM Id of the - * Primary/Secondary eventhub namespace name, which is part of GEO DR pairning + * Primary/Secondary eventhub namespace name, which is part of GEO DR pairing * * @param {string} [parameters.alternateName] Alternate name specified when * alias and namespace names are same. @@ -1688,7 +1828,7 @@ export interface DisasterRecoveryConfigs { * Recovery configuration) * * @param {string} [parameters.partnerNamespace] ARM Id of the - * Primary/Secondary eventhub namespace name, which is part of GEO DR pairning + * Primary/Secondary eventhub namespace name, which is part of GEO DR pairing * * @param {string} [parameters.alternateName] Alternate name specified when * alias and namespace names are same. @@ -1923,7 +2063,7 @@ export interface DisasterRecoveryConfigs { /** - * envokes GEO DR failover and reconfigure the alias to point to the secondary + * Invokes GEO DR failover and reconfigure the alias to point to the secondary * namespace * * @param {string} resourceGroupName Name of the resource group within the @@ -1947,7 +2087,7 @@ export interface DisasterRecoveryConfigs { failOverWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, alias: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * envokes GEO DR failover and reconfigure the alias to point to the secondary + * Invokes GEO DR failover and reconfigure the alias to point to the secondary * namespace * * @param {string} resourceGroupName Name of the resource group within the @@ -2457,6 +2597,9 @@ export interface EventHubs { * Here all the parameters (Namespace,EventHub .. etc) are mandatory * irrespective of order * + * @param {boolean} [parameters.captureDescription.skipEmptyArchives] A value + * that indicates whether to Skip Empty Archives + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2533,6 +2676,9 @@ export interface EventHubs { * Here all the parameters (Namespace,EventHub .. etc) are mandatory * irrespective of order * + * @param {boolean} [parameters.captureDescription.skipEmptyArchives] A value + * that indicates whether to Skip Empty Archives + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3270,7 +3416,7 @@ export interface ConsumerGroups { * @param {object} parameters Parameters supplied to create or update a * consumer group resource. * - * @param {string} [parameters.userMetadata] Usermetadata is a placeholder to + * @param {string} [parameters.userMetadata] User Metadata is a placeholder to * store user-defined string data with maximum length 1024. e.g. it can be used * to store descriptive data, such as list of teams and their contact * information also user-defined configuration settings can be stored. @@ -3304,7 +3450,7 @@ export interface ConsumerGroups { * @param {object} parameters Parameters supplied to create or update a * consumer group resource. * - * @param {string} [parameters.userMetadata] Usermetadata is a placeholder to + * @param {string} [parameters.userMetadata] User Metadata is a placeholder to * store user-defined string data with maximum length 1024. e.g. it can be used * to store descriptive data, such as list of teams and their contact * information also user-defined configuration settings can be stored. diff --git a/lib/services/eventHubManagement/lib/operations/namespaces.js b/lib/services/eventHubManagement/lib/operations/namespaces.js index 60f36aef10..a000658018 100644 --- a/lib/services/eventHubManagement/lib/operations/namespaces.js +++ b/lib/services/eventHubManagement/lib/operations/namespaces.js @@ -479,13 +479,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether @@ -834,13 +834,13 @@ function _get(resourceGroupName, namespaceName, options, callback) { * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether @@ -2303,6 +2303,366 @@ function _regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName }); } +/** + * Create or update NetworkRuleSet for a Namespace. + * + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name + * + * @param {object} parameters The Namespace IpFilterRule. + * + * @param {string} [parameters.defaultAction] Default Action for Network Rule + * Set. Possible values include: 'Allow', 'Deny' + * + * @param {array} [parameters.virtualNetworkRules] List VirtualNetwork Rules + * + * @param {array} [parameters.ipRules] List of IpRules + * + * @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 NetworkRuleSet} 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 _createOrUpdateNetworkRuleSet(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 (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 (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + 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}/networkRuleSet/default'; + 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['NetworkRuleSet']().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['NetworkRuleSet']().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 NetworkRuleSet 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} 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 NetworkRuleSet} 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 _getNetworkRuleSet(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}/networkRuleSet/default'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + 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['NetworkRuleSet']().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. @@ -2323,13 +2683,13 @@ function _regenerateKeys(resourceGroupName, namespaceName, authorizationRuleName * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether @@ -3090,6 +3450,8 @@ class Namespaces { this._getAuthorizationRule = _getAuthorizationRule; this._listKeys = _listKeys; this._regenerateKeys = _regenerateKeys; + this._createOrUpdateNetworkRuleSet = _createOrUpdateNetworkRuleSet; + this._getNetworkRuleSet = _getNetworkRuleSet; this._beginCreateOrUpdate = _beginCreateOrUpdate; this._beginDeleteMethod = _beginDeleteMethod; this._listNext = _listNext; @@ -3372,13 +3734,13 @@ class Namespaces { * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether @@ -3433,13 +3795,13 @@ class Namespaces { * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether @@ -3693,13 +4055,13 @@ class Namespaces { * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether @@ -3754,13 +4116,13 @@ class Namespaces { * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether @@ -4481,6 +4843,200 @@ class Namespaces { } } + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name + * + * @param {object} parameters The Namespace IpFilterRule. + * + * @param {string} [parameters.defaultAction] Default Action for Network Rule + * Set. Possible values include: 'Allow', 'Deny' + * + * @param {array} [parameters.virtualNetworkRules] List VirtualNetwork Rules + * + * @param {array} [parameters.ipRules] List of IpRules + * + * @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. + */ + createOrUpdateNetworkRuleSetWithHttpOperationResponse(resourceGroupName, namespaceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateNetworkRuleSet(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; + }); + }); + } + + /** + * Create or update NetworkRuleSet for a Namespace. + * + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name + * + * @param {object} parameters The Namespace IpFilterRule. + * + * @param {string} [parameters.defaultAction] Default Action for Network Rule + * Set. Possible values include: 'Allow', 'Deny' + * + * @param {array} [parameters.virtualNetworkRules] List VirtualNetwork Rules + * + * @param {array} [parameters.ipRules] List of IpRules + * + * @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 {NetworkRuleSet} - 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 NetworkRuleSet} 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. + */ + createOrUpdateNetworkRuleSet(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._createOrUpdateNetworkRuleSet(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateNetworkRuleSet(resourceGroupName, namespaceName, parameters, options, optionalCallback); + } + } + + /** + * Gets NetworkRuleSet for a Namespace. + * + * @param {string} resourceGroupName Name of the resource group within the + * azure subscription. + * + * @param {string} namespaceName The Namespace name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getNetworkRuleSetWithHttpOperationResponse(resourceGroupName, namespaceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getNetworkRuleSet(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 NetworkRuleSet 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 {NetworkRuleSet} - 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 NetworkRuleSet} 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. + */ + getNetworkRuleSet(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._getNetworkRuleSet(resourceGroupName, namespaceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNetworkRuleSet(resourceGroupName, namespaceName, options, optionalCallback); + } + } + /** * Creates or updates a namespace. Once created, this namespace's resource * manifest is immutable. This operation is idempotent. @@ -4501,13 +5057,13 @@ class Namespaces { * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether @@ -4562,13 +5118,13 @@ class Namespaces { * SKU. Possible values include: 'Basic', 'Standard' * * @param {number} [parameters.sku.capacity] The Event Hubs throughput units, - * vaule should be 0 to 20 throughput units. + * value 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 when AutoInflate is enabled, value should be within 0 to 20 * throughput units. ( '0' if AutoInflateEnabled = true) * * @param {boolean} [parameters.kafkaEnabled] Value that indicates whether diff --git a/lib/services/eventHubManagement/package.json b/lib/services/eventHubManagement/package.json index 50b51b23bc..c3399e3ca0 100644 --- a/lib/services/eventHubManagement/package.json +++ b/lib/services/eventHubManagement/package.json @@ -22,4 +22,4 @@ "bugs": { "url": "https://github.com/azure/azure-sdk-for-node/issues" } -} \ No newline at end of file +}