Update batch management SDK with latest spec and code gen.

This commit is contained in:
xingwu1 2016-03-18 12:34:14 -07:00
Родитель 8641c3cfbb
Коммит 71abac0b96
5 изменённых файлов: 27 добавлений и 30 удалений

Просмотреть файл

@ -95,7 +95,7 @@ var mappings = {
},
'batch.Management': {
'dir': 'batchManagement/lib',
'source': 'arm-batch/2015-12-01/BatchManagement.json',
'source': 'arm-batch/2015-12-01/swagger/BatchManagement.json',
'ft': 1
}
};

Просмотреть файл

@ -1432,8 +1432,7 @@ Account.prototype.regenerateKey = function (resourceGroupName, accountName, keyN
return callback(error);
}
var parameters;
if ((keyName !== null && keyName !== undefined))
{
if (keyName !== null && keyName !== undefined) {
parameters = new client.models['BatchAccountRegenerateKeyParameters']();
parameters.keyName = keyName;
}

Просмотреть файл

@ -119,8 +119,7 @@ ApplicationOperations.prototype.activateApplicationPackage = function (resourceG
return callback(error);
}
var parameters;
if ((format !== null && format !== undefined))
{
if (format !== null && format !== undefined) {
parameters = new client.models['ActivateApplicationPackageParameters']();
parameters.format = format;
}
@ -222,17 +221,17 @@ ApplicationOperations.prototype.activateApplicationPackage = function (resourceG
*
* @param {string} applicationId The id of the application.
*
* @param {object} parameters The parameters for the request.
*
* @param {boolean} [parameters.allowUpdates] A value indicating whether
* packages within the application may be overwritten using the same version
* string.
*
* @param {string} [parameters.displayName] The display name for the
* application.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.parameters] The parameters for the request.
*
* @param {boolean} [options.parameters.allowUpdates] A value indicating
* whether packages within the application may be overwritten using the same
* version string.
*
* @param {string} [options.parameters.displayName] The display name for the
* application.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
@ -248,7 +247,7 @@ ApplicationOperations.prototype.activateApplicationPackage = function (resourceG
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
ApplicationOperations.prototype.addApplication = function (resourceGroupName, accountName, applicationId, parameters, options, callback) {
ApplicationOperations.prototype.addApplication = function (resourceGroupName, accountName, applicationId, options, callback) {
var client = this.client;
if(!callback && typeof options === 'function') {
callback = options;
@ -257,6 +256,7 @@ ApplicationOperations.prototype.addApplication = function (resourceGroupName, ac
if (!callback) {
throw new Error('callback cannot be null.');
}
var parameters = (options && options.parameters !== undefined) ? options.parameters : undefined;
// Validate
try {
if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') {
@ -288,9 +288,6 @@ ApplicationOperations.prototype.addApplication = function (resourceGroupName, ac
if (applicationId === null || applicationId === undefined || typeof applicationId.valueOf() !== 'string') {
throw new Error('applicationId 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.');
}

Просмотреть файл

@ -366,25 +366,25 @@ export interface ApplicationOperations {
*
* @param {string} applicationId The id of the application.
*
* @param {object} parameters The parameters for the request.
*
* @param {boolean} [parameters.allowUpdates] A value indicating whether
* packages within the application may be overwritten using the same version
* string.
*
* @param {string} [parameters.displayName] The display name for the
* application.
*
* @param {object} [options] Optional Parameters.
*
* @param {object} [options.parameters] The parameters for the request.
*
* @param {boolean} [options.parameters.allowUpdates] A value indicating
* whether packages within the application may be overwritten using the same
* version string.
*
* @param {string} [options.parameters.displayName] The display name for the
* application.
*
* @param {object} [options.customHeaders] Headers that will be added to the
* request
*
* @param {ServiceCallback} [callback] callback function; see ServiceCallback
* doc in ms-rest index.d.ts for details
*/
addApplication(resourceGroupName: string, accountName: string, applicationId: string, parameters: models.AddApplicationParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<void>): void;
addApplication(resourceGroupName: string, accountName: string, applicationId: string, parameters: models.AddApplicationParameters, callback: ServiceCallback<void>): void;
addApplication(resourceGroupName: string, accountName: string, applicationId: string, options: { parameters? : models.AddApplicationParameters, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<void>): void;
addApplication(resourceGroupName: string, accountName: string, applicationId: string, callback: ServiceCallback<void>): void;
/**
* Deletes an application.

Просмотреть файл

@ -97,7 +97,8 @@ describe('Batch Management', function () {
it('should add application successfully', function (done) {
var params = { allowUpdates: true, displayName: 'my_application_name' };
client.applicationOperations.addApplication(groupName, 'batchtestnodesdk', 'my_application_id', params, function (err, result, request, response) {
var options = { parameters : params };
client.applicationOperations.addApplication(groupName, 'batchtestnodesdk', 'my_application_id', options, function (err, result, request, response) {
should.not.exist(err);
should.not.exist(result);
response.statusCode.should.equal(201);