From 918599e148d6947535f8c5e09f86d067fabc26f9 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 19 Apr 2018 09:42:55 -0700 Subject: [PATCH] [AutoPR apimanagement/resource-manager] ApiIssue HEAD operation name consistent across the spec (#2751) * Generated from 3a649f27e5368d86880dc0f4c3b8b2c76676763e normalize head names * Generated from 58adb27c9fd292a5f3c01faa388a3183c075b632 delete supports 200 --- .../apimanagement/lib/operations/apiIssue.js | 16 ++++++------- .../lib/operations/apiIssueAttachment.js | 16 ++++++------- .../lib/operations/apiIssueComment.js | 16 ++++++------- .../apimanagement/lib/operations/index.d.ts | 24 +++++++++---------- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/lib/services/apimanagement/lib/operations/apiIssue.js b/lib/services/apimanagement/lib/operations/apiIssue.js index 359db683c4..e0690110da 100644 --- a/lib/services/apimanagement/lib/operations/apiIssue.js +++ b/lib/services/apimanagement/lib/operations/apiIssue.js @@ -272,7 +272,7 @@ function _listByService(resourceGroupName, serviceName, apiId, options, callback * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _head(resourceGroupName, serviceName, apiId, issueId, options, callback) { +function _getEntityTag(resourceGroupName, serviceName, apiId, issueId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1053,7 +1053,7 @@ function _deleteMethod(resourceGroupName, serviceName, apiId, issueId, ifMatch, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1224,7 +1224,7 @@ class ApiIssue { constructor(client) { this.client = client; this._listByService = _listByService; - this._head = _head; + this._getEntityTag = _getEntityTag; this._get = _get; this._createOrUpdate = _createOrUpdate; this._deleteMethod = _deleteMethod; @@ -1374,11 +1374,11 @@ class ApiIssue { * * @reject {Error} - The error object. */ - headWithHttpOperationResponse(resourceGroupName, serviceName, apiId, issueId, options) { + getEntityTagWithHttpOperationResponse(resourceGroupName, serviceName, apiId, issueId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._head(resourceGroupName, serviceName, apiId, issueId, options, (err, result, request, response) => { + self._getEntityTag(resourceGroupName, serviceName, apiId, issueId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1428,7 +1428,7 @@ class ApiIssue { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - head(resourceGroupName, serviceName, apiId, issueId, options, optionalCallback) { + getEntityTag(resourceGroupName, serviceName, apiId, issueId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1437,14 +1437,14 @@ class ApiIssue { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._head(resourceGroupName, serviceName, apiId, issueId, options, (err, result, request, response) => { + self._getEntityTag(resourceGroupName, serviceName, apiId, issueId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._head(resourceGroupName, serviceName, apiId, issueId, options, optionalCallback); + return self._getEntityTag(resourceGroupName, serviceName, apiId, issueId, options, optionalCallback); } } diff --git a/lib/services/apimanagement/lib/operations/apiIssueAttachment.js b/lib/services/apimanagement/lib/operations/apiIssueAttachment.js index f24510df3f..227dac18a5 100644 --- a/lib/services/apimanagement/lib/operations/apiIssueAttachment.js +++ b/lib/services/apimanagement/lib/operations/apiIssueAttachment.js @@ -295,7 +295,7 @@ function _listByService(resourceGroupName, serviceName, apiId, issueId, options, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _head(resourceGroupName, serviceName, apiId, issueId, attachmentId, options, callback) { +function _getEntityTag(resourceGroupName, serviceName, apiId, issueId, attachmentId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1154,7 +1154,7 @@ function _deleteMethod(resourceGroupName, serviceName, apiId, issueId, attachmen return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1326,7 +1326,7 @@ class ApiIssueAttachment { constructor(client) { this.client = client; this._listByService = _listByService; - this._head = _head; + this._getEntityTag = _getEntityTag; this._get = _get; this._createOrUpdate = _createOrUpdate; this._deleteMethod = _deleteMethod; @@ -1482,11 +1482,11 @@ class ApiIssueAttachment { * * @reject {Error} - The error object. */ - headWithHttpOperationResponse(resourceGroupName, serviceName, apiId, issueId, attachmentId, options) { + getEntityTagWithHttpOperationResponse(resourceGroupName, serviceName, apiId, issueId, attachmentId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._head(resourceGroupName, serviceName, apiId, issueId, attachmentId, options, (err, result, request, response) => { + self._getEntityTag(resourceGroupName, serviceName, apiId, issueId, attachmentId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1539,7 +1539,7 @@ class ApiIssueAttachment { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - head(resourceGroupName, serviceName, apiId, issueId, attachmentId, options, optionalCallback) { + getEntityTag(resourceGroupName, serviceName, apiId, issueId, attachmentId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1548,14 +1548,14 @@ class ApiIssueAttachment { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._head(resourceGroupName, serviceName, apiId, issueId, attachmentId, options, (err, result, request, response) => { + self._getEntityTag(resourceGroupName, serviceName, apiId, issueId, attachmentId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._head(resourceGroupName, serviceName, apiId, issueId, attachmentId, options, optionalCallback); + return self._getEntityTag(resourceGroupName, serviceName, apiId, issueId, attachmentId, options, optionalCallback); } } diff --git a/lib/services/apimanagement/lib/operations/apiIssueComment.js b/lib/services/apimanagement/lib/operations/apiIssueComment.js index 4029236dbf..91997c41ee 100644 --- a/lib/services/apimanagement/lib/operations/apiIssueComment.js +++ b/lib/services/apimanagement/lib/operations/apiIssueComment.js @@ -295,7 +295,7 @@ function _listByService(resourceGroupName, serviceName, apiId, issueId, options, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _head(resourceGroupName, serviceName, apiId, issueId, commentId, options, callback) { +function _getEntityTag(resourceGroupName, serviceName, apiId, issueId, commentId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1150,7 +1150,7 @@ function _deleteMethod(resourceGroupName, serviceName, apiId, issueId, commentId return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1322,7 +1322,7 @@ class ApiIssueComment { constructor(client) { this.client = client; this._listByService = _listByService; - this._head = _head; + this._getEntityTag = _getEntityTag; this._get = _get; this._createOrUpdate = _createOrUpdate; this._deleteMethod = _deleteMethod; @@ -1478,11 +1478,11 @@ class ApiIssueComment { * * @reject {Error} - The error object. */ - headWithHttpOperationResponse(resourceGroupName, serviceName, apiId, issueId, commentId, options) { + getEntityTagWithHttpOperationResponse(resourceGroupName, serviceName, apiId, issueId, commentId, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._head(resourceGroupName, serviceName, apiId, issueId, commentId, options, (err, result, request, response) => { + self._getEntityTag(resourceGroupName, serviceName, apiId, issueId, commentId, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1535,7 +1535,7 @@ class ApiIssueComment { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - head(resourceGroupName, serviceName, apiId, issueId, commentId, options, optionalCallback) { + getEntityTag(resourceGroupName, serviceName, apiId, issueId, commentId, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1544,14 +1544,14 @@ class ApiIssueComment { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._head(resourceGroupName, serviceName, apiId, issueId, commentId, options, (err, result, request, response) => { + self._getEntityTag(resourceGroupName, serviceName, apiId, issueId, commentId, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._head(resourceGroupName, serviceName, apiId, issueId, commentId, options, optionalCallback); + return self._getEntityTag(resourceGroupName, serviceName, apiId, issueId, commentId, options, optionalCallback); } } diff --git a/lib/services/apimanagement/lib/operations/index.d.ts b/lib/services/apimanagement/lib/operations/index.d.ts index bdfecfea76..91cfb380a4 100644 --- a/lib/services/apimanagement/lib/operations/index.d.ts +++ b/lib/services/apimanagement/lib/operations/index.d.ts @@ -5365,7 +5365,7 @@ export interface ApiIssue { * * @reject {Error|ServiceError} - The error object. */ - headWithHttpOperationResponse(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getEntityTagWithHttpOperationResponse(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets the entity state (Etag) version of the Issue for an API specified by @@ -5407,9 +5407,9 @@ export interface ApiIssue { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - head(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - head(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, callback: ServiceCallback): void; - head(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getEntityTag(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getEntityTag(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, callback: ServiceCallback): void; + getEntityTag(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -5864,7 +5864,7 @@ export interface ApiIssueComment { * * @reject {Error|ServiceError} - The error object. */ - headWithHttpOperationResponse(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, commentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getEntityTagWithHttpOperationResponse(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, commentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets the entity state (Etag) version of the issue Comment for an API @@ -5909,9 +5909,9 @@ export interface ApiIssueComment { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - head(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, commentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - head(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, commentId: string, callback: ServiceCallback): void; - head(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, commentId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getEntityTag(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, commentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getEntityTag(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, commentId: string, callback: ServiceCallback): void; + getEntityTag(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, commentId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6371,7 +6371,7 @@ export interface ApiIssueAttachment { * * @reject {Error|ServiceError} - The error object. */ - headWithHttpOperationResponse(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, attachmentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getEntityTagWithHttpOperationResponse(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, attachmentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Gets the entity state (Etag) version of the issue Attachment for an API @@ -6416,9 +6416,9 @@ export interface ApiIssueAttachment { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - head(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, attachmentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - head(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, attachmentId: string, callback: ServiceCallback): void; - head(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, attachmentId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getEntityTag(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, attachmentId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getEntityTag(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, attachmentId: string, callback: ServiceCallback): void; + getEntityTag(resourceGroupName: string, serviceName: string, apiId: string, issueId: string, attachmentId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /**