diff --git a/lib/services/notificationHubsManagement/LICENSE.txt b/lib/services/notificationHubsManagement/LICENSE.txt index 0313a903d7..5431ba98b9 100644 --- a/lib/services/notificationHubsManagement/LICENSE.txt +++ b/lib/services/notificationHubsManagement/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2017 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 -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/notificationHubsManagement/lib/models/apnsCredential.js b/lib/services/notificationHubsManagement/lib/models/apnsCredential.js index 17c22a2e24..8dad08e33d 100644 --- a/lib/services/notificationHubsManagement/lib/models/apnsCredential.js +++ b/lib/services/notificationHubsManagement/lib/models/apnsCredential.js @@ -20,7 +20,7 @@ class ApnsCredential { * @member {string} [apnsCertificate] The APNS certificate. * @member {string} [certificateKey] The certificate key. * @member {string} [endpoint] The endpoint of this credential. - * @member {string} [thumbprint] The Apns certificate Thumbprint + * @member {string} [thumbprint] The APNS certificate Thumbprint * @member {string} [keyId] A 10-character key identifier (kid) key, obtained * from your developer account * @member {string} [appName] The name of the application diff --git a/lib/services/notificationHubsManagement/lib/models/checkAvailabilityParameters.js b/lib/services/notificationHubsManagement/lib/models/checkAvailabilityParameters.js index 83aac5c835..076ec65ebd 100644 --- a/lib/services/notificationHubsManagement/lib/models/checkAvailabilityParameters.js +++ b/lib/services/notificationHubsManagement/lib/models/checkAvailabilityParameters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Parameters supplied to the Check Name Availability for Namespace and * NotificationHubs. @@ -23,7 +21,7 @@ class CheckAvailabilityParameters { * @member {string} [id] Resource Id * @member {string} name Resource name * @member {string} [type] Resource type - * @member {string} location Resource location + * @member {string} [location] Resource location * @member {object} [tags] Resource tags * @member {object} [sku] The sku of the created namespace * @member {string} [sku.name] Name of the notification hub sku. Possible @@ -76,7 +74,7 @@ class CheckAvailabilityParameters { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' diff --git a/lib/services/notificationHubsManagement/lib/models/checkAvailabilityResult.js b/lib/services/notificationHubsManagement/lib/models/checkAvailabilityResult.js index abe205fb6a..dce37458ab 100644 --- a/lib/services/notificationHubsManagement/lib/models/checkAvailabilityResult.js +++ b/lib/services/notificationHubsManagement/lib/models/checkAvailabilityResult.js @@ -13,7 +13,7 @@ const models = require('./index'); /** - * Description of a CheckAvailibility resource. + * Description of a CheckAvailability resource. * * @extends models['Resource'] */ @@ -66,7 +66,7 @@ class CheckAvailabilityResult extends models['Resource'] { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' diff --git a/lib/services/notificationHubsManagement/lib/models/debugSendResponse.js b/lib/services/notificationHubsManagement/lib/models/debugSendResponse.js new file mode 100644 index 0000000000..4120b88178 --- /dev/null +++ b/lib/services/notificationHubsManagement/lib/models/debugSendResponse.js @@ -0,0 +1,125 @@ +/* + * 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 a NotificationHub Resource. + * + * @extends models['Resource'] + */ +class DebugSendResponse extends models['Resource'] { + /** + * Create a DebugSendResponse. + * @member {number} [success] successful send + * @member {number} [failure] send failure + * @member {object} [results] actual failure description + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DebugSendResponse + * + * @returns {object} metadata of DebugSendResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'DebugSendResponse', + type: { + name: 'Composite', + className: 'DebugSendResponse', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + success: { + required: false, + serializedName: 'properties.success', + type: { + name: 'Number' + } + }, + failure: { + required: false, + serializedName: 'properties.failure', + type: { + name: 'Number' + } + }, + results: { + required: false, + serializedName: 'properties.results', + type: { + name: 'Object' + } + } + } + } + }; + } +} + +module.exports = DebugSendResponse; diff --git a/lib/services/notificationHubsManagement/lib/models/errorResponse.js b/lib/services/notificationHubsManagement/lib/models/errorResponse.js new file mode 100644 index 0000000000..e517722061 --- /dev/null +++ b/lib/services/notificationHubsManagement/lib/models/errorResponse.js @@ -0,0 +1,62 @@ +/* + * 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'; + +/** + * Error response indicates NotificationHubs 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 + * failed. + */ + constructor() { + } + + /** + * Defines the metadata of ErrorResponse + * + * @returns {object} metadata of ErrorResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorResponse', + type: { + name: 'Composite', + className: 'ErrorResponse', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorResponse; diff --git a/lib/services/notificationHubsManagement/lib/models/index.d.ts b/lib/services/notificationHubsManagement/lib/models/index.d.ts index 239166a0fb..c2e283a321 100644 --- a/lib/services/notificationHubsManagement/lib/models/index.d.ts +++ b/lib/services/notificationHubsManagement/lib/models/index.d.ts @@ -18,32 +18,54 @@ export { CloudError } from 'ms-rest-azure'; /** * @class - * Initializes a new instance of the CheckNameAvailabilityRequestParameters class. + * Initializes a new instance of the OperationDisplay class. * @constructor - * Parameters supplied to the Check Name Availability for Namespace and - * NotificationHubs. + * The object that represents the operation. * - * @member {string} name Resource name - * @member {string} [type] Resource type + * @member {string} [provider] Service provider: Microsoft.NotificationHubs + * @member {string} [resource] Resource on which the operation is performed: + * Invoice, etc. + * @member {string} [operation] Operation type: Read, write, delete, etc. */ -export interface CheckNameAvailabilityRequestParameters { - name: string; - readonly type?: string; +export interface OperationDisplay { + readonly provider?: string; + readonly resource?: string; + readonly operation?: string; } /** * @class - * Initializes a new instance of the CheckNameAvailabilityResponse class. + * Initializes a new instance of the Operation class. * @constructor - * @member {boolean} [nameAvailable] Checks if the namespace name is available - * @member {string} [reason] States the reason due to which the namespace name - * is not available - * @member {string} [message] The messsage returned when checking for namespace - * name availability - */ -export interface CheckNameAvailabilityResponse { - nameAvailable?: boolean; - reason?: string; + * A NotificationHubs 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.NotificationHubs + * @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 { + readonly name?: string; + display?: OperationDisplay; +} + +/** + * @class + * Initializes a new instance of the ErrorResponse class. + * @constructor + * Error response indicates NotificationHubs 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. + */ +export interface ErrorResponse { + code?: string; message?: string; } @@ -78,7 +100,7 @@ export interface Sku { * @member {string} [id] Resource Id * @member {string} name Resource name * @member {string} [type] Resource type - * @member {string} location Resource location + * @member {string} [location] Resource location * @member {object} [tags] Resource tags * @member {object} [sku] The sku of the created namespace * @member {string} [sku.name] Name of the notification hub sku. Possible @@ -94,7 +116,7 @@ export interface CheckAvailabilityParameters { readonly id?: string; name: string; readonly type?: string; - location: string; + location?: string; tags?: { [propertyName: string]: string }; sku?: Sku; isAvailiable?: boolean; @@ -107,7 +129,7 @@ export interface CheckAvailabilityParameters { * @member {string} [id] Resource Id * @member {string} [name] Resource name * @member {string} [type] Resource type - * @member {string} location Resource location + * @member {string} [location] Resource location * @member {object} [tags] Resource tags * @member {object} [sku] The sku of the created namespace * @member {string} [sku.name] Name of the notification hub sku. Possible @@ -121,7 +143,7 @@ export interface Resource extends BaseResource { readonly id?: string; readonly name?: string; readonly type?: string; - location: string; + location?: string; tags?: { [propertyName: string]: string }; sku?: Sku; } @@ -130,7 +152,7 @@ export interface Resource extends BaseResource { * @class * Initializes a new instance of the CheckAvailabilityResult class. * @constructor - * Description of a CheckAvailibility resource. + * Description of a CheckAvailability resource. * * @member {boolean} [isAvailiable] True if the name is available and can be * used to create new Namespace/NotificationHub. Otherwise false. @@ -153,9 +175,11 @@ export interface CheckAvailabilityResult extends Resource { * Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth * Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan * WestNorth EuropeWest Europe + * @member {string} [metricId] Identifier for Azure Insights metrics * @member {string} [status] Status of the namespace. It can be any of these * values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting * @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 * NotificationHub operations. * @member {string} [subscriptionId] The Id of the Azure subscription @@ -165,6 +189,7 @@ export interface CheckAvailabilityResult extends Resource { * enabled. * @member {boolean} [critical] Whether or not the namespace is set as * Critical. + * @member {string} [dataCenter] Data center for the namespace * @member {string} [namespaceType] The namespace type. Possible values * include: 'Messaging', 'NotificationHub' */ @@ -172,13 +197,16 @@ export interface NamespaceCreateOrUpdateParameters extends Resource { namespaceCreateOrUpdateParametersName?: string; provisioningState?: string; region?: string; + readonly metricId?: string; status?: string; createdAt?: Date; + updatedAt?: Date; serviceBusEndpoint?: string; subscriptionId?: string; scaleUnit?: string; enabled?: boolean; critical?: boolean; + dataCenter?: string; namespaceType?: string; } @@ -215,9 +243,11 @@ export interface NamespacePatchParameters { * Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth * Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan EastJapan * WestNorth EuropeWest Europe + * @member {string} [metricId] Identifier for Azure Insights metrics * @member {string} [status] Status of the namespace. It can be any of these * values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting * @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 * NotificationHub operations. * @member {string} [subscriptionId] The Id of the Azure subscription @@ -227,6 +257,7 @@ export interface NamespacePatchParameters { * enabled. * @member {boolean} [critical] Whether or not the namespace is set as * Critical. + * @member {string} [dataCenter] Data center for the namespace * @member {string} [namespaceType] The namespace type. Possible values * include: 'Messaging', 'NotificationHub' */ @@ -234,13 +265,16 @@ export interface NamespaceResource extends Resource { namespaceResourceName?: string; provisioningState?: string; region?: string; + readonly metricId?: string; status?: string; createdAt?: Date; + updatedAt?: Date; serviceBusEndpoint?: string; subscriptionId?: string; scaleUnit?: string; enabled?: boolean; critical?: boolean; + dataCenter?: string; namespaceType?: string; } @@ -251,9 +285,27 @@ export interface NamespaceResource extends Resource { * SharedAccessAuthorizationRule properties. * * @member {array} [rights] The rights associated with the rule. + * @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 authorization rule. + * @member {string} [claimType] A string that describes the claim type + * @member {string} [claimValue] A string that describes the claim value + * @member {string} [modifiedTime] The last modified time for this rule + * @member {string} [createdTime] The created time for this rule + * @member {number} [revision] The revision number for the rule */ export interface SharedAccessAuthorizationRuleProperties { rights?: string[]; + readonly primaryKey?: string; + readonly secondaryKey?: string; + readonly keyName?: string; + readonly claimType?: string; + readonly claimValue?: string; + readonly modifiedTime?: string; + readonly createdTime?: string; + readonly revision?: number; } /** @@ -264,8 +316,22 @@ export interface SharedAccessAuthorizationRuleProperties { * * @member {object} properties Properties of the Namespace AuthorizationRules. * @member {array} [properties.rights] The rights associated with the rule. + * @member {string} [properties.primaryKey] A base64-encoded 256-bit primary + * key for signing and validating the SAS token. + * @member {string} [properties.secondaryKey] A base64-encoded 256-bit primary + * key for signing and validating the SAS token. + * @member {string} [properties.keyName] A string that describes the + * authorization rule. + * @member {string} [properties.claimType] A string that describes the claim + * type + * @member {string} [properties.claimValue] A string that describes the claim + * value + * @member {string} [properties.modifiedTime] The last modified time for this + * rule + * @member {string} [properties.createdTime] The created time for this rule + * @member {number} [properties.revision] The revision number for the rule */ -export interface SharedAccessAuthorizationRuleCreateOrUpdateParameters extends Resource { +export interface SharedAccessAuthorizationRuleCreateOrUpdateParameters { properties: SharedAccessAuthorizationRuleProperties; } @@ -276,9 +342,27 @@ export interface SharedAccessAuthorizationRuleCreateOrUpdateParameters extends R * Description of a Namespace AuthorizationRules. * * @member {array} [rights] The rights associated with the rule. + * @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 authorization rule. + * @member {string} [claimType] A string that describes the claim type + * @member {string} [claimValue] A string that describes the claim value + * @member {string} [modifiedTime] The last modified time for this rule + * @member {string} [createdTime] The created time for this rule + * @member {number} [revision] The revision number for the rule */ export interface SharedAccessAuthorizationRuleResource extends Resource { rights?: string[]; + readonly primaryKey?: string; + readonly secondaryKey?: string; + readonly keyName?: string; + readonly claimType?: string; + readonly claimValue?: string; + readonly modifiedTime?: string; + readonly createdTime?: string; + readonly revision?: number; } /** @@ -327,7 +411,7 @@ export interface PolicykeyResource { * @member {string} [apnsCertificate] The APNS certificate. * @member {string} [certificateKey] The certificate key. * @member {string} [endpoint] The endpoint of this credential. - * @member {string} [thumbprint] The Apns certificate Thumbprint + * @member {string} [thumbprint] The APNS certificate Thumbprint * @member {string} [keyId] A 10-character key identifier (kid) key, obtained * from your developer account * @member {string} [appName] The name of the application @@ -385,7 +469,7 @@ export interface GcmCredential { * * @member {string} [mpnsCertificate] The MPNS certificate. * @member {string} [certificateKey] The certificate key for this credential. - * @member {string} [thumbprint] The Mpns certificate Thumbprint + * @member {string} [thumbprint] The MPNS certificate Thumbprint */ export interface MpnsCredential { mpnsCertificate?: string; @@ -442,7 +526,7 @@ export interface BaiduCredential { * @member {string} [apnsCredential.apnsCertificate] The APNS certificate. * @member {string} [apnsCredential.certificateKey] The certificate key. * @member {string} [apnsCredential.endpoint] The endpoint of this credential. - * @member {string} [apnsCredential.thumbprint] The Apns certificate Thumbprint + * @member {string} [apnsCredential.thumbprint] The APNS certificate Thumbprint * @member {string} [apnsCredential.keyId] A 10-character key identifier (kid) * key, obtained from your developer account * @member {string} [apnsCredential.appName] The name of the application @@ -467,7 +551,7 @@ export interface BaiduCredential { * @member {string} [mpnsCredential.mpnsCertificate] The MPNS certificate. * @member {string} [mpnsCredential.certificateKey] The certificate key for * this credential. - * @member {string} [mpnsCredential.thumbprint] The Mpns certificate Thumbprint + * @member {string} [mpnsCredential.thumbprint] The MPNS certificate Thumbprint * @member {object} [admCredential] The AdmCredential of the created * NotificationHub * @member {string} [admCredential.clientId] The client identifier. @@ -493,6 +577,74 @@ export interface NotificationHubCreateOrUpdateParameters extends Resource { baiduCredential?: BaiduCredential; } +/** + * @class + * Initializes a new instance of the NotificationHubPatchParameters class. + * @constructor + * Parameters supplied to the patch NotificationHub operation. + * + * @member {string} [notificationHubPatchParametersName] The NotificationHub + * name. + * @member {string} [registrationTtl] The RegistrationTtl of the created + * NotificationHub + * @member {array} [authorizationRules] The AuthorizationRules of the created + * NotificationHub + * @member {object} [apnsCredential] The ApnsCredential of the created + * NotificationHub + * @member {string} [apnsCredential.apnsCertificate] The APNS certificate. + * @member {string} [apnsCredential.certificateKey] The certificate key. + * @member {string} [apnsCredential.endpoint] The endpoint of this credential. + * @member {string} [apnsCredential.thumbprint] The APNS certificate Thumbprint + * @member {string} [apnsCredential.keyId] A 10-character key identifier (kid) + * key, obtained from your developer account + * @member {string} [apnsCredential.appName] The name of the application + * @member {string} [apnsCredential.appId] The issuer (iss) registered claim + * key, whose value is your 10-character Team ID, obtained from your developer + * account + * @member {string} [apnsCredential.token] Provider Authentication Token, + * obtained through your developer account + * @member {object} [wnsCredential] The WnsCredential of the created + * NotificationHub + * @member {string} [wnsCredential.packageSid] The package ID for this + * credential. + * @member {string} [wnsCredential.secretKey] The secret key. + * @member {string} [wnsCredential.windowsLiveEndpoint] The Windows Live + * endpoint. + * @member {object} [gcmCredential] The GcmCredential of the created + * NotificationHub + * @member {string} [gcmCredential.gcmEndpoint] The GCM endpoint. + * @member {string} [gcmCredential.googleApiKey] The Google API key. + * @member {object} [mpnsCredential] The MpnsCredential of the created + * NotificationHub + * @member {string} [mpnsCredential.mpnsCertificate] The MPNS certificate. + * @member {string} [mpnsCredential.certificateKey] The certificate key for + * this credential. + * @member {string} [mpnsCredential.thumbprint] The MPNS certificate Thumbprint + * @member {object} [admCredential] The AdmCredential of the created + * NotificationHub + * @member {string} [admCredential.clientId] The client identifier. + * @member {string} [admCredential.clientSecret] The credential secret access + * key. + * @member {string} [admCredential.authTokenUrl] The URL of the authorization + * token. + * @member {object} [baiduCredential] The BaiduCredential of the created + * NotificationHub + * @member {string} [baiduCredential.baiduApiKey] Baidu Api Key. + * @member {string} [baiduCredential.baiduEndPoint] Baidu Endpoint. + * @member {string} [baiduCredential.baiduSecretKey] Baidu Secret Key + */ +export interface NotificationHubPatchParameters extends Resource { + notificationHubPatchParametersName?: string; + registrationTtl?: string; + authorizationRules?: SharedAccessAuthorizationRuleProperties[]; + apnsCredential?: ApnsCredential; + wnsCredential?: WnsCredential; + gcmCredential?: GcmCredential; + mpnsCredential?: MpnsCredential; + admCredential?: AdmCredential; + baiduCredential?: BaiduCredential; +} + /** * @class * Initializes a new instance of the NotificationHubResource class. @@ -509,7 +661,7 @@ export interface NotificationHubCreateOrUpdateParameters extends Resource { * @member {string} [apnsCredential.apnsCertificate] The APNS certificate. * @member {string} [apnsCredential.certificateKey] The certificate key. * @member {string} [apnsCredential.endpoint] The endpoint of this credential. - * @member {string} [apnsCredential.thumbprint] The Apns certificate Thumbprint + * @member {string} [apnsCredential.thumbprint] The APNS certificate Thumbprint * @member {string} [apnsCredential.keyId] A 10-character key identifier (kid) * key, obtained from your developer account * @member {string} [apnsCredential.appName] The name of the application @@ -534,7 +686,7 @@ export interface NotificationHubCreateOrUpdateParameters extends Resource { * @member {string} [mpnsCredential.mpnsCertificate] The MPNS certificate. * @member {string} [mpnsCredential.certificateKey] The certificate key for * this credential. - * @member {string} [mpnsCredential.thumbprint] The Mpns certificate Thumbprint + * @member {string} [mpnsCredential.thumbprint] The MPNS certificate Thumbprint * @member {object} [admCredential] The AdmCredential of the created * NotificationHub * @member {string} [admCredential.clientId] The client identifier. @@ -560,6 +712,22 @@ export interface NotificationHubResource extends Resource { baiduCredential?: BaiduCredential; } +/** + * @class + * Initializes a new instance of the DebugSendResponse class. + * @constructor + * Description of a NotificationHub Resource. + * + * @member {number} [success] successful send + * @member {number} [failure] send failure + * @member {object} [results] actual failure description + */ +export interface DebugSendResponse extends Resource { + success?: number; + failure?: number; + results?: any; +} + /** * @class * Initializes a new instance of the PnsCredentialsResource class. @@ -571,7 +739,7 @@ export interface NotificationHubResource extends Resource { * @member {string} [apnsCredential.apnsCertificate] The APNS certificate. * @member {string} [apnsCredential.certificateKey] The certificate key. * @member {string} [apnsCredential.endpoint] The endpoint of this credential. - * @member {string} [apnsCredential.thumbprint] The Apns certificate Thumbprint + * @member {string} [apnsCredential.thumbprint] The APNS certificate Thumbprint * @member {string} [apnsCredential.keyId] A 10-character key identifier (kid) * key, obtained from your developer account * @member {string} [apnsCredential.appName] The name of the application @@ -596,7 +764,7 @@ export interface NotificationHubResource extends Resource { * @member {string} [mpnsCredential.mpnsCertificate] The MPNS certificate. * @member {string} [mpnsCredential.certificateKey] The certificate key for * this credential. - * @member {string} [mpnsCredential.thumbprint] The Mpns certificate Thumbprint + * @member {string} [mpnsCredential.thumbprint] The MPNS certificate Thumbprint * @member {object} [admCredential] The AdmCredential of the created * NotificationHub * @member {string} [admCredential.clientId] The client identifier. @@ -630,6 +798,20 @@ export interface SubResource extends BaseResource { } +/** + * @class + * Initializes a new instance of the OperationListResult class. + * @constructor + * Result of the request to list NotificationHubs 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. + */ +export interface OperationListResult extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the NamespaceListResult class. diff --git a/lib/services/notificationHubsManagement/lib/models/index.js b/lib/services/notificationHubsManagement/lib/models/index.js index b3a63f3a8c..4f19236dbd 100644 --- a/lib/services/notificationHubsManagement/lib/models/index.js +++ b/lib/services/notificationHubsManagement/lib/models/index.js @@ -18,8 +18,9 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; -exports.CheckNameAvailabilityRequestParameters = require('./checkNameAvailabilityRequestParameters'); -exports.CheckNameAvailabilityResponse = require('./checkNameAvailabilityResponse'); +exports.OperationDisplay = require('./operationDisplay'); +exports.Operation = require('./operation'); +exports.ErrorResponse = require('./errorResponse'); exports.Sku = require('./sku'); exports.CheckAvailabilityParameters = require('./checkAvailabilityParameters'); exports.Resource = require('./resource'); @@ -39,9 +40,12 @@ exports.MpnsCredential = require('./mpnsCredential'); exports.AdmCredential = require('./admCredential'); exports.BaiduCredential = require('./baiduCredential'); exports.NotificationHubCreateOrUpdateParameters = require('./notificationHubCreateOrUpdateParameters'); +exports.NotificationHubPatchParameters = require('./notificationHubPatchParameters'); exports.NotificationHubResource = require('./notificationHubResource'); +exports.DebugSendResponse = require('./debugSendResponse'); exports.PnsCredentialsResource = require('./pnsCredentialsResource'); exports.SubResource = require('./subResource'); +exports.OperationListResult = require('./operationListResult'); exports.NamespaceListResult = require('./namespaceListResult'); exports.SharedAccessAuthorizationRuleListResult = require('./sharedAccessAuthorizationRuleListResult'); exports.NotificationHubListResult = require('./notificationHubListResult'); diff --git a/lib/services/notificationHubsManagement/lib/models/mpnsCredential.js b/lib/services/notificationHubsManagement/lib/models/mpnsCredential.js index b2b5aaeece..84992b020b 100644 --- a/lib/services/notificationHubsManagement/lib/models/mpnsCredential.js +++ b/lib/services/notificationHubsManagement/lib/models/mpnsCredential.js @@ -19,7 +19,7 @@ class MpnsCredential { * Create a MpnsCredential. * @member {string} [mpnsCertificate] The MPNS certificate. * @member {string} [certificateKey] The certificate key for this credential. - * @member {string} [thumbprint] The Mpns certificate Thumbprint + * @member {string} [thumbprint] The MPNS certificate Thumbprint */ constructor() { } diff --git a/lib/services/notificationHubsManagement/lib/models/namespaceCreateOrUpdateParameters.js b/lib/services/notificationHubsManagement/lib/models/namespaceCreateOrUpdateParameters.js index b1b96944c0..e3cebb70cf 100644 --- a/lib/services/notificationHubsManagement/lib/models/namespaceCreateOrUpdateParameters.js +++ b/lib/services/notificationHubsManagement/lib/models/namespaceCreateOrUpdateParameters.js @@ -28,9 +28,11 @@ class NamespaceCreateOrUpdateParameters extends models['Resource'] { * Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth * Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan * EastJapan WestNorth EuropeWest Europe + * @member {string} [metricId] Identifier for Azure Insights metrics * @member {string} [status] Status of the namespace. It can be any of these * values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting * @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 * NotificationHub operations. * @member {string} [subscriptionId] The Id of the Azure subscription @@ -40,6 +42,7 @@ class NamespaceCreateOrUpdateParameters extends models['Resource'] { * enabled. * @member {boolean} [critical] Whether or not the namespace is set as * Critical. + * @member {string} [dataCenter] Data center for the namespace * @member {string} [namespaceType] The namespace type. Possible values * include: 'Messaging', 'NotificationHub' */ @@ -86,7 +89,7 @@ class NamespaceCreateOrUpdateParameters extends models['Resource'] { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' @@ -135,6 +138,14 @@ class NamespaceCreateOrUpdateParameters extends models['Resource'] { name: 'String' } }, + metricId: { + required: false, + readOnly: true, + serializedName: 'properties.metricId', + type: { + name: 'String' + } + }, status: { required: false, serializedName: 'properties.status', @@ -149,6 +160,13 @@ class NamespaceCreateOrUpdateParameters extends models['Resource'] { name: 'DateTime' } }, + updatedAt: { + required: false, + serializedName: 'properties.updatedAt', + type: { + name: 'DateTime' + } + }, serviceBusEndpoint: { required: false, serializedName: 'properties.serviceBusEndpoint', @@ -184,6 +202,13 @@ class NamespaceCreateOrUpdateParameters extends models['Resource'] { name: 'Boolean' } }, + dataCenter: { + required: false, + serializedName: 'properties.dataCenter', + type: { + name: 'String' + } + }, namespaceType: { required: false, serializedName: 'properties.namespaceType', diff --git a/lib/services/notificationHubsManagement/lib/models/namespacePatchParameters.js b/lib/services/notificationHubsManagement/lib/models/namespacePatchParameters.js index 3acb9ef750..c7d4e15a06 100644 --- a/lib/services/notificationHubsManagement/lib/models/namespacePatchParameters.js +++ b/lib/services/notificationHubsManagement/lib/models/namespacePatchParameters.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Parameters supplied to the Patch Namespace operation. * diff --git a/lib/services/notificationHubsManagement/lib/models/namespaceResource.js b/lib/services/notificationHubsManagement/lib/models/namespaceResource.js index 1c4bd811f4..47c65bc993 100644 --- a/lib/services/notificationHubsManagement/lib/models/namespaceResource.js +++ b/lib/services/notificationHubsManagement/lib/models/namespaceResource.js @@ -27,9 +27,11 @@ class NamespaceResource extends models['Resource'] { * Australia EastAustralia SoutheastCentral USEast USEast US 2West USNorth * Central USSouth Central USEast AsiaSoutheast AsiaBrazil SouthJapan * EastJapan WestNorth EuropeWest Europe + * @member {string} [metricId] Identifier for Azure Insights metrics * @member {string} [status] Status of the namespace. It can be any of these * values:1 = Created/Active2 = Creating3 = Suspended4 = Deleting * @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 * NotificationHub operations. * @member {string} [subscriptionId] The Id of the Azure subscription @@ -39,6 +41,7 @@ class NamespaceResource extends models['Resource'] { * enabled. * @member {boolean} [critical] Whether or not the namespace is set as * Critical. + * @member {string} [dataCenter] Data center for the namespace * @member {string} [namespaceType] The namespace type. Possible values * include: 'Messaging', 'NotificationHub' */ @@ -85,7 +88,7 @@ class NamespaceResource extends models['Resource'] { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' @@ -134,6 +137,14 @@ class NamespaceResource extends models['Resource'] { name: 'String' } }, + metricId: { + required: false, + readOnly: true, + serializedName: 'properties.metricId', + type: { + name: 'String' + } + }, status: { required: false, serializedName: 'properties.status', @@ -148,6 +159,13 @@ class NamespaceResource extends models['Resource'] { name: 'DateTime' } }, + updatedAt: { + required: false, + serializedName: 'properties.updatedAt', + type: { + name: 'DateTime' + } + }, serviceBusEndpoint: { required: false, serializedName: 'properties.serviceBusEndpoint', @@ -183,6 +201,13 @@ class NamespaceResource extends models['Resource'] { name: 'Boolean' } }, + dataCenter: { + required: false, + serializedName: 'properties.dataCenter', + type: { + name: 'String' + } + }, namespaceType: { required: false, serializedName: 'properties.namespaceType', diff --git a/lib/services/notificationHubsManagement/lib/models/notificationHubCreateOrUpdateParameters.js b/lib/services/notificationHubsManagement/lib/models/notificationHubCreateOrUpdateParameters.js index ea7693c741..685d4c864e 100644 --- a/lib/services/notificationHubsManagement/lib/models/notificationHubCreateOrUpdateParameters.js +++ b/lib/services/notificationHubsManagement/lib/models/notificationHubCreateOrUpdateParameters.js @@ -32,7 +32,7 @@ class NotificationHubCreateOrUpdateParameters extends models['Resource'] { * @member {string} [apnsCredential.certificateKey] The certificate key. * @member {string} [apnsCredential.endpoint] The endpoint of this * credential. - * @member {string} [apnsCredential.thumbprint] The Apns certificate + * @member {string} [apnsCredential.thumbprint] The APNS certificate * Thumbprint * @member {string} [apnsCredential.keyId] A 10-character key identifier * (kid) key, obtained from your developer account @@ -58,7 +58,7 @@ class NotificationHubCreateOrUpdateParameters extends models['Resource'] { * @member {string} [mpnsCredential.mpnsCertificate] The MPNS certificate. * @member {string} [mpnsCredential.certificateKey] The certificate key for * this credential. - * @member {string} [mpnsCredential.thumbprint] The Mpns certificate + * @member {string} [mpnsCredential.thumbprint] The MPNS certificate * Thumbprint * @member {object} [admCredential] The AdmCredential of the created * NotificationHub @@ -116,7 +116,7 @@ class NotificationHubCreateOrUpdateParameters extends models['Resource'] { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' diff --git a/lib/services/notificationHubsManagement/lib/models/notificationHubPatchParameters.js b/lib/services/notificationHubsManagement/lib/models/notificationHubPatchParameters.js new file mode 100644 index 0000000000..87a5969c88 --- /dev/null +++ b/lib/services/notificationHubsManagement/lib/models/notificationHubPatchParameters.js @@ -0,0 +1,230 @@ +/* + * 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'); + +/** + * Parameters supplied to the patch NotificationHub operation. + * + * @extends models['Resource'] + */ +class NotificationHubPatchParameters extends models['Resource'] { + /** + * Create a NotificationHubPatchParameters. + * @member {string} [notificationHubPatchParametersName] The NotificationHub + * name. + * @member {string} [registrationTtl] The RegistrationTtl of the created + * NotificationHub + * @member {array} [authorizationRules] The AuthorizationRules of the created + * NotificationHub + * @member {object} [apnsCredential] The ApnsCredential of the created + * NotificationHub + * @member {string} [apnsCredential.apnsCertificate] The APNS certificate. + * @member {string} [apnsCredential.certificateKey] The certificate key. + * @member {string} [apnsCredential.endpoint] The endpoint of this + * credential. + * @member {string} [apnsCredential.thumbprint] The APNS certificate + * Thumbprint + * @member {string} [apnsCredential.keyId] A 10-character key identifier + * (kid) key, obtained from your developer account + * @member {string} [apnsCredential.appName] The name of the application + * @member {string} [apnsCredential.appId] The issuer (iss) registered claim + * key, whose value is your 10-character Team ID, obtained from your + * developer account + * @member {string} [apnsCredential.token] Provider Authentication Token, + * obtained through your developer account + * @member {object} [wnsCredential] The WnsCredential of the created + * NotificationHub + * @member {string} [wnsCredential.packageSid] The package ID for this + * credential. + * @member {string} [wnsCredential.secretKey] The secret key. + * @member {string} [wnsCredential.windowsLiveEndpoint] The Windows Live + * endpoint. + * @member {object} [gcmCredential] The GcmCredential of the created + * NotificationHub + * @member {string} [gcmCredential.gcmEndpoint] The GCM endpoint. + * @member {string} [gcmCredential.googleApiKey] The Google API key. + * @member {object} [mpnsCredential] The MpnsCredential of the created + * NotificationHub + * @member {string} [mpnsCredential.mpnsCertificate] The MPNS certificate. + * @member {string} [mpnsCredential.certificateKey] The certificate key for + * this credential. + * @member {string} [mpnsCredential.thumbprint] The MPNS certificate + * Thumbprint + * @member {object} [admCredential] The AdmCredential of the created + * NotificationHub + * @member {string} [admCredential.clientId] The client identifier. + * @member {string} [admCredential.clientSecret] The credential secret access + * key. + * @member {string} [admCredential.authTokenUrl] The URL of the authorization + * token. + * @member {object} [baiduCredential] The BaiduCredential of the created + * NotificationHub + * @member {string} [baiduCredential.baiduApiKey] Baidu Api Key. + * @member {string} [baiduCredential.baiduEndPoint] Baidu Endpoint. + * @member {string} [baiduCredential.baiduSecretKey] Baidu Secret Key + */ + constructor() { + super(); + } + + /** + * Defines the metadata of NotificationHubPatchParameters + * + * @returns {object} metadata of NotificationHubPatchParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'NotificationHubPatchParameters', + type: { + name: 'Composite', + className: 'NotificationHubPatchParameters', + modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'Sku' + } + }, + notificationHubPatchParametersName: { + required: false, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + registrationTtl: { + required: false, + serializedName: 'properties.registrationTtl', + type: { + name: 'String' + } + }, + authorizationRules: { + required: false, + serializedName: 'properties.authorizationRules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'SharedAccessAuthorizationRulePropertiesElementType', + type: { + name: 'Composite', + className: 'SharedAccessAuthorizationRuleProperties' + } + } + } + }, + apnsCredential: { + required: false, + serializedName: 'properties.apnsCredential', + type: { + name: 'Composite', + className: 'ApnsCredential' + } + }, + wnsCredential: { + required: false, + serializedName: 'properties.wnsCredential', + type: { + name: 'Composite', + className: 'WnsCredential' + } + }, + gcmCredential: { + required: false, + serializedName: 'properties.gcmCredential', + type: { + name: 'Composite', + className: 'GcmCredential' + } + }, + mpnsCredential: { + required: false, + serializedName: 'properties.mpnsCredential', + type: { + name: 'Composite', + className: 'MpnsCredential' + } + }, + admCredential: { + required: false, + serializedName: 'properties.admCredential', + type: { + name: 'Composite', + className: 'AdmCredential' + } + }, + baiduCredential: { + required: false, + serializedName: 'properties.baiduCredential', + type: { + name: 'Composite', + className: 'BaiduCredential' + } + } + } + } + }; + } +} + +module.exports = NotificationHubPatchParameters; diff --git a/lib/services/notificationHubsManagement/lib/models/notificationHubResource.js b/lib/services/notificationHubsManagement/lib/models/notificationHubResource.js index 036e5e1f37..0830ada9a0 100644 --- a/lib/services/notificationHubsManagement/lib/models/notificationHubResource.js +++ b/lib/services/notificationHubsManagement/lib/models/notificationHubResource.js @@ -31,7 +31,7 @@ class NotificationHubResource extends models['Resource'] { * @member {string} [apnsCredential.certificateKey] The certificate key. * @member {string} [apnsCredential.endpoint] The endpoint of this * credential. - * @member {string} [apnsCredential.thumbprint] The Apns certificate + * @member {string} [apnsCredential.thumbprint] The APNS certificate * Thumbprint * @member {string} [apnsCredential.keyId] A 10-character key identifier * (kid) key, obtained from your developer account @@ -57,7 +57,7 @@ class NotificationHubResource extends models['Resource'] { * @member {string} [mpnsCredential.mpnsCertificate] The MPNS certificate. * @member {string} [mpnsCredential.certificateKey] The certificate key for * this credential. - * @member {string} [mpnsCredential.thumbprint] The Mpns certificate + * @member {string} [mpnsCredential.thumbprint] The MPNS certificate * Thumbprint * @member {object} [admCredential] The AdmCredential of the created * NotificationHub @@ -115,7 +115,7 @@ class NotificationHubResource extends models['Resource'] { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' diff --git a/lib/services/notificationHubsManagement/lib/models/operation.js b/lib/services/notificationHubsManagement/lib/models/operation.js new file mode 100644 index 0000000000..ba2ca01f8f --- /dev/null +++ b/lib/services/notificationHubsManagement/lib/models/operation.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A NotificationHubs REST API operation + * + */ +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.NotificationHubs + * @member {string} [display.resource] Resource on which the operation is + * performed: Invoice, etc. + * @member {string} [display.operation] Operation type: Read, write, delete, + * etc. + */ + constructor() { + } + + /** + * Defines the metadata of Operation + * + * @returns {object} metadata of Operation + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation', + type: { + name: 'Composite', + className: 'Operation', + modelProperties: { + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'Composite', + className: 'OperationDisplay' + } + } + } + } + }; + } +} + +module.exports = Operation; diff --git a/lib/services/notificationHubsManagement/lib/models/operationDisplay.js b/lib/services/notificationHubsManagement/lib/models/operationDisplay.js new file mode 100644 index 0000000000..df52b8662d --- /dev/null +++ b/lib/services/notificationHubsManagement/lib/models/operationDisplay.js @@ -0,0 +1,72 @@ +/* + * 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 object that represents the operation. + * + */ +class OperationDisplay { + /** + * Create a OperationDisplay. + * @member {string} [provider] Service provider: Microsoft.NotificationHubs + * @member {string} [resource] Resource on which the operation is performed: + * Invoice, etc. + * @member {string} [operation] Operation type: Read, write, delete, etc. + */ + constructor() { + } + + /** + * Defines the metadata of OperationDisplay + * + * @returns {object} metadata of OperationDisplay + * + */ + mapper() { + return { + required: false, + serializedName: 'Operation_display', + type: { + name: 'Composite', + className: 'OperationDisplay', + modelProperties: { + provider: { + required: false, + readOnly: true, + serializedName: 'provider', + type: { + name: 'String' + } + }, + resource: { + required: false, + readOnly: true, + serializedName: 'resource', + type: { + name: 'String' + } + }, + operation: { + required: false, + readOnly: true, + serializedName: 'operation', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationDisplay; diff --git a/lib/services/notificationHubsManagement/lib/models/operationListResult.js b/lib/services/notificationHubsManagement/lib/models/operationListResult.js new file mode 100644 index 0000000000..0339d6054e --- /dev/null +++ b/lib/services/notificationHubsManagement/lib/models/operationListResult.js @@ -0,0 +1,71 @@ +/* + * 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'; + +/** + * Result of the request to list NotificationHubs operations. It contains a + * list of operations and a URL link to get the next set of results. + */ +class OperationListResult extends Array { + /** + * Create a OperationListResult. + * @member {string} [nextLink] URL to get the next set of operation list + * results if there are any. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of OperationListResult + * + * @returns {object} metadata of OperationListResult + * + */ + mapper() { + return { + required: false, + serializedName: 'OperationListResult', + type: { + name: 'Composite', + className: 'OperationListResult', + modelProperties: { + value: { + required: false, + readOnly: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = OperationListResult; diff --git a/lib/services/notificationHubsManagement/lib/models/pnsCredentialsResource.js b/lib/services/notificationHubsManagement/lib/models/pnsCredentialsResource.js index 95e9e3d445..81e864bc30 100644 --- a/lib/services/notificationHubsManagement/lib/models/pnsCredentialsResource.js +++ b/lib/services/notificationHubsManagement/lib/models/pnsCredentialsResource.js @@ -26,7 +26,7 @@ class PnsCredentialsResource extends models['Resource'] { * @member {string} [apnsCredential.certificateKey] The certificate key. * @member {string} [apnsCredential.endpoint] The endpoint of this * credential. - * @member {string} [apnsCredential.thumbprint] The Apns certificate + * @member {string} [apnsCredential.thumbprint] The APNS certificate * Thumbprint * @member {string} [apnsCredential.keyId] A 10-character key identifier * (kid) key, obtained from your developer account @@ -52,7 +52,7 @@ class PnsCredentialsResource extends models['Resource'] { * @member {string} [mpnsCredential.mpnsCertificate] The MPNS certificate. * @member {string} [mpnsCredential.certificateKey] The certificate key for * this credential. - * @member {string} [mpnsCredential.thumbprint] The Mpns certificate + * @member {string} [mpnsCredential.thumbprint] The MPNS certificate * Thumbprint * @member {object} [admCredential] The AdmCredential of the created * NotificationHub @@ -110,7 +110,7 @@ class PnsCredentialsResource extends models['Resource'] { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' diff --git a/lib/services/notificationHubsManagement/lib/models/resource.js b/lib/services/notificationHubsManagement/lib/models/resource.js index 0cec78de51..3b09c4a2fc 100644 --- a/lib/services/notificationHubsManagement/lib/models/resource.js +++ b/lib/services/notificationHubsManagement/lib/models/resource.js @@ -22,7 +22,7 @@ class Resource extends models['BaseResource'] { * @member {string} [id] Resource Id * @member {string} [name] Resource name * @member {string} [type] Resource type - * @member {string} location Resource location + * @member {string} [location] Resource location * @member {object} [tags] Resource tags * @member {object} [sku] The sku of the created namespace * @member {string} [sku.name] Name of the notification hub sku. Possible @@ -75,7 +75,7 @@ class Resource extends models['BaseResource'] { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' diff --git a/lib/services/notificationHubsManagement/lib/models/sharedAccessAuthorizationRuleCreateOrUpdateParameters.js b/lib/services/notificationHubsManagement/lib/models/sharedAccessAuthorizationRuleCreateOrUpdateParameters.js index 341b5b99eb..947a083991 100644 --- a/lib/services/notificationHubsManagement/lib/models/sharedAccessAuthorizationRuleCreateOrUpdateParameters.js +++ b/lib/services/notificationHubsManagement/lib/models/sharedAccessAuthorizationRuleCreateOrUpdateParameters.js @@ -10,22 +10,32 @@ 'use strict'; -const models = require('./index'); - /** * Parameters supplied to the CreateOrUpdate Namespace AuthorizationRules. * - * @extends models['Resource'] */ -class SharedAccessAuthorizationRuleCreateOrUpdateParameters extends models['Resource'] { +class SharedAccessAuthorizationRuleCreateOrUpdateParameters { /** * Create a SharedAccessAuthorizationRuleCreateOrUpdateParameters. * @member {object} properties Properties of the Namespace * AuthorizationRules. * @member {array} [properties.rights] The rights associated with the rule. + * @member {string} [properties.primaryKey] A base64-encoded 256-bit primary + * key for signing and validating the SAS token. + * @member {string} [properties.secondaryKey] A base64-encoded 256-bit + * primary key for signing and validating the SAS token. + * @member {string} [properties.keyName] A string that describes the + * authorization rule. + * @member {string} [properties.claimType] A string that describes the claim + * type + * @member {string} [properties.claimValue] A string that describes the claim + * value + * @member {string} [properties.modifiedTime] The last modified time for this + * rule + * @member {string} [properties.createdTime] The created time for this rule + * @member {number} [properties.revision] The revision number for the rule */ constructor() { - super(); } /** @@ -42,59 +52,6 @@ class SharedAccessAuthorizationRuleCreateOrUpdateParameters extends models['Reso name: 'Composite', className: 'SharedAccessAuthorizationRuleCreateOrUpdateParameters', modelProperties: { - id: { - required: false, - readOnly: true, - serializedName: 'id', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - type: { - required: false, - readOnly: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - location: { - required: true, - serializedName: 'location', - type: { - name: 'String' - } - }, - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - sku: { - required: false, - serializedName: 'sku', - type: { - name: 'Composite', - className: 'Sku' - } - }, properties: { required: true, serializedName: 'properties', diff --git a/lib/services/notificationHubsManagement/lib/models/sharedAccessAuthorizationRuleProperties.js b/lib/services/notificationHubsManagement/lib/models/sharedAccessAuthorizationRuleProperties.js index aef59caec7..a250cc060e 100644 --- a/lib/services/notificationHubsManagement/lib/models/sharedAccessAuthorizationRuleProperties.js +++ b/lib/services/notificationHubsManagement/lib/models/sharedAccessAuthorizationRuleProperties.js @@ -18,6 +18,16 @@ class SharedAccessAuthorizationRuleProperties { /** * Create a SharedAccessAuthorizationRuleProperties. * @member {array} [rights] The rights associated with the rule. + * @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 authorization rule. + * @member {string} [claimType] A string that describes the claim type + * @member {string} [claimValue] A string that describes the claim value + * @member {string} [modifiedTime] The last modified time for this rule + * @member {string} [createdTime] The created time for this rule + * @member {number} [revision] The revision number for the rule */ constructor() { } @@ -50,6 +60,70 @@ class SharedAccessAuthorizationRuleProperties { } } } + }, + primaryKey: { + required: false, + readOnly: true, + serializedName: 'primaryKey', + type: { + name: 'String' + } + }, + secondaryKey: { + required: false, + readOnly: true, + serializedName: 'secondaryKey', + type: { + name: 'String' + } + }, + keyName: { + required: false, + readOnly: true, + serializedName: 'keyName', + type: { + name: 'String' + } + }, + claimType: { + required: false, + readOnly: true, + serializedName: 'claimType', + type: { + name: 'String' + } + }, + claimValue: { + required: false, + readOnly: true, + serializedName: 'claimValue', + type: { + name: 'String' + } + }, + modifiedTime: { + required: false, + readOnly: true, + serializedName: 'modifiedTime', + type: { + name: 'String' + } + }, + createdTime: { + required: false, + readOnly: true, + serializedName: 'createdTime', + type: { + name: 'String' + } + }, + revision: { + required: false, + readOnly: true, + serializedName: 'revision', + type: { + name: 'Number' + } } } } diff --git a/lib/services/notificationHubsManagement/lib/models/sharedAccessAuthorizationRuleResource.js b/lib/services/notificationHubsManagement/lib/models/sharedAccessAuthorizationRuleResource.js index 5826f5886c..5b9f076d19 100644 --- a/lib/services/notificationHubsManagement/lib/models/sharedAccessAuthorizationRuleResource.js +++ b/lib/services/notificationHubsManagement/lib/models/sharedAccessAuthorizationRuleResource.js @@ -21,6 +21,16 @@ class SharedAccessAuthorizationRuleResource extends models['Resource'] { /** * Create a SharedAccessAuthorizationRuleResource. * @member {array} [rights] The rights associated with the rule. + * @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 authorization rule. + * @member {string} [claimType] A string that describes the claim type + * @member {string} [claimValue] A string that describes the claim value + * @member {string} [modifiedTime] The last modified time for this rule + * @member {string} [createdTime] The created time for this rule + * @member {number} [revision] The revision number for the rule */ constructor() { super(); @@ -65,7 +75,7 @@ class SharedAccessAuthorizationRuleResource extends models['Resource'] { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' @@ -107,6 +117,70 @@ class SharedAccessAuthorizationRuleResource extends models['Resource'] { } } } + }, + primaryKey: { + required: false, + readOnly: true, + serializedName: 'properties.primaryKey', + type: { + name: 'String' + } + }, + secondaryKey: { + required: false, + readOnly: true, + serializedName: 'properties.secondaryKey', + type: { + name: 'String' + } + }, + keyName: { + required: false, + readOnly: true, + serializedName: 'properties.keyName', + type: { + name: 'String' + } + }, + claimType: { + required: false, + readOnly: true, + serializedName: 'properties.claimType', + type: { + name: 'String' + } + }, + claimValue: { + required: false, + readOnly: true, + serializedName: 'properties.claimValue', + type: { + name: 'String' + } + }, + modifiedTime: { + required: false, + readOnly: true, + serializedName: 'properties.modifiedTime', + type: { + name: 'String' + } + }, + createdTime: { + required: false, + readOnly: true, + serializedName: 'properties.createdTime', + type: { + name: 'String' + } + }, + revision: { + required: false, + readOnly: true, + serializedName: 'properties.revision', + type: { + name: 'Number' + } } } } diff --git a/lib/services/notificationHubsManagement/lib/notificationHubsManagementClient.d.ts b/lib/services/notificationHubsManagement/lib/notificationHubsManagementClient.d.ts index 546a0857b9..a218397851 100644 --- a/lib/services/notificationHubsManagement/lib/notificationHubsManagementClient.d.ts +++ b/lib/services/notificationHubsManagement/lib/notificationHubsManagementClient.d.ts @@ -10,9 +10,10 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class NotificationHubsManagementClient extends AzureServiceClient { +export default class NotificationHubsManagementClient extends AzureServiceClient { /** * Initializes a new instance of the NotificationHubsManagementClient class. * @constructor @@ -33,11 +34,11 @@ declare class NotificationHubsManagementClient extends AzureServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. + * @param {string} [options.acceptLanguage] - The preferred language for the response. * - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. * - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. * */ constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); @@ -55,10 +56,9 @@ declare class NotificationHubsManagementClient extends AzureServiceClient { generateClientRequestId: boolean; // Operation groups + operations: operations.Operations; namespaces: operations.Namespaces; - name: operations.Name; notificationHubs: operations.NotificationHubs; - hubs: operations.Hubs; } -export = NotificationHubsManagementClient; +export { NotificationHubsManagementClient, models as NotificationHubsManagementModels }; diff --git a/lib/services/notificationHubsManagement/lib/notificationHubsManagementClient.js b/lib/services/notificationHubsManagement/lib/notificationHubsManagementClient.js index e583acd842..1f69f88401 100644 --- a/lib/services/notificationHubsManagement/lib/notificationHubsManagementClient.js +++ b/lib/services/notificationHubsManagement/lib/notificationHubsManagementClient.js @@ -34,9 +34,9 @@ class NotificationHubsManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { @@ -72,10 +72,9 @@ class NotificationHubsManagementClient extends ServiceClient { if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { this.generateClientRequestId = options.generateClientRequestId; } + this.operations = new operations.Operations(this); this.namespaces = new operations.Namespaces(this); - this.name = new operations.Name(this); this.notificationHubs = new operations.NotificationHubs(this); - this.hubs = new operations.Hubs(this); this.models = models; msRest.addSerializationMixin(this); } @@ -83,3 +82,6 @@ class NotificationHubsManagementClient extends ServiceClient { } module.exports = NotificationHubsManagementClient; +module.exports['default'] = NotificationHubsManagementClient; +module.exports.NotificationHubsManagementClient = NotificationHubsManagementClient; +module.exports.NotificationHubsManagementModels = models; diff --git a/lib/services/notificationHubsManagement/lib/operations/index.d.ts b/lib/services/notificationHubsManagement/lib/operations/index.d.ts index 576d658926..8ab484bd0c 100644 --- a/lib/services/notificationHubsManagement/lib/operations/index.d.ts +++ b/lib/services/notificationHubsManagement/lib/operations/index.d.ts @@ -12,6 +12,123 @@ import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationRes import * as models from '../models'; +/** + * @class + * Operations + * __NOTE__: An instance of this class is automatically created for an + * instance of the NotificationHubsManagementClient. + */ +export interface Operations { + + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @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 {OperationListResult} - 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. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} 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. + */ + list(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationListResult} - 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. + * + * {OperationListResult} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * Namespaces @@ -30,7 +147,7 @@ export interface Namespaces { * * @param {string} parameters.name Resource name * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -72,7 +189,7 @@ export interface Namespaces { * * @param {string} parameters.name Resource name * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -153,6 +270,8 @@ export interface Namespaces { * * @param {date} [parameters.createdAt] The time the namespace was created. * + * @param {date} [parameters.updatedAt] The time the namespace was updated. + * * @param {string} [parameters.serviceBusEndpoint] Endpoint you can use to * perform NotificationHub operations. * @@ -168,10 +287,12 @@ export interface Namespaces { * @param {boolean} [parameters.critical] Whether or not the namespace is set * as Critical. * + * @param {string} [parameters.dataCenter] Data center for the namespace + * * @param {string} [parameters.namespaceType] The namespace type. Possible * values include: 'Messaging', 'NotificationHub' * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -229,6 +350,8 @@ export interface Namespaces { * * @param {date} [parameters.createdAt] The time the namespace was created. * + * @param {date} [parameters.updatedAt] The time the namespace was updated. + * * @param {string} [parameters.serviceBusEndpoint] Endpoint you can use to * perform NotificationHub operations. * @@ -244,10 +367,12 @@ export interface Namespaces { * @param {boolean} [parameters.critical] Whether or not the namespace is set * as Critical. * + * @param {string} [parameters.dataCenter] Data center for the namespace + * * @param {string} [parameters.namespaceType] The namespace type. Possible * values include: 'Messaging', 'NotificationHub' * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -517,7 +642,7 @@ export interface Namespaces { * * @param {string} namespaceName The namespace name. * - * @param {string} authorizationRuleName Aauthorization Rule Name. + * @param {string} authorizationRuleName Authorization Rule Name. * * @param {object} parameters The shared access authorization rule. * @@ -527,23 +652,6 @@ export interface Namespaces { * @param {array} [parameters.properties.rights] The rights associated with the * rule. * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [parameters.sku] The sku of the created namespace - * - * @param {string} parameters.sku.name Name of the notification hub sku. - * Possible values include: 'Free', 'Basic', 'Standard' - * - * @param {string} [parameters.sku.tier] The tier of particular sku - * - * @param {string} [parameters.sku.size] The Sku size - * - * @param {string} [parameters.sku.family] The Sku Family - * - * @param {number} [parameters.sku.capacity] The capacity of the resource - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -564,7 +672,7 @@ export interface Namespaces { * * @param {string} namespaceName The namespace name. * - * @param {string} authorizationRuleName Aauthorization Rule Name. + * @param {string} authorizationRuleName Authorization Rule Name. * * @param {object} parameters The shared access authorization rule. * @@ -574,23 +682,6 @@ export interface Namespaces { * @param {array} [parameters.properties.rights] The rights associated with the * rule. * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [parameters.sku] The sku of the created namespace - * - * @param {string} parameters.sku.name Name of the notification hub sku. - * Possible values include: 'Free', 'Basic', 'Standard' - * - * @param {string} [parameters.sku.tier] The tier of particular sku - * - * @param {string} [parameters.sku.size] The Sku size - * - * @param {string} [parameters.sku.family] The Sku Family - * - * @param {number} [parameters.sku.capacity] The capacity of the resource - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -939,11 +1030,11 @@ export interface Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listKeysWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listKeysWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets the Primary and Secondary ConnectionStrings to the namespace @@ -967,7 +1058,7 @@ export interface Namespaces { * * {Promise} A promise is returned. * - * @resolve {ResourceListKeys} - The deserialized result object. + * @resolve {SharedAccessAuthorizationRuleListResult} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -975,16 +1066,17 @@ export interface Namespaces { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ResourceListKeys} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceListKeys} for more information. + * {SharedAccessAuthorizationRuleListResult} [result] - The deserialized result object if an error did not occur. + * See {@link SharedAccessAuthorizationRuleListResult} 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. */ - listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, callback: ServiceCallback): void; - listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, callback: ServiceCallback): void; + listKeys(resourceGroupName: string, namespaceName: string, authorizationRuleName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -1300,79 +1392,6 @@ export interface Namespaces { listAuthorizationRulesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } -/** - * @class - * Name - * __NOTE__: An instance of this class is automatically created for an - * instance of the NotificationHubsManagementClient. - */ -export interface Name { - - - /** - * Checks the availability of the given service namespace across all Azure - * subscriptions. This is useful because the domain name is created based on - * the service namespace name. - * - * @param {object} parameters The namespace name. - * - * @param {string} parameters.name Resource 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. - */ - checkAvailabilityWithHttpOperationResponse(parameters: models.CheckNameAvailabilityRequestParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Checks the availability of the given service namespace across all Azure - * subscriptions. This is useful because the domain name is created based on - * the service namespace name. - * - * @param {object} parameters The namespace name. - * - * @param {string} parameters.name Resource 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 {CheckNameAvailabilityResponse} - 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. - * - * {CheckNameAvailabilityResponse} [result] - The deserialized result object if an error did not occur. - * See {@link CheckNameAvailabilityResponse} 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. - */ - checkAvailability(parameters: models.CheckNameAvailabilityRequestParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkAvailability(parameters: models.CheckNameAvailabilityRequestParameters, callback: ServiceCallback): void; - checkAvailability(parameters: models.CheckNameAvailabilityRequestParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - /** * @class * NotificationHubs @@ -1393,7 +1412,7 @@ export interface NotificationHubs { * * @param {string} parameters.name Resource name * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -1424,7 +1443,7 @@ export interface NotificationHubs { * * @reject {Error|ServiceError} - The error object. */ - checkAvailabilityWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, parameters: models.CheckAvailabilityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + checkNotificationHubAvailabilityWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, parameters: models.CheckAvailabilityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Checks the availability of the given notificationHub in a namespace. @@ -1437,7 +1456,7 @@ export interface NotificationHubs { * * @param {string} parameters.name Resource name * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -1485,9 +1504,9 @@ export interface NotificationHubs { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - checkAvailability(resourceGroupName: string, namespaceName: string, parameters: models.CheckAvailabilityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkAvailability(resourceGroupName: string, namespaceName: string, parameters: models.CheckAvailabilityParameters, callback: ServiceCallback): void; - checkAvailability(resourceGroupName: string, namespaceName: string, parameters: models.CheckAvailabilityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + checkNotificationHubAvailability(resourceGroupName: string, namespaceName: string, parameters: models.CheckAvailabilityParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + checkNotificationHubAvailability(resourceGroupName: string, namespaceName: string, parameters: models.CheckAvailabilityParameters, callback: ServiceCallback): void; + checkNotificationHubAvailability(resourceGroupName: string, namespaceName: string, parameters: models.CheckAvailabilityParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -1523,7 +1542,7 @@ export interface NotificationHubs { * @param {string} [parameters.apnsCredential.endpoint] The endpoint of this * credential. * - * @param {string} [parameters.apnsCredential.thumbprint] The Apns certificate + * @param {string} [parameters.apnsCredential.thumbprint] The APNS certificate * Thumbprint * * @param {string} [parameters.apnsCredential.keyId] A 10-character key @@ -1566,7 +1585,7 @@ export interface NotificationHubs { * @param {string} [parameters.mpnsCredential.certificateKey] The certificate * key for this credential. * - * @param {string} [parameters.mpnsCredential.thumbprint] The Mpns certificate + * @param {string} [parameters.mpnsCredential.thumbprint] The MPNS certificate * Thumbprint * * @param {object} [parameters.admCredential] The AdmCredential of the created @@ -1589,7 +1608,7 @@ export interface NotificationHubs { * * @param {string} [parameters.baiduCredential.baiduSecretKey] Baidu Secret Key * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -1652,7 +1671,7 @@ export interface NotificationHubs { * @param {string} [parameters.apnsCredential.endpoint] The endpoint of this * credential. * - * @param {string} [parameters.apnsCredential.thumbprint] The Apns certificate + * @param {string} [parameters.apnsCredential.thumbprint] The APNS certificate * Thumbprint * * @param {string} [parameters.apnsCredential.keyId] A 10-character key @@ -1695,7 +1714,7 @@ export interface NotificationHubs { * @param {string} [parameters.mpnsCredential.certificateKey] The certificate * key for this credential. * - * @param {string} [parameters.mpnsCredential.thumbprint] The Mpns certificate + * @param {string} [parameters.mpnsCredential.thumbprint] The MPNS certificate * Thumbprint * * @param {object} [parameters.admCredential] The AdmCredential of the created @@ -1718,7 +1737,7 @@ export interface NotificationHubs { * * @param {string} [parameters.baiduCredential.baiduSecretKey] Baidu Secret Key * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -1769,7 +1788,7 @@ export interface NotificationHubs { /** - * Deletes a notification hub associated with a namespace. + * Patch a NotificationHub in a namespace. * * @param {string} resourceGroupName The name of the resource group. * @@ -1779,67 +1798,119 @@ export interface NotificationHubs { * * @param {object} [options] Optional Parameters. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} [options.parameters] Parameters supplied to patch a + * NotificationHub Resource. * - * @returns {Promise} A promise is returned + * @param {string} [options.parameters.notificationHubPatchParametersName] The + * NotificationHub name. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {string} [options.parameters.registrationTtl] The RegistrationTtl of + * the created NotificationHub * - * @reject {Error|ServiceError} - The error object. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes a notification hub associated with a namespace. + * @param {array} [options.parameters.authorizationRules] The + * AuthorizationRules of the created NotificationHub * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} [options.parameters.apnsCredential] The ApnsCredential of + * the created NotificationHub * - * @param {string} namespaceName The namespace name. + * @param {string} [options.parameters.apnsCredential.apnsCertificate] The APNS + * certificate. * - * @param {string} notificationHubName The notification hub name. + * @param {string} [options.parameters.apnsCredential.certificateKey] The + * certificate key. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.parameters.apnsCredential.endpoint] The endpoint of + * this credential. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [options.parameters.apnsCredential.thumbprint] The APNS + * certificate Thumbprint * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [options.parameters.apnsCredential.keyId] A 10-character key + * identifier (kid) key, obtained from your developer account * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * @param {string} [options.parameters.apnsCredential.appName] The name of the + * application * - * {Promise} A promise is returned. + * @param {string} [options.parameters.apnsCredential.appId] The issuer (iss) + * registered claim key, whose value is your 10-character Team ID, obtained + * from your developer account * - * @resolve {null} - The deserialized result object. + * @param {string} [options.parameters.apnsCredential.token] Provider + * Authentication Token, obtained through your developer account * - * @reject {Error|ServiceError} - The error object. + * @param {object} [options.parameters.wnsCredential] The WnsCredential of the + * created NotificationHub * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [options.parameters.wnsCredential.packageSid] The package ID + * for this credential. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {string} [options.parameters.wnsCredential.secretKey] The secret key. * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} [options.parameters.wnsCredential.windowsLiveEndpoint] The + * Windows Live endpoint. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} [options.parameters.gcmCredential] The GcmCredential of the + * created NotificationHub * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, namespaceName: string, notificationHubName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, namespaceName: string, notificationHubName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Lists the notification hubs associated with a namespace. + * @param {string} [options.parameters.gcmCredential.gcmEndpoint] The GCM + * endpoint. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [options.parameters.gcmCredential.googleApiKey] The Google + * API key. * - * @param {string} namespaceName The namespace name. + * @param {object} [options.parameters.mpnsCredential] The MpnsCredential of + * the created NotificationHub * - * @param {string} notificationHubName The notification hub name. + * @param {string} [options.parameters.mpnsCredential.mpnsCertificate] The MPNS + * certificate. * - * @param {object} [options] Optional Parameters. + * @param {string} [options.parameters.mpnsCredential.certificateKey] The + * certificate key for this credential. + * + * @param {string} [options.parameters.mpnsCredential.thumbprint] The MPNS + * certificate Thumbprint + * + * @param {object} [options.parameters.admCredential] The AdmCredential of the + * created NotificationHub + * + * @param {string} [options.parameters.admCredential.clientId] The client + * identifier. + * + * @param {string} [options.parameters.admCredential.clientSecret] The + * credential secret access key. + * + * @param {string} [options.parameters.admCredential.authTokenUrl] The URL of + * the authorization token. + * + * @param {object} [options.parameters.baiduCredential] The BaiduCredential of + * the created NotificationHub + * + * @param {string} [options.parameters.baiduCredential.baiduApiKey] Baidu Api + * Key. + * + * @param {string} [options.parameters.baiduCredential.baiduEndPoint] Baidu + * Endpoint. + * + * @param {string} [options.parameters.baiduCredential.baiduSecretKey] Baidu + * Secret Key + * + * @param {string} [options.parameters.location] Resource location + * + * @param {object} [options.parameters.tags] Resource tags + * + * @param {object} [options.parameters.sku] The sku of the created namespace + * + * @param {string} options.parameters.sku.name Name of the notification hub + * sku. Possible values include: 'Free', 'Basic', 'Standard' + * + * @param {string} [options.parameters.sku.tier] The tier of particular sku + * + * @param {string} [options.parameters.sku.size] The Sku size + * + * @param {string} [options.parameters.sku.family] The Sku Family + * + * @param {number} [options.parameters.sku.capacity] The capacity of the + * resource * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1850,10 +1921,10 @@ export interface NotificationHubs { * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + patchWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: { parameters? : models.NotificationHubPatchParameters, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Lists the notification hubs associated with a namespace. + * Patch a NotificationHub in a namespace. * * @param {string} resourceGroupName The name of the resource group. * @@ -1863,6 +1934,120 @@ export interface NotificationHubs { * * @param {object} [options] Optional Parameters. * + * @param {object} [options.parameters] Parameters supplied to patch a + * NotificationHub Resource. + * + * @param {string} [options.parameters.notificationHubPatchParametersName] The + * NotificationHub name. + * + * @param {string} [options.parameters.registrationTtl] The RegistrationTtl of + * the created NotificationHub + * + * @param {array} [options.parameters.authorizationRules] The + * AuthorizationRules of the created NotificationHub + * + * @param {object} [options.parameters.apnsCredential] The ApnsCredential of + * the created NotificationHub + * + * @param {string} [options.parameters.apnsCredential.apnsCertificate] The APNS + * certificate. + * + * @param {string} [options.parameters.apnsCredential.certificateKey] The + * certificate key. + * + * @param {string} [options.parameters.apnsCredential.endpoint] The endpoint of + * this credential. + * + * @param {string} [options.parameters.apnsCredential.thumbprint] The APNS + * certificate Thumbprint + * + * @param {string} [options.parameters.apnsCredential.keyId] A 10-character key + * identifier (kid) key, obtained from your developer account + * + * @param {string} [options.parameters.apnsCredential.appName] The name of the + * application + * + * @param {string} [options.parameters.apnsCredential.appId] The issuer (iss) + * registered claim key, whose value is your 10-character Team ID, obtained + * from your developer account + * + * @param {string} [options.parameters.apnsCredential.token] Provider + * Authentication Token, obtained through your developer account + * + * @param {object} [options.parameters.wnsCredential] The WnsCredential of the + * created NotificationHub + * + * @param {string} [options.parameters.wnsCredential.packageSid] The package ID + * for this credential. + * + * @param {string} [options.parameters.wnsCredential.secretKey] The secret key. + * + * @param {string} [options.parameters.wnsCredential.windowsLiveEndpoint] The + * Windows Live endpoint. + * + * @param {object} [options.parameters.gcmCredential] The GcmCredential of the + * created NotificationHub + * + * @param {string} [options.parameters.gcmCredential.gcmEndpoint] The GCM + * endpoint. + * + * @param {string} [options.parameters.gcmCredential.googleApiKey] The Google + * API key. + * + * @param {object} [options.parameters.mpnsCredential] The MpnsCredential of + * the created NotificationHub + * + * @param {string} [options.parameters.mpnsCredential.mpnsCertificate] The MPNS + * certificate. + * + * @param {string} [options.parameters.mpnsCredential.certificateKey] The + * certificate key for this credential. + * + * @param {string} [options.parameters.mpnsCredential.thumbprint] The MPNS + * certificate Thumbprint + * + * @param {object} [options.parameters.admCredential] The AdmCredential of the + * created NotificationHub + * + * @param {string} [options.parameters.admCredential.clientId] The client + * identifier. + * + * @param {string} [options.parameters.admCredential.clientSecret] The + * credential secret access key. + * + * @param {string} [options.parameters.admCredential.authTokenUrl] The URL of + * the authorization token. + * + * @param {object} [options.parameters.baiduCredential] The BaiduCredential of + * the created NotificationHub + * + * @param {string} [options.parameters.baiduCredential.baiduApiKey] Baidu Api + * Key. + * + * @param {string} [options.parameters.baiduCredential.baiduEndPoint] Baidu + * Endpoint. + * + * @param {string} [options.parameters.baiduCredential.baiduSecretKey] Baidu + * Secret Key + * + * @param {string} [options.parameters.location] Resource location + * + * @param {object} [options.parameters.tags] Resource tags + * + * @param {object} [options.parameters.sku] The sku of the created namespace + * + * @param {string} options.parameters.sku.name Name of the notification hub + * sku. Possible values include: 'Free', 'Basic', 'Standard' + * + * @param {string} [options.parameters.sku.tier] The tier of particular sku + * + * @param {string} [options.parameters.sku.size] The Sku size + * + * @param {string} [options.parameters.sku.family] The Sku Family + * + * @param {number} [options.parameters.sku.capacity] The capacity of the + * resource + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1889,13 +2074,13 @@ export interface NotificationHubs { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, namespaceName: string, notificationHubName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, namespaceName: string, notificationHubName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + patch(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: { parameters? : models.NotificationHubPatchParameters, customHeaders? : { [headerName: string]: string; } }): Promise; + patch(resourceGroupName: string, namespaceName: string, notificationHubName: string, callback: ServiceCallback): void; + patch(resourceGroupName: string, namespaceName: string, notificationHubName: string, options: { parameters? : models.NotificationHubPatchParameters, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates/Updates an authorization rule for a NotificationHub + * Deletes a notification hub associated with a namespace. * * @param {string} resourceGroupName The name of the resource group. * @@ -1903,32 +2088,67 @@ export interface NotificationHubs { * * @param {string} notificationHubName The notification hub name. * - * @param {string} authorizationRuleName Authorization Rule Name. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters The shared access authorization rule. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} parameters.properties Properties of the Namespace - * AuthorizationRules. + * @returns {Promise} A promise is returned * - * @param {array} [parameters.properties.rights] The rights associated with the - * rule. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} parameters.location Resource location + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Deletes a notification hub associated with a namespace. * - * @param {object} [parameters.tags] Resource tags + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [parameters.sku] The sku of the created namespace + * @param {string} namespaceName The namespace name. * - * @param {string} parameters.sku.name Name of the notification hub sku. - * Possible values include: 'Free', 'Basic', 'Standard' + * @param {string} notificationHubName The notification hub name. * - * @param {string} [parameters.sku.tier] The tier of particular sku + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.sku.size] The Sku size + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [parameters.sku.family] The Sku Family + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {number} [parameters.sku.capacity] The capacity of the resource + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, namespaceName: string, notificationHubName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, namespaceName: string, notificationHubName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Lists the notification hubs associated with a namespace. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} namespaceName The namespace name. + * + * @param {string} notificationHubName The notification hub name. * * @param {object} [options] Optional Parameters. * @@ -1937,11 +2157,120 @@ export interface NotificationHubs { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateAuthorizationRuleWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, notificationHubName: string, authorizationRuleName: string, parameters: models.SharedAccessAuthorizationRuleCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Lists the notification hubs associated with a namespace. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} namespaceName The namespace name. + * + * @param {string} notificationHubName The notification hub 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 {NotificationHubResource} - 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. + * + * {NotificationHubResource} [result] - The deserialized result object if an error did not occur. + * See {@link NotificationHubResource} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, namespaceName: string, notificationHubName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, namespaceName: string, notificationHubName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * test send a push notification + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} namespaceName The namespace name. + * + * @param {string} notificationHubName The notification hub name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Debug send 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. + */ + debugSendWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: { parameters? : any, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * test send a push notification + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} namespaceName The namespace name. + * + * @param {string} notificationHubName The notification hub name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Debug send 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 {DebugSendResponse} - 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. + * + * {DebugSendResponse} [result] - The deserialized result object if an error did not occur. + * See {@link DebugSendResponse} 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. + */ + debugSend(resourceGroupName: string, namespaceName: string, notificationHubName: string, options?: { parameters? : any, customHeaders? : { [headerName: string]: string; } }): Promise; + debugSend(resourceGroupName: string, namespaceName: string, notificationHubName: string, callback: ServiceCallback): void; + debugSend(resourceGroupName: string, namespaceName: string, notificationHubName: string, options: { parameters? : any, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** * Creates/Updates an authorization rule for a NotificationHub @@ -1962,22 +2291,37 @@ export interface NotificationHubs { * @param {array} [parameters.properties.rights] The rights associated with the * rule. * - * @param {string} parameters.location Resource location + * @param {object} [options] Optional Parameters. * - * @param {object} [parameters.tags] Resource tags + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.sku] The sku of the created namespace + * @returns {Promise} A promise is returned * - * @param {string} parameters.sku.name Name of the notification hub sku. - * Possible values include: 'Free', 'Basic', 'Standard' + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [parameters.sku.tier] The tier of particular sku + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateAuthorizationRuleWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, notificationHubName: string, authorizationRuleName: string, parameters: models.SharedAccessAuthorizationRuleCreateOrUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Creates/Updates an authorization rule for a NotificationHub * - * @param {string} [parameters.sku.size] The Sku size + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.sku.family] The Sku Family + * @param {string} namespaceName The namespace name. * - * @param {number} [parameters.sku.capacity] The capacity of the resource + * @param {string} notificationHubName The notification hub name. + * + * @param {string} authorizationRuleName Authorization Rule Name. + * + * @param {object} parameters The shared access authorization rule. + * + * @param {object} parameters.properties Properties of the Namespace + * AuthorizationRules. + * + * @param {array} [parameters.properties.rights] The rights associated with the + * rule. * * @param {object} [options] Optional Parameters. * @@ -2603,80 +2947,3 @@ export interface NotificationHubs { listAuthorizationRulesNext(nextPageLink: string, callback: ServiceCallback): void; listAuthorizationRulesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } - -/** - * @class - * Hubs - * __NOTE__: An instance of this class is automatically created for an - * instance of the NotificationHubsManagementClient. - */ -export interface Hubs { - - - /** - * Checks the availability of the given notificationHub in a namespace. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} namespaceName The namespace name. - * - * @param {object} parameters The notificationHub name. - * - * @param {string} parameters.name Resource 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. - */ - checkAvailabilityWithHttpOperationResponse(resourceGroupName: string, namespaceName: string, parameters: models.CheckNameAvailabilityRequestParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Checks the availability of the given notificationHub in a namespace. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} namespaceName The namespace name. - * - * @param {object} parameters The notificationHub name. - * - * @param {string} parameters.name Resource 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 {CheckNameAvailabilityResponse} - 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. - * - * {CheckNameAvailabilityResponse} [result] - The deserialized result object if an error did not occur. - * See {@link CheckNameAvailabilityResponse} 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. - */ - checkAvailability(resourceGroupName: string, namespaceName: string, parameters: models.CheckNameAvailabilityRequestParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - checkAvailability(resourceGroupName: string, namespaceName: string, parameters: models.CheckNameAvailabilityRequestParameters, callback: ServiceCallback): void; - checkAvailability(resourceGroupName: string, namespaceName: string, parameters: models.CheckNameAvailabilityRequestParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} diff --git a/lib/services/notificationHubsManagement/lib/operations/index.js b/lib/services/notificationHubsManagement/lib/operations/index.js index 4d829c9183..12476770b6 100644 --- a/lib/services/notificationHubsManagement/lib/operations/index.js +++ b/lib/services/notificationHubsManagement/lib/operations/index.js @@ -14,7 +14,6 @@ 'use strict'; +exports.Operations = require('./operations'); exports.Namespaces = require('./namespaces'); -exports.Name = require('./name'); exports.NotificationHubs = require('./notificationHubs'); -exports.Hubs = require('./hubs'); diff --git a/lib/services/notificationHubsManagement/lib/operations/namespaces.js b/lib/services/notificationHubsManagement/lib/operations/namespaces.js index 0b6e4b61fc..c7735edc50 100644 --- a/lib/services/notificationHubsManagement/lib/operations/namespaces.js +++ b/lib/services/notificationHubsManagement/lib/operations/namespaces.js @@ -23,7 +23,7 @@ const WebResource = msRest.WebResource; * * @param {string} parameters.name Resource name * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -219,6 +219,8 @@ function _checkAvailability(parameters, options, callback) { * * @param {date} [parameters.createdAt] The time the namespace was created. * + * @param {date} [parameters.updatedAt] The time the namespace was updated. + * * @param {string} [parameters.serviceBusEndpoint] Endpoint you can use to * perform NotificationHub operations. * @@ -234,10 +236,12 @@ function _checkAvailability(parameters, options, callback) { * @param {boolean} [parameters.critical] Whether or not the namespace is set * as Critical. * + * @param {string} [parameters.dataCenter] Data center for the namespace + * * @param {string} [parameters.namespaceType] The namespace type. Possible * values include: 'Messaging', 'NotificationHub' * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -359,7 +363,7 @@ function _createOrUpdate(resourceGroupName, namespaceName, parameters, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -388,7 +392,7 @@ function _createOrUpdate(resourceGroupName, namespaceName, parameters, options, let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (statusCode === 200) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -405,7 +409,7 @@ function _createOrUpdate(resourceGroupName, namespaceName, parameters, options, } } // Deserialize Response - if (statusCode === 200) { + if (statusCode === 201) { let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); @@ -822,7 +826,7 @@ function _get(resourceGroupName, namespaceName, options, callback) { * * @param {string} namespaceName The namespace name. * - * @param {string} authorizationRuleName Aauthorization Rule Name. + * @param {string} authorizationRuleName Authorization Rule Name. * * @param {object} parameters The shared access authorization rule. * @@ -832,23 +836,6 @@ function _get(resourceGroupName, namespaceName, options, callback) { * @param {array} [parameters.properties.rights] The rights associated with the * rule. * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [parameters.sku] The sku of the created namespace - * - * @param {string} parameters.sku.name Name of the notification hub sku. - * Possible values include: 'Free', 'Basic', 'Standard' - * - * @param {string} [parameters.sku.tier] The tier of particular sku - * - * @param {string} [parameters.sku.size] The Sku size - * - * @param {string} [parameters.sku.family] The Sku Family - * - * @param {number} [parameters.sku.capacity] The capacity of the resource - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1109,7 +1096,7 @@ function _deleteAuthorizationRule(resourceGroupName, namespaceName, authorizatio return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1737,7 +1724,8 @@ function _listAuthorizationRules(resourceGroupName, namespaceName, options, call * {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 ResourceListKeys} for more information. + * See {@link SharedAccessAuthorizationRuleListResult} for + * more information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -1852,7 +1840,7 @@ function _listKeys(resourceGroupName, namespaceName, authorizationRuleName, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceListKeys']().mapper(); + let resultMapper = new client.models['SharedAccessAuthorizationRuleListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2138,7 +2126,7 @@ function _beginDeleteMethod(resourceGroupName, namespaceName, options, callback) return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2590,7 +2578,7 @@ class Namespaces { * * @param {string} parameters.name Resource name * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -2644,7 +2632,7 @@ class Namespaces { * * @param {string} parameters.name Resource name * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -2740,6 +2728,8 @@ class Namespaces { * * @param {date} [parameters.createdAt] The time the namespace was created. * + * @param {date} [parameters.updatedAt] The time the namespace was updated. + * * @param {string} [parameters.serviceBusEndpoint] Endpoint you can use to * perform NotificationHub operations. * @@ -2755,10 +2745,12 @@ class Namespaces { * @param {boolean} [parameters.critical] Whether or not the namespace is set * as Critical. * + * @param {string} [parameters.dataCenter] Data center for the namespace + * * @param {string} [parameters.namespaceType] The namespace type. Possible * values include: 'Messaging', 'NotificationHub' * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -2828,6 +2820,8 @@ class Namespaces { * * @param {date} [parameters.createdAt] The time the namespace was created. * + * @param {date} [parameters.updatedAt] The time the namespace was updated. + * * @param {string} [parameters.serviceBusEndpoint] Endpoint you can use to * perform NotificationHub operations. * @@ -2843,10 +2837,12 @@ class Namespaces { * @param {boolean} [parameters.critical] Whether or not the namespace is set * as Critical. * + * @param {string} [parameters.dataCenter] Data center for the namespace + * * @param {string} [parameters.namespaceType] The namespace type. Possible * values include: 'Messaging', 'NotificationHub' * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -3212,7 +3208,7 @@ class Namespaces { * * @param {string} namespaceName The namespace name. * - * @param {string} authorizationRuleName Aauthorization Rule Name. + * @param {string} authorizationRuleName Authorization Rule Name. * * @param {object} parameters The shared access authorization rule. * @@ -3222,23 +3218,6 @@ class Namespaces { * @param {array} [parameters.properties.rights] The rights associated with the * rule. * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [parameters.sku] The sku of the created namespace - * - * @param {string} parameters.sku.name Name of the notification hub sku. - * Possible values include: 'Free', 'Basic', 'Standard' - * - * @param {string} [parameters.sku.tier] The tier of particular sku - * - * @param {string} [parameters.sku.size] The Sku size - * - * @param {string} [parameters.sku.family] The Sku Family - * - * @param {number} [parameters.sku.capacity] The capacity of the resource - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3271,7 +3250,7 @@ class Namespaces { * * @param {string} namespaceName The namespace name. * - * @param {string} authorizationRuleName Aauthorization Rule Name. + * @param {string} authorizationRuleName Authorization Rule Name. * * @param {object} parameters The shared access authorization rule. * @@ -3281,23 +3260,6 @@ class Namespaces { * @param {array} [parameters.properties.rights] The rights associated with the * rule. * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [parameters.sku] The sku of the created namespace - * - * @param {string} parameters.sku.name Name of the notification hub sku. - * Possible values include: 'Free', 'Basic', 'Standard' - * - * @param {string} [parameters.sku.tier] The tier of particular sku - * - * @param {string} [parameters.sku.size] The Sku size - * - * @param {string} [parameters.sku.family] The Sku Family - * - * @param {number} [parameters.sku.capacity] The capacity of the resource - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3796,7 +3758,7 @@ class Namespaces { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -3836,7 +3798,7 @@ class Namespaces { * * {Promise} A promise is returned * - * @resolve {ResourceListKeys} - The deserialized result object. + * @resolve {SharedAccessAuthorizationRuleListResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -3845,7 +3807,8 @@ class Namespaces { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceListKeys} for more information. + * See {@link SharedAccessAuthorizationRuleListResult} for + * more information. * * {object} [request] - The HTTP Request object if an error did not occur. * diff --git a/lib/services/notificationHubsManagement/lib/operations/notificationHubs.js b/lib/services/notificationHubsManagement/lib/operations/notificationHubs.js index 18045c28f4..cb29150564 100644 --- a/lib/services/notificationHubsManagement/lib/operations/notificationHubs.js +++ b/lib/services/notificationHubsManagement/lib/operations/notificationHubs.js @@ -25,7 +25,7 @@ const WebResource = msRest.WebResource; * * @param {string} parameters.name Resource name * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -64,7 +64,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _checkAvailability(resourceGroupName, namespaceName, parameters, options, callback) { +function _checkNotificationHubAvailability(resourceGroupName, namespaceName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -234,7 +234,7 @@ function _checkAvailability(resourceGroupName, namespaceName, parameters, option * @param {string} [parameters.apnsCredential.endpoint] The endpoint of this * credential. * - * @param {string} [parameters.apnsCredential.thumbprint] The Apns certificate + * @param {string} [parameters.apnsCredential.thumbprint] The APNS certificate * Thumbprint * * @param {string} [parameters.apnsCredential.keyId] A 10-character key @@ -277,7 +277,7 @@ function _checkAvailability(resourceGroupName, namespaceName, parameters, option * @param {string} [parameters.mpnsCredential.certificateKey] The certificate * key for this credential. * - * @param {string} [parameters.mpnsCredential.thumbprint] The Mpns certificate + * @param {string} [parameters.mpnsCredential.thumbprint] The MPNS certificate * Thumbprint * * @param {object} [parameters.admCredential] The AdmCredential of the created @@ -300,7 +300,7 @@ function _checkAvailability(resourceGroupName, namespaceName, parameters, option * * @param {string} [parameters.baiduCredential.baiduSecretKey] Baidu Secret Key * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -495,7 +495,7 @@ function _createOrUpdate(resourceGroupName, namespaceName, notificationHubName, } /** - * Deletes a notification hub associated with a namespace. + * Patch a NotificationHub in a namespace. * * @param {string} resourceGroupName The name of the resource group. * @@ -505,6 +505,120 @@ function _createOrUpdate(resourceGroupName, namespaceName, notificationHubName, * * @param {object} [options] Optional Parameters. * + * @param {object} [options.parameters] Parameters supplied to patch a + * NotificationHub Resource. + * + * @param {string} [options.parameters.notificationHubPatchParametersName] The + * NotificationHub name. + * + * @param {string} [options.parameters.registrationTtl] The RegistrationTtl of + * the created NotificationHub + * + * @param {array} [options.parameters.authorizationRules] The + * AuthorizationRules of the created NotificationHub + * + * @param {object} [options.parameters.apnsCredential] The ApnsCredential of + * the created NotificationHub + * + * @param {string} [options.parameters.apnsCredential.apnsCertificate] The APNS + * certificate. + * + * @param {string} [options.parameters.apnsCredential.certificateKey] The + * certificate key. + * + * @param {string} [options.parameters.apnsCredential.endpoint] The endpoint of + * this credential. + * + * @param {string} [options.parameters.apnsCredential.thumbprint] The APNS + * certificate Thumbprint + * + * @param {string} [options.parameters.apnsCredential.keyId] A 10-character key + * identifier (kid) key, obtained from your developer account + * + * @param {string} [options.parameters.apnsCredential.appName] The name of the + * application + * + * @param {string} [options.parameters.apnsCredential.appId] The issuer (iss) + * registered claim key, whose value is your 10-character Team ID, obtained + * from your developer account + * + * @param {string} [options.parameters.apnsCredential.token] Provider + * Authentication Token, obtained through your developer account + * + * @param {object} [options.parameters.wnsCredential] The WnsCredential of the + * created NotificationHub + * + * @param {string} [options.parameters.wnsCredential.packageSid] The package ID + * for this credential. + * + * @param {string} [options.parameters.wnsCredential.secretKey] The secret key. + * + * @param {string} [options.parameters.wnsCredential.windowsLiveEndpoint] The + * Windows Live endpoint. + * + * @param {object} [options.parameters.gcmCredential] The GcmCredential of the + * created NotificationHub + * + * @param {string} [options.parameters.gcmCredential.gcmEndpoint] The GCM + * endpoint. + * + * @param {string} [options.parameters.gcmCredential.googleApiKey] The Google + * API key. + * + * @param {object} [options.parameters.mpnsCredential] The MpnsCredential of + * the created NotificationHub + * + * @param {string} [options.parameters.mpnsCredential.mpnsCertificate] The MPNS + * certificate. + * + * @param {string} [options.parameters.mpnsCredential.certificateKey] The + * certificate key for this credential. + * + * @param {string} [options.parameters.mpnsCredential.thumbprint] The MPNS + * certificate Thumbprint + * + * @param {object} [options.parameters.admCredential] The AdmCredential of the + * created NotificationHub + * + * @param {string} [options.parameters.admCredential.clientId] The client + * identifier. + * + * @param {string} [options.parameters.admCredential.clientSecret] The + * credential secret access key. + * + * @param {string} [options.parameters.admCredential.authTokenUrl] The URL of + * the authorization token. + * + * @param {object} [options.parameters.baiduCredential] The BaiduCredential of + * the created NotificationHub + * + * @param {string} [options.parameters.baiduCredential.baiduApiKey] Baidu Api + * Key. + * + * @param {string} [options.parameters.baiduCredential.baiduEndPoint] Baidu + * Endpoint. + * + * @param {string} [options.parameters.baiduCredential.baiduSecretKey] Baidu + * Secret Key + * + * @param {string} [options.parameters.location] Resource location + * + * @param {object} [options.parameters.tags] Resource tags + * + * @param {object} [options.parameters.sku] The sku of the created namespace + * + * @param {string} options.parameters.sku.name Name of the notification hub + * sku. Possible values include: 'Free', 'Basic', 'Standard' + * + * @param {string} [options.parameters.sku.tier] The tier of particular sku + * + * @param {string} [options.parameters.sku.size] The Sku size + * + * @param {string} [options.parameters.sku.family] The Sku Family + * + * @param {number} [options.parameters.sku.capacity] The capacity of the + * resource + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -514,13 +628,15 @@ function _createOrUpdate(resourceGroupName, namespaceName, notificationHubName, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NotificationHubResource} 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 _deleteMethod(resourceGroupName, namespaceName, notificationHubName, options, callback) { +function _patch(resourceGroupName, namespaceName, notificationHubName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -530,6 +646,7 @@ function _deleteMethod(resourceGroupName, namespaceName, notificationHubName, op if (!callback) { throw new Error('callback cannot be null.'); } + let parameters = (options && options.parameters !== undefined) ? options.parameters : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -569,7 +686,7 @@ function _deleteMethod(resourceGroupName, namespaceName, notificationHubName, op // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -587,7 +704,21 @@ function _deleteMethod(resourceGroupName, namespaceName, notificationHubName, op } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['NotificationHubPatchParameters']().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) { @@ -622,13 +753,30 @@ function _deleteMethod(resourceGroupName, namespaceName, notificationHubName, op // 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['NotificationHubResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * Lists the notification hubs associated with a namespace. + * Deletes a notification hub associated with a namespace. * * @param {string} resourceGroupName The name of the resource group. * @@ -647,15 +795,13 @@ function _deleteMethod(resourceGroupName, namespaceName, notificationHubName, op * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link NotificationHubResource} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _get(resourceGroupName, namespaceName, notificationHubName, options, callback) { +function _deleteMethod(resourceGroupName, namespaceName, notificationHubName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -704,7 +850,7 @@ function _get(resourceGroupName, namespaceName, notificationHubName, options, ca // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -757,30 +903,13 @@ function _get(resourceGroupName, namespaceName, notificationHubName, options, ca // 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['NotificationHubResource']().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/Updates an authorization rule for a NotificationHub + * Lists the notification hubs associated with a namespace. * * @param {string} resourceGroupName The name of the resource group. * @@ -788,33 +917,6 @@ function _get(resourceGroupName, namespaceName, notificationHubName, options, ca * * @param {string} notificationHubName The notification hub name. * - * @param {string} authorizationRuleName Authorization Rule Name. - * - * @param {object} parameters The shared access authorization rule. - * - * @param {object} parameters.properties Properties of the Namespace - * AuthorizationRules. - * - * @param {array} [parameters.properties.rights] The rights associated with the - * rule. - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [parameters.sku] The sku of the created namespace - * - * @param {string} parameters.sku.name Name of the notification hub sku. - * Possible values include: 'Free', 'Basic', 'Standard' - * - * @param {string} [parameters.sku.tier] The tier of particular sku - * - * @param {string} [parameters.sku.size] The Sku size - * - * @param {string} [parameters.sku.family] The Sku Family - * - * @param {number} [parameters.sku.capacity] The capacity of the resource - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -827,14 +929,14 @@ function _get(resourceGroupName, namespaceName, notificationHubName, options, ca * {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 SharedAccessAuthorizationRuleResource} for - * more information. + * See {@link NotificationHubResource} 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 _createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters, options, callback) { +function _get(resourceGroupName, namespaceName, notificationHubName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -855,12 +957,6 @@ function _createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, noti if (notificationHubName === null || notificationHubName === undefined || typeof notificationHubName.valueOf() !== 'string') { throw new Error('notificationHubName cannot be null or undefined and it must be of type string.'); } - if (authorizationRuleName === null || authorizationRuleName === undefined || typeof authorizationRuleName.valueOf() !== 'string') { - throw new Error('authorizationRuleName 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.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.'); } @@ -876,11 +972,10 @@ function _createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, noti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); requestUrl = requestUrl.replace('{notificationHubName}', encodeURIComponent(notificationHubName)); - requestUrl = requestUrl.replace('{authorizationRuleName}', encodeURIComponent(authorizationRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -890,7 +985,7 @@ function _createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, noti // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -908,21 +1003,7 @@ function _createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, noti } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['SharedAccessAuthorizationRuleCreateOrUpdateParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -964,7 +1045,7 @@ function _createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, noti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SharedAccessAuthorizationRuleResource']().mapper(); + let resultMapper = new client.models['NotificationHubResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -980,7 +1061,7 @@ function _createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, noti } /** - * Deletes a notificationHub authorization rule + * test send a push notification * * @param {string} resourceGroupName The name of the resource group. * @@ -988,10 +1069,10 @@ function _createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, noti * * @param {string} notificationHubName The notification hub name. * - * @param {string} authorizationRuleName Authorization Rule Name. - * * @param {object} [options] Optional Parameters. * + * @param {object} [options.parameters] Debug send parameters + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1001,13 +1082,14 @@ function _createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, noti * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link DebugSendResponse} 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 _deleteAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, options, callback) { +function _debugSend(resourceGroupName, namespaceName, notificationHubName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1017,6 +1099,7 @@ function _deleteAuthorizationRule(resourceGroupName, namespaceName, notification if (!callback) { throw new Error('callback cannot be null.'); } + let parameters = (options && options.parameters !== undefined) ? options.parameters : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1028,8 +1111,8 @@ function _deleteAuthorizationRule(resourceGroupName, namespaceName, notification if (notificationHubName === null || notificationHubName === undefined || typeof notificationHubName.valueOf() !== 'string') { throw new Error('notificationHubName cannot be null or undefined and it must be of type string.'); } - if (authorizationRuleName === null || authorizationRuleName === undefined || typeof authorizationRuleName.valueOf() !== 'string') { - throw new Error('authorizationRuleName cannot be null or undefined and it must be of type string.'); + if (parameters !== null && parameters !== undefined && typeof parameters !== 'object') { + throw new Error('parameters must be of type object.'); } 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.'); @@ -1046,11 +1129,10 @@ function _deleteAuthorizationRule(resourceGroupName, namespaceName, notification // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/debugsend'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); requestUrl = requestUrl.replace('{notificationHubName}', encodeURIComponent(notificationHubName)); - requestUrl = requestUrl.replace('{authorizationRuleName}', encodeURIComponent(authorizationRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -1060,7 +1142,7 @@ function _deleteAuthorizationRule(resourceGroupName, namespaceName, notification // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1078,14 +1160,34 @@ function _deleteAuthorizationRule(resourceGroupName, namespaceName, notification } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = { + required: false, + serializedName: 'parameters', + type: { + name: 'Object' + } + }; + 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 !== 204 && statusCode !== 200) { + if (statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1113,21 +1215,46 @@ function _deleteAuthorizationRule(resourceGroupName, namespaceName, notification // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['DebugSendResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } return callback(null, result, httpRequest, response); }); } /** - * Gets an authorization rule for a NotificationHub by name. + * Creates/Updates an authorization rule for a NotificationHub * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} namespaceName The namespace name + * @param {string} namespaceName The namespace name. * * @param {string} notificationHubName The notification hub name. * - * @param {string} authorizationRuleName authorization rule name. + * @param {string} authorizationRuleName Authorization Rule Name. + * + * @param {object} parameters The shared access authorization rule. + * + * @param {object} parameters.properties Properties of the Namespace + * AuthorizationRules. + * + * @param {array} [parameters.properties.rights] The rights associated with the + * rule. * * @param {object} [options] Optional Parameters. * @@ -1148,7 +1275,7 @@ function _deleteAuthorizationRule(resourceGroupName, namespaceName, notification * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, options, callback) { +function _createOrUpdateAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1172,6 +1299,9 @@ function _getAuthorizationRule(resourceGroupName, namespaceName, notificationHub if (authorizationRuleName === null || authorizationRuleName === undefined || typeof authorizationRuleName.valueOf() !== 'string') { throw new Error('authorizationRuleName 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.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.'); } @@ -1201,7 +1331,7 @@ function _getAuthorizationRule(resourceGroupName, namespaceName, notificationHub // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1219,15 +1349,29 @@ function _getAuthorizationRule(resourceGroupName, namespaceName, notificationHub } } } - 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); + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['SharedAccessAuthorizationRuleCreateOrUpdateParameters']().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); @@ -1277,12 +1421,16 @@ function _getAuthorizationRule(resourceGroupName, namespaceName, notificationHub } /** - * Lists the notification hubs associated with a namespace. + * Deletes a notificationHub authorization rule * * @param {string} resourceGroupName The name of the resource group. * * @param {string} namespaceName The namespace name. * + * @param {string} notificationHubName The notification hub name. + * + * @param {string} authorizationRuleName Authorization Rule Name. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1294,15 +1442,13 @@ function _getAuthorizationRule(resourceGroupName, namespaceName, notificationHub * * {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 NotificationHubListResult} for more - * information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _list(resourceGroupName, namespaceName, options, callback) { +function _deleteAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1320,6 +1466,12 @@ function _list(resourceGroupName, namespaceName, options, callback) { 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 (notificationHubName === null || notificationHubName === undefined || typeof notificationHubName.valueOf() !== 'string') { + throw new Error('notificationHubName cannot be null or undefined and it must be of type string.'); + } + if (authorizationRuleName === null || authorizationRuleName === undefined || typeof authorizationRuleName.valueOf() !== 'string') { + throw new Error('authorizationRuleName cannot be null or undefined and it must be of type string.'); + } 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.'); } @@ -1335,9 +1487,11 @@ function _list(resourceGroupName, namespaceName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{notificationHubName}', encodeURIComponent(notificationHubName)); + requestUrl = requestUrl.replace('{authorizationRuleName}', encodeURIComponent(authorizationRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -1347,7 +1501,7 @@ function _list(resourceGroupName, namespaceName, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1372,7 +1526,7 @@ function _list(resourceGroupName, namespaceName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1400,30 +1554,13 @@ function _list(resourceGroupName, namespaceName, options, callback) { // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NotificationHubListResult']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * Gets the authorization rules for a NotificationHub. + * Gets an authorization rule for a NotificationHub by name. * * @param {string} resourceGroupName The name of the resource group. * @@ -1431,6 +1568,8 @@ function _list(resourceGroupName, namespaceName, options, callback) { * * @param {string} notificationHubName The notification hub name. * + * @param {string} authorizationRuleName authorization rule name. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1443,14 +1582,14 @@ function _list(resourceGroupName, namespaceName, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SharedAccessAuthorizationRuleListResult} for + * See {@link SharedAccessAuthorizationRuleResource} 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 _listAuthorizationRules(resourceGroupName, namespaceName, notificationHubName, options, callback) { +function _getAuthorizationRule(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1471,6 +1610,9 @@ function _listAuthorizationRules(resourceGroupName, namespaceName, notificationH if (notificationHubName === null || notificationHubName === undefined || typeof notificationHubName.valueOf() !== 'string') { throw new Error('notificationHubName cannot be null or undefined and it must be of type string.'); } + if (authorizationRuleName === null || authorizationRuleName === undefined || typeof authorizationRuleName.valueOf() !== 'string') { + throw new Error('authorizationRuleName cannot be null or undefined and it must be of type string.'); + } 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.'); } @@ -1486,10 +1628,11 @@ function _listAuthorizationRules(resourceGroupName, namespaceName, notificationH // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); requestUrl = requestUrl.replace('{notificationHubName}', encodeURIComponent(notificationHubName)); + requestUrl = requestUrl.replace('{authorizationRuleName}', encodeURIComponent(authorizationRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -1559,7 +1702,7 @@ function _listAuthorizationRules(resourceGroupName, namespaceName, notificationH parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SharedAccessAuthorizationRuleListResult']().mapper(); + let resultMapper = new client.models['SharedAccessAuthorizationRuleResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1575,17 +1718,12 @@ function _listAuthorizationRules(resourceGroupName, namespaceName, notificationH } /** - * Gets the Primary and Secondary ConnectionStrings to the NotificationHub + * Lists the notification hubs associated with a namespace. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} namespaceName The namespace name. * - * @param {string} notificationHubName The notification hub name. - * - * @param {string} authorizationRuleName The connection string of the - * NotificationHub for the specified authorizationRule. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1598,13 +1736,14 @@ function _listAuthorizationRules(resourceGroupName, namespaceName, notificationH * {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 ResourceListKeys} for more information. + * See {@link NotificationHubListResult} 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 _listKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, options, callback) { +function _list(resourceGroupName, namespaceName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1622,12 +1761,6 @@ function _listKeys(resourceGroupName, namespaceName, notificationHubName, author 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 (notificationHubName === null || notificationHubName === undefined || typeof notificationHubName.valueOf() !== 'string') { - throw new Error('notificationHubName cannot be null or undefined and it must be of type string.'); - } - if (authorizationRuleName === null || authorizationRuleName === undefined || typeof authorizationRuleName.valueOf() !== 'string') { - throw new Error('authorizationRuleName cannot be null or undefined and it must be of type string.'); - } 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.'); } @@ -1643,11 +1776,9 @@ function _listKeys(resourceGroupName, namespaceName, notificationHubName, author // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{notificationHubName}', encodeURIComponent(notificationHubName)); - requestUrl = requestUrl.replace('{authorizationRuleName}', encodeURIComponent(authorizationRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -1657,7 +1788,7 @@ function _listKeys(resourceGroupName, namespaceName, notificationHubName, author // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1717,7 +1848,7 @@ function _listKeys(resourceGroupName, namespaceName, notificationHubName, author parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceListKeys']().mapper(); + let resultMapper = new client.models['NotificationHubListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1733,25 +1864,14 @@ function _listKeys(resourceGroupName, namespaceName, notificationHubName, author } /** - * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization - * Rule + * Gets the authorization rules for a NotificationHub. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} namespaceName The namespace name. + * @param {string} namespaceName The namespace name * * @param {string} notificationHubName The notification hub name. * - * @param {string} authorizationRuleName The connection string of the - * NotificationHub for the specified authorizationRule. - * - * @param {object} parameters Parameters supplied to regenerate the - * NotificationHub Authorization Rule Key. - * - * @param {string} [parameters.policyKey] Name of the key that has to be - * regenerated for the Namespace/Notification Hub Authorization Rule. The value - * can be Primary Key/Secondary Key. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1764,13 +1884,14 @@ function _listKeys(resourceGroupName, namespaceName, notificationHubName, author * {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 ResourceListKeys} for more information. + * See {@link SharedAccessAuthorizationRuleListResult} 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 _regenerateKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters, options, callback) { +function _listAuthorizationRules(resourceGroupName, namespaceName, notificationHubName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1791,12 +1912,6 @@ function _regenerateKeys(resourceGroupName, namespaceName, notificationHubName, if (notificationHubName === null || notificationHubName === undefined || typeof notificationHubName.valueOf() !== 'string') { throw new Error('notificationHubName cannot be null or undefined and it must be of type string.'); } - if (authorizationRuleName === null || authorizationRuleName === undefined || typeof authorizationRuleName.valueOf() !== 'string') { - throw new Error('authorizationRuleName 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.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.'); } @@ -1812,11 +1927,10 @@ function _regenerateKeys(resourceGroupName, namespaceName, notificationHubName, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); requestUrl = requestUrl.replace('{notificationHubName}', encodeURIComponent(notificationHubName)); - requestUrl = requestUrl.replace('{authorizationRuleName}', encodeURIComponent(authorizationRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -1826,7 +1940,7 @@ function _regenerateKeys(resourceGroupName, namespaceName, notificationHubName, // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1844,21 +1958,7 @@ function _regenerateKeys(resourceGroupName, namespaceName, notificationHubName, } } } - // Serialize Request - let requestContent = null; - let requestModel = null; - try { - if (parameters !== null && parameters !== undefined) { - let requestModelMapper = new client.models['PolicykeyResource']().mapper(); - requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(parameters, null, 2)}.`); - return callback(serializationError); - } - httpRequest.body = requestContent; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -1900,7 +2000,7 @@ function _regenerateKeys(resourceGroupName, namespaceName, notificationHubName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceListKeys']().mapper(); + let resultMapper = new client.models['SharedAccessAuthorizationRuleListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1916,7 +2016,7 @@ function _regenerateKeys(resourceGroupName, namespaceName, notificationHubName, } /** - * Lists the PNS Credentials associated with a notification hub . + * Gets the Primary and Secondary ConnectionStrings to the NotificationHub * * @param {string} resourceGroupName The name of the resource group. * @@ -1924,6 +2024,9 @@ function _regenerateKeys(resourceGroupName, namespaceName, notificationHubName, * * @param {string} notificationHubName The notification hub name. * + * @param {string} authorizationRuleName The connection string of the + * NotificationHub for the specified authorizationRule. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1936,14 +2039,13 @@ function _regenerateKeys(resourceGroupName, namespaceName, notificationHubName, * {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 PnsCredentialsResource} for more - * information. + * See {@link ResourceListKeys} 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 _getPnsCredentials(resourceGroupName, namespaceName, notificationHubName, options, callback) { +function _listKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1964,6 +2066,9 @@ function _getPnsCredentials(resourceGroupName, namespaceName, notificationHubNam if (notificationHubName === null || notificationHubName === undefined || typeof notificationHubName.valueOf() !== 'string') { throw new Error('notificationHubName cannot be null or undefined and it must be of type string.'); } + if (authorizationRuleName === null || authorizationRuleName === undefined || typeof authorizationRuleName.valueOf() !== 'string') { + throw new Error('authorizationRuleName cannot be null or undefined and it must be of type string.'); + } 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.'); } @@ -1979,10 +2084,11 @@ function _getPnsCredentials(resourceGroupName, namespaceName, notificationHubNam // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/listKeys'; requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); requestUrl = requestUrl.replace('{notificationHubName}', encodeURIComponent(notificationHubName)); + requestUrl = requestUrl.replace('{authorizationRuleName}', encodeURIComponent(authorizationRuleName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); @@ -2052,7 +2158,7 @@ function _getPnsCredentials(resourceGroupName, namespaceName, notificationHubNam parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PnsCredentialsResource']().mapper(); + let resultMapper = new client.models['ResourceListKeys']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2068,10 +2174,24 @@ function _getPnsCredentials(resourceGroupName, namespaceName, notificationHubNam } /** - * Lists the notification hubs associated with a namespace. + * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization + * Rule * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} namespaceName The namespace name. + * + * @param {string} notificationHubName The notification hub name. + * + * @param {string} authorizationRuleName The connection string of the + * NotificationHub for the specified authorizationRule. + * + * @param {object} parameters Parameters supplied to regenerate the + * NotificationHub Authorization Rule Key. + * + * @param {string} [parameters.policyKey] Name of the key that has to be + * regenerated for the Namespace/Notification Hub Authorization Rule. The value + * can be Primary Key/Secondary Key. * * @param {object} [options] Optional Parameters. * @@ -2085,14 +2205,13 @@ function _getPnsCredentials(resourceGroupName, namespaceName, notificationHubNam * {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 NotificationHubListResult} for more - * information. + * See {@link ResourceListKeys} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listNext(nextPageLink, options, callback) { +function _regenerateKeys(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2104,8 +2223,26 @@ function _listNext(nextPageLink, options, callback) { } // Validate try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (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 (notificationHubName === null || notificationHubName === undefined || typeof notificationHubName.valueOf() !== 'string') { + throw new Error('notificationHubName cannot be null or undefined and it must be of type string.'); + } + if (authorizationRuleName === null || authorizationRuleName === undefined || typeof authorizationRuleName.valueOf() !== 'string') { + throw new Error('authorizationRuleName 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.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.'); @@ -2115,12 +2252,22 @@ function _listNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{notificationHubName}', encodeURIComponent(notificationHubName)); + requestUrl = requestUrl.replace('{authorizationRuleName}', encodeURIComponent(authorizationRuleName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2138,7 +2285,21 @@ function _listNext(nextPageLink, options, callback) { } } } - httpRequest.body = null; + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['PolicykeyResource']().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) { @@ -2180,7 +2341,7 @@ function _listNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NotificationHubListResult']().mapper(); + let resultMapper = new client.models['ResourceListKeys']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2196,7 +2357,159 @@ function _listNext(nextPageLink, options, callback) { } /** - * Gets the authorization rules for a NotificationHub. + * Lists the PNS Credentials associated with a notification hub . + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} namespaceName The namespace name. + * + * @param {string} notificationHubName The notification hub 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 PnsCredentialsResource} 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 _getPnsCredentials(resourceGroupName, namespaceName, notificationHubName, 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 (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 (notificationHubName === null || notificationHubName === undefined || typeof notificationHubName.valueOf() !== 'string') { + throw new Error('notificationHubName cannot be null or undefined and it must be of type string.'); + } + 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.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/pnsCredentials'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{notificationHubName}', encodeURIComponent(notificationHubName)); + 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 = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['PnsCredentialsResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists the notification hubs associated with a namespace. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -2213,14 +2526,14 @@ function _listNext(nextPageLink, options, callback) { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SharedAccessAuthorizationRuleListResult} for - * more information. + * See {@link NotificationHubListResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listAuthorizationRulesNext(nextPageLink, options, callback) { +function _listNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2308,7 +2621,7 @@ function _listAuthorizationRulesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SharedAccessAuthorizationRuleListResult']().mapper(); + let resultMapper = new client.models['NotificationHubListResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2323,60 +2636,190 @@ function _listAuthorizationRulesNext(nextPageLink, options, callback) { }); } -/** Class representing a NotificationHubs. */ -class NotificationHubs { - /** - * Create a NotificationHubs. - * @param {NotificationHubsManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._checkAvailability = _checkAvailability; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._get = _get; - this._createOrUpdateAuthorizationRule = _createOrUpdateAuthorizationRule; - this._deleteAuthorizationRule = _deleteAuthorizationRule; - this._getAuthorizationRule = _getAuthorizationRule; - this._list = _list; - this._listAuthorizationRules = _listAuthorizationRules; - this._listKeys = _listKeys; - this._regenerateKeys = _regenerateKeys; - this._getPnsCredentials = _getPnsCredentials; - this._listNext = _listNext; - this._listAuthorizationRulesNext = _listAuthorizationRulesNext; +/** + * Gets the authorization rules for a NotificationHub. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SharedAccessAuthorizationRuleListResult} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listAuthorizationRulesNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); } - /** - * Checks the availability of the given notificationHub in a namespace. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} namespaceName The namespace name. - * - * @param {object} parameters The notificationHub name. - * - * @param {string} parameters.name Resource name - * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [parameters.sku] The sku of the created namespace - * - * @param {string} parameters.sku.name Name of the notification hub sku. - * Possible values include: 'Free', 'Basic', 'Standard' - * - * @param {string} [parameters.sku.tier] The tier of particular sku - * - * @param {string} [parameters.sku.size] The Sku size - * - * @param {string} [parameters.sku.family] The Sku Family - * - * @param {number} [parameters.sku.capacity] The capacity of the resource - * - * @param {boolean} [parameters.isAvailiable] True if the name is available and - * can be used to create new Namespace/NotificationHub. Otherwise false. + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SharedAccessAuthorizationRuleListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a NotificationHubs. */ +class NotificationHubs { + /** + * Create a NotificationHubs. + * @param {NotificationHubsManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._checkNotificationHubAvailability = _checkNotificationHubAvailability; + this._createOrUpdate = _createOrUpdate; + this._patch = _patch; + this._deleteMethod = _deleteMethod; + this._get = _get; + this._debugSend = _debugSend; + this._createOrUpdateAuthorizationRule = _createOrUpdateAuthorizationRule; + this._deleteAuthorizationRule = _deleteAuthorizationRule; + this._getAuthorizationRule = _getAuthorizationRule; + this._list = _list; + this._listAuthorizationRules = _listAuthorizationRules; + this._listKeys = _listKeys; + this._regenerateKeys = _regenerateKeys; + this._getPnsCredentials = _getPnsCredentials; + this._listNext = _listNext; + this._listAuthorizationRulesNext = _listAuthorizationRulesNext; + } + + /** + * Checks the availability of the given notificationHub in a namespace. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} namespaceName The namespace name. + * + * @param {object} parameters The notificationHub name. + * + * @param {string} parameters.name Resource name + * + * @param {string} [parameters.location] Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [parameters.sku] The sku of the created namespace + * + * @param {string} parameters.sku.name Name of the notification hub sku. + * Possible values include: 'Free', 'Basic', 'Standard' + * + * @param {string} [parameters.sku.tier] The tier of particular sku + * + * @param {string} [parameters.sku.size] The Sku size + * + * @param {string} [parameters.sku.family] The Sku Family + * + * @param {number} [parameters.sku.capacity] The capacity of the resource + * + * @param {boolean} [parameters.isAvailiable] True if the name is available and + * can be used to create new Namespace/NotificationHub. Otherwise false. * * @param {object} [options] Optional Parameters. * @@ -2389,11 +2832,11 @@ class NotificationHubs { * * @reject {Error} - The error object. */ - checkAvailabilityWithHttpOperationResponse(resourceGroupName, namespaceName, parameters, options) { + checkNotificationHubAvailabilityWithHttpOperationResponse(resourceGroupName, namespaceName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._checkAvailability(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { + self._checkNotificationHubAvailability(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2414,7 +2857,7 @@ class NotificationHubs { * * @param {string} parameters.name Resource name * - * @param {string} parameters.location Resource location + * @param {string} [parameters.location] Resource location * * @param {object} [parameters.tags] Resource tags * @@ -2446,7 +2889,312 @@ class NotificationHubs { * * {Promise} A promise is returned * - * @resolve {CheckAvailabilityResult} - The deserialized result object. + * @resolve {CheckAvailabilityResult} - 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 CheckAvailabilityResult} 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. + */ + checkNotificationHubAvailability(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._checkNotificationHubAvailability(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkNotificationHubAvailability(resourceGroupName, namespaceName, parameters, options, optionalCallback); + } + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} namespaceName The namespace name. + * + * @param {string} notificationHubName The notification hub name. + * + * @param {object} parameters Parameters supplied to the create/update a + * NotificationHub Resource. + * + * @param {string} [parameters.notificationHubCreateOrUpdateParametersName] The + * NotificationHub name. + * + * @param {string} [parameters.registrationTtl] The RegistrationTtl of the + * created NotificationHub + * + * @param {array} [parameters.authorizationRules] The AuthorizationRules of the + * created NotificationHub + * + * @param {object} [parameters.apnsCredential] The ApnsCredential of the + * created NotificationHub + * + * @param {string} [parameters.apnsCredential.apnsCertificate] The APNS + * certificate. + * + * @param {string} [parameters.apnsCredential.certificateKey] The certificate + * key. + * + * @param {string} [parameters.apnsCredential.endpoint] The endpoint of this + * credential. + * + * @param {string} [parameters.apnsCredential.thumbprint] The APNS certificate + * Thumbprint + * + * @param {string} [parameters.apnsCredential.keyId] A 10-character key + * identifier (kid) key, obtained from your developer account + * + * @param {string} [parameters.apnsCredential.appName] The name of the + * application + * + * @param {string} [parameters.apnsCredential.appId] The issuer (iss) + * registered claim key, whose value is your 10-character Team ID, obtained + * from your developer account + * + * @param {string} [parameters.apnsCredential.token] Provider Authentication + * Token, obtained through your developer account + * + * @param {object} [parameters.wnsCredential] The WnsCredential of the created + * NotificationHub + * + * @param {string} [parameters.wnsCredential.packageSid] The package ID for + * this credential. + * + * @param {string} [parameters.wnsCredential.secretKey] The secret key. + * + * @param {string} [parameters.wnsCredential.windowsLiveEndpoint] The Windows + * Live endpoint. + * + * @param {object} [parameters.gcmCredential] The GcmCredential of the created + * NotificationHub + * + * @param {string} [parameters.gcmCredential.gcmEndpoint] The GCM endpoint. + * + * @param {string} [parameters.gcmCredential.googleApiKey] The Google API key. + * + * @param {object} [parameters.mpnsCredential] The MpnsCredential of the + * created NotificationHub + * + * @param {string} [parameters.mpnsCredential.mpnsCertificate] The MPNS + * certificate. + * + * @param {string} [parameters.mpnsCredential.certificateKey] The certificate + * key for this credential. + * + * @param {string} [parameters.mpnsCredential.thumbprint] The MPNS certificate + * Thumbprint + * + * @param {object} [parameters.admCredential] The AdmCredential of the created + * NotificationHub + * + * @param {string} [parameters.admCredential.clientId] The client identifier. + * + * @param {string} [parameters.admCredential.clientSecret] The credential + * secret access key. + * + * @param {string} [parameters.admCredential.authTokenUrl] The URL of the + * authorization token. + * + * @param {object} [parameters.baiduCredential] The BaiduCredential of the + * created NotificationHub + * + * @param {string} [parameters.baiduCredential.baiduApiKey] Baidu Api Key. + * + * @param {string} [parameters.baiduCredential.baiduEndPoint] Baidu Endpoint. + * + * @param {string} [parameters.baiduCredential.baiduSecretKey] Baidu Secret Key + * + * @param {string} [parameters.location] Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [parameters.sku] The sku of the created namespace + * + * @param {string} parameters.sku.name Name of the notification hub sku. + * Possible values include: 'Free', 'Basic', 'Standard' + * + * @param {string} [parameters.sku.tier] The tier of particular sku + * + * @param {string} [parameters.sku.size] The Sku size + * + * @param {string} [parameters.sku.family] The Sku Family + * + * @param {number} [parameters.sku.capacity] The capacity of the resource + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, namespaceName, notificationHubName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, namespaceName, notificationHubName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates/Update a NotificationHub in a namespace. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} namespaceName The namespace name. + * + * @param {string} notificationHubName The notification hub name. + * + * @param {object} parameters Parameters supplied to the create/update a + * NotificationHub Resource. + * + * @param {string} [parameters.notificationHubCreateOrUpdateParametersName] The + * NotificationHub name. + * + * @param {string} [parameters.registrationTtl] The RegistrationTtl of the + * created NotificationHub + * + * @param {array} [parameters.authorizationRules] The AuthorizationRules of the + * created NotificationHub + * + * @param {object} [parameters.apnsCredential] The ApnsCredential of the + * created NotificationHub + * + * @param {string} [parameters.apnsCredential.apnsCertificate] The APNS + * certificate. + * + * @param {string} [parameters.apnsCredential.certificateKey] The certificate + * key. + * + * @param {string} [parameters.apnsCredential.endpoint] The endpoint of this + * credential. + * + * @param {string} [parameters.apnsCredential.thumbprint] The APNS certificate + * Thumbprint + * + * @param {string} [parameters.apnsCredential.keyId] A 10-character key + * identifier (kid) key, obtained from your developer account + * + * @param {string} [parameters.apnsCredential.appName] The name of the + * application + * + * @param {string} [parameters.apnsCredential.appId] The issuer (iss) + * registered claim key, whose value is your 10-character Team ID, obtained + * from your developer account + * + * @param {string} [parameters.apnsCredential.token] Provider Authentication + * Token, obtained through your developer account + * + * @param {object} [parameters.wnsCredential] The WnsCredential of the created + * NotificationHub + * + * @param {string} [parameters.wnsCredential.packageSid] The package ID for + * this credential. + * + * @param {string} [parameters.wnsCredential.secretKey] The secret key. + * + * @param {string} [parameters.wnsCredential.windowsLiveEndpoint] The Windows + * Live endpoint. + * + * @param {object} [parameters.gcmCredential] The GcmCredential of the created + * NotificationHub + * + * @param {string} [parameters.gcmCredential.gcmEndpoint] The GCM endpoint. + * + * @param {string} [parameters.gcmCredential.googleApiKey] The Google API key. + * + * @param {object} [parameters.mpnsCredential] The MpnsCredential of the + * created NotificationHub + * + * @param {string} [parameters.mpnsCredential.mpnsCertificate] The MPNS + * certificate. + * + * @param {string} [parameters.mpnsCredential.certificateKey] The certificate + * key for this credential. + * + * @param {string} [parameters.mpnsCredential.thumbprint] The MPNS certificate + * Thumbprint + * + * @param {object} [parameters.admCredential] The AdmCredential of the created + * NotificationHub + * + * @param {string} [parameters.admCredential.clientId] The client identifier. + * + * @param {string} [parameters.admCredential.clientSecret] The credential + * secret access key. + * + * @param {string} [parameters.admCredential.authTokenUrl] The URL of the + * authorization token. + * + * @param {object} [parameters.baiduCredential] The BaiduCredential of the + * created NotificationHub + * + * @param {string} [parameters.baiduCredential.baiduApiKey] Baidu Api Key. + * + * @param {string} [parameters.baiduCredential.baiduEndPoint] Baidu Endpoint. + * + * @param {string} [parameters.baiduCredential.baiduSecretKey] Baidu Secret Key + * + * @param {string} [parameters.location] Resource location + * + * @param {object} [parameters.tags] Resource tags + * + * @param {object} [parameters.sku] The sku of the created namespace + * + * @param {string} parameters.sku.name Name of the notification hub sku. + * Possible values include: 'Free', 'Basic', 'Standard' + * + * @param {string} [parameters.sku.tier] The tier of particular sku + * + * @param {string} [parameters.sku.size] The Sku size + * + * @param {string} [parameters.sku.family] The Sku Family + * + * @param {number} [parameters.sku.capacity] The capacity of the resource + * + * @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 {NotificationHubResource} - The deserialized result object. * * @reject {Error} - The error object. * @@ -2455,14 +3203,14 @@ class NotificationHubs { * {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 CheckAvailabilityResult} for more + * See {@link NotificationHubResource} 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. */ - checkAvailability(resourceGroupName, namespaceName, parameters, options, optionalCallback) { + createOrUpdate(resourceGroupName, namespaceName, notificationHubName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2471,19 +3219,19 @@ class NotificationHubs { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._checkAvailability(resourceGroupName, namespaceName, parameters, options, (err, result, request, response) => { + self._createOrUpdate(resourceGroupName, namespaceName, notificationHubName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._checkAvailability(resourceGroupName, namespaceName, parameters, options, optionalCallback); + return self._createOrUpdate(resourceGroupName, namespaceName, notificationHubName, parameters, options, optionalCallback); } } /** - * Creates/Update a NotificationHub in a namespace. + * Patch a NotificationHub in a namespace. * * @param {string} resourceGroupName The name of the resource group. * @@ -2491,114 +3239,121 @@ class NotificationHubs { * * @param {string} notificationHubName The notification hub name. * - * @param {object} parameters Parameters supplied to the create/update a + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to patch a * NotificationHub Resource. * - * @param {string} [parameters.notificationHubCreateOrUpdateParametersName] The + * @param {string} [options.parameters.notificationHubPatchParametersName] The * NotificationHub name. * - * @param {string} [parameters.registrationTtl] The RegistrationTtl of the - * created NotificationHub + * @param {string} [options.parameters.registrationTtl] The RegistrationTtl of + * the created NotificationHub * - * @param {array} [parameters.authorizationRules] The AuthorizationRules of the - * created NotificationHub + * @param {array} [options.parameters.authorizationRules] The + * AuthorizationRules of the created NotificationHub * - * @param {object} [parameters.apnsCredential] The ApnsCredential of the - * created NotificationHub + * @param {object} [options.parameters.apnsCredential] The ApnsCredential of + * the created NotificationHub * - * @param {string} [parameters.apnsCredential.apnsCertificate] The APNS + * @param {string} [options.parameters.apnsCredential.apnsCertificate] The APNS * certificate. * - * @param {string} [parameters.apnsCredential.certificateKey] The certificate - * key. + * @param {string} [options.parameters.apnsCredential.certificateKey] The + * certificate key. * - * @param {string} [parameters.apnsCredential.endpoint] The endpoint of this - * credential. + * @param {string} [options.parameters.apnsCredential.endpoint] The endpoint of + * this credential. * - * @param {string} [parameters.apnsCredential.thumbprint] The Apns certificate - * Thumbprint + * @param {string} [options.parameters.apnsCredential.thumbprint] The APNS + * certificate Thumbprint * - * @param {string} [parameters.apnsCredential.keyId] A 10-character key + * @param {string} [options.parameters.apnsCredential.keyId] A 10-character key * identifier (kid) key, obtained from your developer account * - * @param {string} [parameters.apnsCredential.appName] The name of the + * @param {string} [options.parameters.apnsCredential.appName] The name of the * application * - * @param {string} [parameters.apnsCredential.appId] The issuer (iss) + * @param {string} [options.parameters.apnsCredential.appId] The issuer (iss) * registered claim key, whose value is your 10-character Team ID, obtained * from your developer account * - * @param {string} [parameters.apnsCredential.token] Provider Authentication - * Token, obtained through your developer account + * @param {string} [options.parameters.apnsCredential.token] Provider + * Authentication Token, obtained through your developer account * - * @param {object} [parameters.wnsCredential] The WnsCredential of the created - * NotificationHub + * @param {object} [options.parameters.wnsCredential] The WnsCredential of the + * created NotificationHub * - * @param {string} [parameters.wnsCredential.packageSid] The package ID for - * this credential. + * @param {string} [options.parameters.wnsCredential.packageSid] The package ID + * for this credential. * - * @param {string} [parameters.wnsCredential.secretKey] The secret key. + * @param {string} [options.parameters.wnsCredential.secretKey] The secret key. * - * @param {string} [parameters.wnsCredential.windowsLiveEndpoint] The Windows - * Live endpoint. + * @param {string} [options.parameters.wnsCredential.windowsLiveEndpoint] The + * Windows Live endpoint. * - * @param {object} [parameters.gcmCredential] The GcmCredential of the created - * NotificationHub + * @param {object} [options.parameters.gcmCredential] The GcmCredential of the + * created NotificationHub * - * @param {string} [parameters.gcmCredential.gcmEndpoint] The GCM endpoint. + * @param {string} [options.parameters.gcmCredential.gcmEndpoint] The GCM + * endpoint. * - * @param {string} [parameters.gcmCredential.googleApiKey] The Google API key. + * @param {string} [options.parameters.gcmCredential.googleApiKey] The Google + * API key. * - * @param {object} [parameters.mpnsCredential] The MpnsCredential of the - * created NotificationHub + * @param {object} [options.parameters.mpnsCredential] The MpnsCredential of + * the created NotificationHub * - * @param {string} [parameters.mpnsCredential.mpnsCertificate] The MPNS + * @param {string} [options.parameters.mpnsCredential.mpnsCertificate] The MPNS * certificate. * - * @param {string} [parameters.mpnsCredential.certificateKey] The certificate - * key for this credential. - * - * @param {string} [parameters.mpnsCredential.thumbprint] The Mpns certificate - * Thumbprint + * @param {string} [options.parameters.mpnsCredential.certificateKey] The + * certificate key for this credential. * - * @param {object} [parameters.admCredential] The AdmCredential of the created - * NotificationHub + * @param {string} [options.parameters.mpnsCredential.thumbprint] The MPNS + * certificate Thumbprint * - * @param {string} [parameters.admCredential.clientId] The client identifier. + * @param {object} [options.parameters.admCredential] The AdmCredential of the + * created NotificationHub * - * @param {string} [parameters.admCredential.clientSecret] The credential - * secret access key. + * @param {string} [options.parameters.admCredential.clientId] The client + * identifier. * - * @param {string} [parameters.admCredential.authTokenUrl] The URL of the - * authorization token. + * @param {string} [options.parameters.admCredential.clientSecret] The + * credential secret access key. * - * @param {object} [parameters.baiduCredential] The BaiduCredential of the - * created NotificationHub + * @param {string} [options.parameters.admCredential.authTokenUrl] The URL of + * the authorization token. * - * @param {string} [parameters.baiduCredential.baiduApiKey] Baidu Api Key. + * @param {object} [options.parameters.baiduCredential] The BaiduCredential of + * the created NotificationHub * - * @param {string} [parameters.baiduCredential.baiduEndPoint] Baidu Endpoint. + * @param {string} [options.parameters.baiduCredential.baiduApiKey] Baidu Api + * Key. * - * @param {string} [parameters.baiduCredential.baiduSecretKey] Baidu Secret Key + * @param {string} [options.parameters.baiduCredential.baiduEndPoint] Baidu + * Endpoint. * - * @param {string} parameters.location Resource location + * @param {string} [options.parameters.baiduCredential.baiduSecretKey] Baidu + * Secret Key * - * @param {object} [parameters.tags] Resource tags + * @param {string} [options.parameters.location] Resource location * - * @param {object} [parameters.sku] The sku of the created namespace + * @param {object} [options.parameters.tags] Resource tags * - * @param {string} parameters.sku.name Name of the notification hub sku. - * Possible values include: 'Free', 'Basic', 'Standard' + * @param {object} [options.parameters.sku] The sku of the created namespace * - * @param {string} [parameters.sku.tier] The tier of particular sku + * @param {string} options.parameters.sku.name Name of the notification hub + * sku. Possible values include: 'Free', 'Basic', 'Standard' * - * @param {string} [parameters.sku.size] The Sku size + * @param {string} [options.parameters.sku.tier] The tier of particular sku * - * @param {string} [parameters.sku.family] The Sku Family + * @param {string} [options.parameters.sku.size] The Sku size * - * @param {number} [parameters.sku.capacity] The capacity of the resource + * @param {string} [options.parameters.sku.family] The Sku Family * - * @param {object} [options] Optional Parameters. + * @param {number} [options.parameters.sku.capacity] The capacity of the + * resource * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2609,11 +3364,11 @@ class NotificationHubs { * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, namespaceName, notificationHubName, parameters, options) { + patchWithHttpOperationResponse(resourceGroupName, namespaceName, notificationHubName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, namespaceName, notificationHubName, parameters, options, (err, result, request, response) => { + self._patch(resourceGroupName, namespaceName, notificationHubName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2624,7 +3379,7 @@ class NotificationHubs { } /** - * Creates/Update a NotificationHub in a namespace. + * Patch a NotificationHub in a namespace. * * @param {string} resourceGroupName The name of the resource group. * @@ -2632,114 +3387,121 @@ class NotificationHubs { * * @param {string} notificationHubName The notification hub name. * - * @param {object} parameters Parameters supplied to the create/update a + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.parameters] Parameters supplied to patch a * NotificationHub Resource. * - * @param {string} [parameters.notificationHubCreateOrUpdateParametersName] The + * @param {string} [options.parameters.notificationHubPatchParametersName] The * NotificationHub name. * - * @param {string} [parameters.registrationTtl] The RegistrationTtl of the - * created NotificationHub + * @param {string} [options.parameters.registrationTtl] The RegistrationTtl of + * the created NotificationHub * - * @param {array} [parameters.authorizationRules] The AuthorizationRules of the - * created NotificationHub + * @param {array} [options.parameters.authorizationRules] The + * AuthorizationRules of the created NotificationHub * - * @param {object} [parameters.apnsCredential] The ApnsCredential of the - * created NotificationHub + * @param {object} [options.parameters.apnsCredential] The ApnsCredential of + * the created NotificationHub * - * @param {string} [parameters.apnsCredential.apnsCertificate] The APNS + * @param {string} [options.parameters.apnsCredential.apnsCertificate] The APNS * certificate. * - * @param {string} [parameters.apnsCredential.certificateKey] The certificate - * key. + * @param {string} [options.parameters.apnsCredential.certificateKey] The + * certificate key. * - * @param {string} [parameters.apnsCredential.endpoint] The endpoint of this - * credential. + * @param {string} [options.parameters.apnsCredential.endpoint] The endpoint of + * this credential. * - * @param {string} [parameters.apnsCredential.thumbprint] The Apns certificate - * Thumbprint + * @param {string} [options.parameters.apnsCredential.thumbprint] The APNS + * certificate Thumbprint * - * @param {string} [parameters.apnsCredential.keyId] A 10-character key + * @param {string} [options.parameters.apnsCredential.keyId] A 10-character key * identifier (kid) key, obtained from your developer account * - * @param {string} [parameters.apnsCredential.appName] The name of the + * @param {string} [options.parameters.apnsCredential.appName] The name of the * application * - * @param {string} [parameters.apnsCredential.appId] The issuer (iss) + * @param {string} [options.parameters.apnsCredential.appId] The issuer (iss) * registered claim key, whose value is your 10-character Team ID, obtained * from your developer account * - * @param {string} [parameters.apnsCredential.token] Provider Authentication - * Token, obtained through your developer account + * @param {string} [options.parameters.apnsCredential.token] Provider + * Authentication Token, obtained through your developer account * - * @param {object} [parameters.wnsCredential] The WnsCredential of the created - * NotificationHub + * @param {object} [options.parameters.wnsCredential] The WnsCredential of the + * created NotificationHub * - * @param {string} [parameters.wnsCredential.packageSid] The package ID for - * this credential. + * @param {string} [options.parameters.wnsCredential.packageSid] The package ID + * for this credential. * - * @param {string} [parameters.wnsCredential.secretKey] The secret key. + * @param {string} [options.parameters.wnsCredential.secretKey] The secret key. * - * @param {string} [parameters.wnsCredential.windowsLiveEndpoint] The Windows - * Live endpoint. + * @param {string} [options.parameters.wnsCredential.windowsLiveEndpoint] The + * Windows Live endpoint. * - * @param {object} [parameters.gcmCredential] The GcmCredential of the created - * NotificationHub + * @param {object} [options.parameters.gcmCredential] The GcmCredential of the + * created NotificationHub * - * @param {string} [parameters.gcmCredential.gcmEndpoint] The GCM endpoint. + * @param {string} [options.parameters.gcmCredential.gcmEndpoint] The GCM + * endpoint. * - * @param {string} [parameters.gcmCredential.googleApiKey] The Google API key. + * @param {string} [options.parameters.gcmCredential.googleApiKey] The Google + * API key. * - * @param {object} [parameters.mpnsCredential] The MpnsCredential of the - * created NotificationHub + * @param {object} [options.parameters.mpnsCredential] The MpnsCredential of + * the created NotificationHub * - * @param {string} [parameters.mpnsCredential.mpnsCertificate] The MPNS + * @param {string} [options.parameters.mpnsCredential.mpnsCertificate] The MPNS * certificate. * - * @param {string} [parameters.mpnsCredential.certificateKey] The certificate - * key for this credential. - * - * @param {string} [parameters.mpnsCredential.thumbprint] The Mpns certificate - * Thumbprint + * @param {string} [options.parameters.mpnsCredential.certificateKey] The + * certificate key for this credential. * - * @param {object} [parameters.admCredential] The AdmCredential of the created - * NotificationHub + * @param {string} [options.parameters.mpnsCredential.thumbprint] The MPNS + * certificate Thumbprint * - * @param {string} [parameters.admCredential.clientId] The client identifier. + * @param {object} [options.parameters.admCredential] The AdmCredential of the + * created NotificationHub * - * @param {string} [parameters.admCredential.clientSecret] The credential - * secret access key. + * @param {string} [options.parameters.admCredential.clientId] The client + * identifier. * - * @param {string} [parameters.admCredential.authTokenUrl] The URL of the - * authorization token. + * @param {string} [options.parameters.admCredential.clientSecret] The + * credential secret access key. * - * @param {object} [parameters.baiduCredential] The BaiduCredential of the - * created NotificationHub + * @param {string} [options.parameters.admCredential.authTokenUrl] The URL of + * the authorization token. * - * @param {string} [parameters.baiduCredential.baiduApiKey] Baidu Api Key. + * @param {object} [options.parameters.baiduCredential] The BaiduCredential of + * the created NotificationHub * - * @param {string} [parameters.baiduCredential.baiduEndPoint] Baidu Endpoint. + * @param {string} [options.parameters.baiduCredential.baiduApiKey] Baidu Api + * Key. * - * @param {string} [parameters.baiduCredential.baiduSecretKey] Baidu Secret Key + * @param {string} [options.parameters.baiduCredential.baiduEndPoint] Baidu + * Endpoint. * - * @param {string} parameters.location Resource location + * @param {string} [options.parameters.baiduCredential.baiduSecretKey] Baidu + * Secret Key * - * @param {object} [parameters.tags] Resource tags + * @param {string} [options.parameters.location] Resource location * - * @param {object} [parameters.sku] The sku of the created namespace + * @param {object} [options.parameters.tags] Resource tags * - * @param {string} parameters.sku.name Name of the notification hub sku. - * Possible values include: 'Free', 'Basic', 'Standard' + * @param {object} [options.parameters.sku] The sku of the created namespace * - * @param {string} [parameters.sku.tier] The tier of particular sku + * @param {string} options.parameters.sku.name Name of the notification hub + * sku. Possible values include: 'Free', 'Basic', 'Standard' * - * @param {string} [parameters.sku.size] The Sku size + * @param {string} [options.parameters.sku.tier] The tier of particular sku * - * @param {string} [parameters.sku.family] The Sku Family + * @param {string} [options.parameters.sku.size] The Sku size * - * @param {number} [parameters.sku.capacity] The capacity of the resource + * @param {string} [options.parameters.sku.family] The Sku Family * - * @param {object} [options] Optional Parameters. + * @param {number} [options.parameters.sku.capacity] The capacity of the + * resource * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -2767,7 +3529,7 @@ class NotificationHubs { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, namespaceName, notificationHubName, parameters, options, optionalCallback) { + patch(resourceGroupName, namespaceName, notificationHubName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2776,14 +3538,14 @@ class NotificationHubs { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, namespaceName, notificationHubName, parameters, options, (err, result, request, response) => { + self._patch(resourceGroupName, namespaceName, notificationHubName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, namespaceName, notificationHubName, parameters, options, optionalCallback); + return self._patch(resourceGroupName, namespaceName, notificationHubName, options, optionalCallback); } } @@ -2968,7 +3730,7 @@ class NotificationHubs { } /** - * Creates/Updates an authorization rule for a NotificationHub + * test send a push notification * * @param {string} resourceGroupName The name of the resource group. * @@ -2976,32 +3738,109 @@ class NotificationHubs { * * @param {string} notificationHubName The notification hub name. * - * @param {string} authorizationRuleName Authorization Rule Name. + * @param {object} [options] Optional Parameters. * - * @param {object} parameters The shared access authorization rule. + * @param {object} [options.parameters] Debug send parameters * - * @param {object} parameters.properties Properties of the Namespace - * AuthorizationRules. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.properties.rights] The rights associated with the - * rule. + * @returns {Promise} A promise is returned * - * @param {string} parameters.location Resource location + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {object} [parameters.tags] Resource tags + * @reject {Error} - The error object. + */ + debugSendWithHttpOperationResponse(resourceGroupName, namespaceName, notificationHubName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._debugSend(resourceGroupName, namespaceName, notificationHubName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * test send a push notification * - * @param {object} [parameters.sku] The sku of the created namespace + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} parameters.sku.name Name of the notification hub sku. - * Possible values include: 'Free', 'Basic', 'Standard' + * @param {string} namespaceName The namespace name. * - * @param {string} [parameters.sku.tier] The tier of particular sku + * @param {string} notificationHubName The notification hub name. * - * @param {string} [parameters.sku.size] The Sku size + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.sku.family] The Sku Family + * @param {object} [options.parameters] Debug send parameters * - * @param {number} [parameters.sku.capacity] The capacity of the resource + * @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 {DebugSendResponse} - 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 DebugSendResponse} 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. + */ + debugSend(resourceGroupName, namespaceName, notificationHubName, 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._debugSend(resourceGroupName, namespaceName, notificationHubName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._debugSend(resourceGroupName, namespaceName, notificationHubName, options, optionalCallback); + } + } + + /** + * Creates/Updates an authorization rule for a NotificationHub + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} namespaceName The namespace name. + * + * @param {string} notificationHubName The notification hub name. + * + * @param {string} authorizationRuleName Authorization Rule Name. + * + * @param {object} parameters The shared access authorization rule. + * + * @param {object} parameters.properties Properties of the Namespace + * AuthorizationRules. + * + * @param {array} [parameters.properties.rights] The rights associated with the + * rule. * * @param {object} [options] Optional Parameters. * @@ -3047,23 +3886,6 @@ class NotificationHubs { * @param {array} [parameters.properties.rights] The rights associated with the * rule. * - * @param {string} parameters.location Resource location - * - * @param {object} [parameters.tags] Resource tags - * - * @param {object} [parameters.sku] The sku of the created namespace - * - * @param {string} parameters.sku.name Name of the notification hub sku. - * Possible values include: 'Free', 'Basic', 'Standard' - * - * @param {string} [parameters.sku.tier] The tier of particular sku - * - * @param {string} [parameters.sku.size] The Sku size - * - * @param {string} [parameters.sku.family] The Sku Family - * - * @param {number} [parameters.sku.capacity] The capacity of the resource - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the diff --git a/lib/services/notificationHubsManagement/lib/operations/operations.js b/lib/services/notificationHubsManagement/lib/operations/operations.js new file mode 100644 index 0000000000..c55d2b457c --- /dev/null +++ b/lib/services/notificationHubsManagement/lib/operations/operations.js @@ -0,0 +1,451 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * Lists all of the available NotificationHubs REST API operations. + * + * @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 OperationListResult} 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 _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.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('/') ? '' : '/') + 'providers/Microsoft.NotificationHubs/operations'; + 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['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Lists all of the available NotificationHubs REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationListResult']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Operations. */ +class Operations { + /** + * Create a Operations. + * @param {NotificationHubsManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @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 {OperationListResult} - 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 OperationListResult} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Lists all of the available NotificationHubs REST API operations. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OperationListResult} - 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 OperationListResult} 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. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Operations; diff --git a/lib/services/notificationHubsManagement/package-lock.json b/lib/services/notificationHubsManagement/package-lock.json new file mode 100644 index 0000000000..194258847b --- /dev/null +++ b/lib/services/notificationHubsManagement/package-lock.json @@ -0,0 +1,483 @@ +{ + "name": "azure-arm-notificationhubs", + "version": "2.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/node": { + "version": "8.10.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.26.tgz", + "integrity": "sha512-opk6bLLErLSwyVVJeSH5Ek7ZWOBSsN0JrvXTNVGLXLAXKB9xlTYajrplR44xVyMrmbut94H6uJ9jqzM/12jxkA==" + }, + "adal-node": { + "version": "0.1.28", + "resolved": "https://registry.npmjs.org/adal-node/-/adal-node-0.1.28.tgz", + "integrity": "sha1-RoxLs+u9lrEnBmn0ucuk4AZepIU=", + "requires": { + "@types/node": "^8.0.47", + "async": ">=0.6.0", + "date-utils": "*", + "jws": "3.x.x", + "request": ">= 2.52.0", + "underscore": ">= 1.3.1", + "uuid": "^3.1.0", + "xmldom": ">= 0.1.x", + "xpath.js": "~1.1.0" + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "requires": { + "lodash": "^4.14.0" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "optional": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "date-utils": { + "version": "1.2.21", + "resolved": "https://registry.npmjs.org/date-utils/-/date-utils-1.2.21.tgz", + "integrity": "sha1-YfsWzcEnSzyayq/+n8ad+HIKK2Q=" + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "optional": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", + "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", + "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "requires": { + "ajv": "^5.3.0", + "har-schema": "^2.0.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "jwa": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.6.tgz", + "integrity": "sha512-tBO/cf++BUsJkYql/kBbJroKOgHWEigTKBAjjBEmrMGYd1QMBC74Hr4Wo2zCZw6ZrVhlJPvoMrkcOnlWR/DJfw==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.10", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.5.tgz", + "integrity": "sha512-GsCSexFADNQUr8T5HPJvayTjvPIfoyJPtLQBwn5a4WZQchcrPMPMAWcC1AzJVRDKyD6ZPROPAxgv6rfHViO4uQ==", + "requires": { + "jwa": "^1.1.5", + "safe-buffer": "^5.0.1" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + }, + "mime-db": { + "version": "1.35.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", + "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==" + }, + "mime-types": { + "version": "2.1.19", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", + "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", + "requires": { + "mime-db": "~1.35.0" + } + }, + "moment": { + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", + "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" + }, + "ms-rest": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/ms-rest/-/ms-rest-2.3.6.tgz", + "integrity": "sha512-M+Lx9P7Wy4TeAk7jqPLwGS1QS1gvxF6Xo+OHv5j1g3Kcb44T/GTUuSjxTKarF6aKyeacZH1ZD++Nt7pcql7dDA==", + "requires": { + "duplexer": "^0.1.1", + "is-buffer": "^1.1.6", + "is-stream": "^1.1.0", + "moment": "^2.21.0", + "request": "^2.87.0", + "through": "^2.3.8", + "tunnel": "0.0.5", + "uuid": "^3.2.1" + } + }, + "ms-rest-azure": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/ms-rest-azure/-/ms-rest-azure-2.5.7.tgz", + "integrity": "sha512-e4lgB0z29Dx4ufu/c+PmEAYY1WXq98GYUBkE+iRx7WsxsN04lrM3B1vj8y+B8rKt7clPUE0niqB9VovVL8zvag==", + "requires": { + "adal-node": "^0.1.28", + "async": "2.6.0", + "moment": "^2.22.2", + "ms-rest": "^2.3.2", + "uuid": "^3.2.1" + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "psl": { + "version": "1.1.29", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "sshpk": { + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", + "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + }, + "tunnel": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.5.tgz", + "integrity": "sha512-gj5sdqherx4VZKMcBA4vewER7zdK25Td+z1npBqpbDys4eJrLx+SlYjJvq1bDXs2irkuJM5pf8ktaEQVipkrbA==" + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "underscore": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "xmldom": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", + "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=" + }, + "xpath.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xpath.js/-/xpath.js-1.1.0.tgz", + "integrity": "sha512-jg+qkfS4K8E7965sqaUl8mRngXiKb3WZGfONgE18pr03FUQiuSV6G+Ej4tS55B+rIQSFEIw3phdVAQ4pPqNWfQ==" + } + } +} diff --git a/lib/services/notificationHubsManagement/package.json b/lib/services/notificationHubsManagement/package.json index f741ff4de1..9a7fdfbb41 100644 --- a/lib/services/notificationHubsManagement/package.json +++ b/lib/services/notificationHubsManagement/package.json @@ -1,35 +1,25 @@ { "name": "azure-arm-notificationhubs", "author": "Microsoft Corporation", - "contributors": [ - "Borkar, Smitha " - ], - "version": "1.1.0", - "description": "Microsoft Azure Notification Hubs Resource Provider Management Client Library for Node", - "tags": [ - "azure", - "sdk" - ], + "description": "NotificationHubsManagementClient Library with typescript type definitions for node", + "version": "2.0.0", + "dependencies": { + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" + }, "keywords": [ "node", "azure" ], + "license": "MIT", "main": "./lib/notificationHubsManagementClient.js", "types": "./lib/notificationHubsManagementClient.d.ts", - "license": "MIT", - "dependencies": { - "ms-rest": "^2.2.2", - "ms-rest-azure": "^2.3.3" - }, - "homepage": "http://github.com/Azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", - "url": "git@github.com:Azure/azure-sdk-for-node.git" + "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" - }, - "scripts": { - "test": "npm -s run-script jshint" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } -} \ No newline at end of file +}