API generation

This commit is contained in:
delvedor
2020-11-12 07:45:17 +01:00
parent cbfb9616a0
commit 6e61ae236c
6 changed files with 75 additions and 16 deletions

View File

@ -85,6 +85,33 @@ AsyncSearchApi.prototype.get = function asyncSearchGetApi (params, options, call
return this.transport.request(request, options, callback)
}
AsyncSearchApi.prototype.status = function asyncSearchStatusApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)
// check required parameters
if (params['id'] == null) {
const err = new this[kConfigurationError]('Missing required parameter: id')
return handleError(err, callback)
}
var { method, body, id, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if (method == null) method = 'GET'
path = '/' + '_async_search' + '/' + 'status' + '/' + encodeURIComponent(id)
// build request object
const request = {
method,
path,
body: null,
querystring
}
return this.transport.request(request, options, callback)
}
AsyncSearchApi.prototype.submit = function asyncSearchSubmitApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)

View File

@ -777,13 +777,8 @@ IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi (params, options
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((index) != null) {
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_upgrade'
} else {
if (method == null) method = 'GET'
path = '/' + '_upgrade'
}
if (method == null) method = 'GET'
path = '/' + encodeURIComponent(index) + '/' + '_upgrade'
// build request object
const request = {
@ -1371,13 +1366,8 @@ IndicesApi.prototype.upgrade = function indicesUpgradeApi (params, options, call
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
var path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_upgrade'
} else {
if (method == null) method = 'POST'
path = '/' + '_upgrade'
}
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_upgrade'
// build request object
const request = {