Merge branch 'master' into 7.x

This commit is contained in:
delvedor
2019-03-26 12:06:04 +01:00
270 changed files with 1805 additions and 2800 deletions

View File

@ -24,7 +24,7 @@
function buildBulk (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [bulk](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html) request
*
@ -90,26 +90,20 @@ function buildBulk (opts) {
// check required parameters
if (params['body'] == null) {
return callback(
new ConfigurationError('Missing required parameter: body'),
result
)
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
return callback(
new ConfigurationError('Missing required parameter of the url: index'),
result
)
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatAliases (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.aliases](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html) request
*
@ -82,18 +82,14 @@ function buildCatAliases (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatAllocation (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.allocation](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html) request
*
@ -84,18 +84,14 @@ function buildCatAllocation (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatCount (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.count](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html) request
*
@ -82,18 +82,14 @@ function buildCatCount (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatFielddata (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.fielddata](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html) request
*
@ -86,18 +86,14 @@ function buildCatFielddata (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatHealth (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html) request
*
@ -83,18 +83,14 @@ function buildCatHealth (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatHelp (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.help](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html) request
*
@ -70,18 +70,14 @@ function buildCatHelp (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatIndices (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.indices](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html) request
*
@ -88,18 +88,14 @@ function buildCatIndices (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatMaster (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.master](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html) request
*
@ -81,18 +81,14 @@ function buildCatMaster (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatNodeattrs (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.nodeattrs](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodeattrs.html) request
*
@ -81,18 +81,14 @@ function buildCatNodeattrs (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatNodes (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.nodes](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-nodes.html) request
*
@ -84,18 +84,14 @@ function buildCatNodes (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatPendingTasks (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.pending_tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-pending-tasks.html) request
*
@ -81,18 +81,14 @@ function buildCatPendingTasks (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatPlugins (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.plugins](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-plugins.html) request
*
@ -81,18 +81,14 @@ function buildCatPlugins (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatRecovery (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.recovery](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-recovery.html) request
*
@ -82,18 +82,14 @@ function buildCatRecovery (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatRepositories (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.repositories](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-repositories.html) request
*
@ -81,18 +81,14 @@ function buildCatRepositories (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatSegments (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.segments](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-segments.html) request
*
@ -79,18 +79,14 @@ function buildCatSegments (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatShards (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.shards](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-shards.html) request
*
@ -84,18 +84,14 @@ function buildCatShards (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatSnapshots (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.snapshots](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-snapshots.html) request
*
@ -83,18 +83,14 @@ function buildCatSnapshots (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatTasks (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/tasks.html) request
*
@ -86,18 +86,14 @@ function buildCatTasks (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatTemplates (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.templates](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-templates.html) request
*
@ -82,18 +82,14 @@ function buildCatTemplates (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCatThreadPool (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cat.thread_pool](http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-thread-pool.html) request
*
@ -84,18 +84,14 @@ function buildCatThreadPool (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCcrDeleteAutoFollowPattern (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.delete_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html) request
*
@ -62,18 +62,14 @@ function buildCcrDeleteAutoFollowPattern (opts) {
// check required parameters
if (params['name'] == null) {
return callback(
new ConfigurationError('Missing required parameter: name'),
result
)
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCcrFollow (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html) request
*
@ -64,24 +64,18 @@ function buildCcrFollow (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
return callback(
new ConfigurationError('Missing required parameter: body'),
result
)
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCcrFollowInfo (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.follow_info](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html) request
*
@ -62,10 +62,8 @@ function buildCcrFollowInfo (opts) {
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCcrFollowStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.follow_stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html) request
*
@ -62,10 +62,8 @@ function buildCcrFollowStats (opts) {
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCcrGetAutoFollowPattern (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.get_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html) request
*
@ -62,10 +62,8 @@ function buildCcrGetAutoFollowPattern (opts) {
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCcrPauseFollow (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.pause_follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html) request
*
@ -62,18 +62,14 @@ function buildCcrPauseFollow (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCcrPutAutoFollowPattern (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.put_auto_follow_pattern](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html) request
*
@ -63,24 +63,18 @@ function buildCcrPutAutoFollowPattern (opts) {
// check required parameters
if (params['name'] == null) {
return callback(
new ConfigurationError('Missing required parameter: name'),
result
)
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
return callback(
new ConfigurationError('Missing required parameter: body'),
result
)
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCcrResumeFollow (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.resume_follow](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html) request
*
@ -63,18 +63,14 @@ function buildCcrResumeFollow (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCcrStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.stats](https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html) request
*
@ -61,10 +61,8 @@ function buildCcrStats (opts) {
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCcrUnfollow (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ccr.unfollow](http://www.elastic.co/guide/en/elasticsearch/reference/current) request
*
@ -62,18 +62,14 @@ function buildCcrUnfollow (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildClearScroll (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [clear_scroll](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-request-scroll.html) request
*
@ -68,10 +68,8 @@ function buildClearScroll (opts) {
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildClusterAllocationExplain (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.allocation_explain](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-allocation-explain.html) request
*
@ -73,10 +73,8 @@ function buildClusterAllocationExplain (opts) {
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildClusterGetSettings (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.get_settings](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html) request
*
@ -77,18 +77,14 @@ function buildClusterGetSettings (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildClusterHealth (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.health](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-health.html) request
*
@ -94,18 +94,14 @@ function buildClusterHealth (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildClusterPendingTasks (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.pending_tasks](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-pending.html) request
*
@ -71,18 +71,14 @@ function buildClusterPendingTasks (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildClusterPutSettings (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.put_settings](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-update-settings.html) request
*
@ -75,18 +75,14 @@ function buildClusterPutSettings (opts) {
// check required parameters
if (params['body'] == null) {
return callback(
new ConfigurationError('Missing required parameter: body'),
result
)
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildClusterRemoteInfo (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.remote_info](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-remote-info.html) request
*
@ -66,18 +66,14 @@ function buildClusterRemoteInfo (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildClusterReroute (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.reroute](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-reroute.html) request
*
@ -82,10 +82,8 @@ function buildClusterReroute (opts) {
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildClusterState (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.state](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-state.html) request
*
@ -91,26 +91,20 @@ function buildClusterState (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// check required url components
if (params['index'] != null && (params['metric'] == null)) {
return callback(
new ConfigurationError('Missing required parameter of the url: metric'),
result
)
const err = new ConfigurationError('Missing required parameter of the url: metric')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildClusterStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [cluster.stats](http://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-stats.html) request
*
@ -72,18 +72,14 @@ function buildClusterStats (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCount (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [count](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-count.html) request
*
@ -105,18 +105,14 @@ function buildCount (opts) {
// check required url components
if (params['type'] != null && (params['index'] == null)) {
return callback(
new ConfigurationError('Missing required parameter of the url: index'),
result
)
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildCreate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [create](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request
*
@ -88,30 +88,22 @@ function buildCreate (opts) {
// check required parameters
if (params['id'] == null) {
return callback(
new ConfigurationError('Missing required parameter: id'),
result
)
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
return callback(
new ConfigurationError('Missing required parameter: body'),
result
)
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildDelete (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [delete](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete.html) request
*
@ -91,38 +91,28 @@ function buildDelete (opts) {
// check required parameters
if (params['id'] == null) {
return callback(
new ConfigurationError('Missing required parameter: id'),
result
)
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// check required url components
if (params['id'] != null && (params['index'] == null)) {
return callback(
new ConfigurationError('Missing required parameter of the url: index'),
result
)
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildDeleteByQuery (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [delete_by_query](https://www.elastic.co/guide/en/elasticsearch/reference/master/docs-delete-by-query.html) request
*
@ -148,32 +148,24 @@ function buildDeleteByQuery (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
return callback(
new ConfigurationError('Missing required parameter: body'),
result
)
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
return callback(
new ConfigurationError('Missing required parameter of the url: index'),
result
)
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildDeleteByQueryRethrottle (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [delete_by_query_rethrottle](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html) request
*
@ -70,30 +70,22 @@ function buildDeleteByQueryRethrottle (opts) {
// check required parameters
if (params['task_id'] == null && params['taskId'] == null) {
return callback(
new ConfigurationError('Missing required parameter: task_id or taskId'),
result
)
const err = new ConfigurationError('Missing required parameter: task_id or taskId')
return handleError(err, callback)
}
if (params['requests_per_second'] == null && params['requestsPerSecond'] == null) {
return callback(
new ConfigurationError('Missing required parameter: requests_per_second or requestsPerSecond'),
result
)
const err = new ConfigurationError('Missing required parameter: requests_per_second or requestsPerSecond')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildDeleteScript (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [delete_script](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request
*
@ -72,24 +72,18 @@ function buildDeleteScript (opts) {
// check required parameters
if (params['id'] == null) {
return callback(
new ConfigurationError('Missing required parameter: id'),
result
)
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildExists (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [exists](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
*
@ -95,30 +95,22 @@ function buildExists (opts) {
// check required parameters
if (params['id'] == null) {
return callback(
new ConfigurationError('Missing required parameter: id'),
result
)
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildExistsSource (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [exists_source](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
*
@ -92,43 +92,31 @@ function buildExistsSource (opts) {
// check required parameters
if (params['id'] == null) {
return callback(
new ConfigurationError('Missing required parameter: id'),
result
)
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// check required url components
if (params['id'] != null && (params['type'] == null || params['index'] == null)) {
return callback(
new ConfigurationError('Missing required parameter of the url: type, index'),
result
)
const err = new ConfigurationError('Missing required parameter of the url: type, index')
return handleError(err, callback)
} else if (params['type'] != null && (params['index'] == null)) {
return callback(
new ConfigurationError('Missing required parameter of the url: index'),
result
)
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildExplain (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [explain](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-explain.html) request
*
@ -101,24 +101,18 @@ function buildExplain (opts) {
// check required parameters
if (params['id'] == null) {
return callback(
new ConfigurationError('Missing required parameter: id'),
result
)
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildFieldCaps (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [field_caps](http://www.elastic.co/guide/en/elasticsearch/reference/master/search-field-caps.html) request
*
@ -78,18 +78,14 @@ function buildFieldCaps (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildGet (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [get](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
*
@ -101,30 +101,22 @@ function buildGet (opts) {
// check required parameters
if (params['id'] == null) {
return callback(
new ConfigurationError('Missing required parameter: id'),
result
)
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildGetScript (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [get_script](http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.html) request
*
@ -70,24 +70,18 @@ function buildGetScript (opts) {
// check required parameters
if (params['id'] == null) {
return callback(
new ConfigurationError('Missing required parameter: id'),
result
)
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildGetSource (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [get_source](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-get.html) request
*
@ -92,30 +92,22 @@ function buildGetSource (opts) {
// check required parameters
if (params['id'] == null) {
return callback(
new ConfigurationError('Missing required parameter: id'),
result
)
const err = new ConfigurationError('Missing required parameter: id')
return handleError(err, callback)
}
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIlmDeleteLifecycle (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ilm.delete_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html) request
*
@ -62,18 +62,14 @@ function buildIlmDeleteLifecycle (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIlmExplainLifecycle (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ilm.explain_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html) request
*
@ -63,18 +63,14 @@ function buildIlmExplainLifecycle (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIlmGetLifecycle (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ilm.get_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html) request
*
@ -62,18 +62,14 @@ function buildIlmGetLifecycle (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIlmGetStatus (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ilm.get_status](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html) request
*
@ -61,18 +61,14 @@ function buildIlmGetStatus (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIlmMoveToStep (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ilm.move_to_step](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html) request
*
@ -63,10 +63,8 @@ function buildIlmMoveToStep (opts) {
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIlmPutLifecycle (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ilm.put_lifecycle](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html) request
*
@ -63,10 +63,8 @@ function buildIlmPutLifecycle (opts) {
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIlmRemovePolicy (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ilm.remove_policy](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html) request
*
@ -62,18 +62,14 @@ function buildIlmRemovePolicy (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIlmRetry (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ilm.retry](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html) request
*
@ -62,18 +62,14 @@ function buildIlmRetry (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIlmStart (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ilm.start](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html) request
*
@ -61,18 +61,14 @@ function buildIlmStart (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIlmStop (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [ilm.stop](https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html) request
*
@ -61,18 +61,14 @@ function buildIlmStop (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndex (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [index](http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-index_.html) request
*
@ -97,32 +97,24 @@ function buildIndex (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['body'] == null) {
return callback(
new ConfigurationError('Missing required parameter: body'),
result
)
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// check required url components
if (params['id'] != null && (params['index'] == null)) {
return callback(
new ConfigurationError('Missing required parameter of the url: index'),
result
)
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesAnalyze (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.analyze](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-analyze.html) request
*
@ -70,10 +70,8 @@ function buildIndicesAnalyze (opts) {
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesClearCache (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.clear_cache](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-clearcache.html) request
*
@ -86,18 +86,14 @@ function buildIndicesClearCache (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesClose (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.close](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html) request
*
@ -81,24 +81,18 @@ function buildIndicesClose (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesCreate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.create](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-create-index.html) request
*
@ -79,18 +79,14 @@ function buildIndicesCreate (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesDelete (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.delete](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-delete-index.html) request
*
@ -81,24 +81,18 @@ function buildIndicesDelete (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesDeleteAlias (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.delete_alias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request
*
@ -73,38 +73,28 @@ function buildIndicesDeleteAlias (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['name'] == null) {
return callback(
new ConfigurationError('Missing required parameter: name'),
result
)
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// check required url components
if (params['name'] != null && (params['index'] == null)) {
return callback(
new ConfigurationError('Missing required parameter of the url: index'),
result
)
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesDeleteTemplate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.delete_template](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request
*
@ -72,24 +72,18 @@ function buildIndicesDeleteTemplate (opts) {
// check required parameters
if (params['name'] == null) {
return callback(
new ConfigurationError('Missing required parameter: name'),
result
)
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesExists (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.exists](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-exists.html) request
*
@ -84,24 +84,18 @@ function buildIndicesExists (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesExistsAlias (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.exists_alias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request
*
@ -79,24 +79,18 @@ function buildIndicesExistsAlias (opts) {
// check required parameters
if (params['name'] == null) {
return callback(
new ConfigurationError('Missing required parameter: name'),
result
)
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesExistsTemplate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.exists_template](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request
*
@ -75,24 +75,18 @@ function buildIndicesExistsTemplate (opts) {
// check required parameters
if (params['name'] == null) {
return callback(
new ConfigurationError('Missing required parameter: name'),
result
)
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesExistsType (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.exists_type](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-types-exists.html) request
*
@ -79,38 +79,28 @@ function buildIndicesExistsType (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['type'] == null) {
return callback(
new ConfigurationError('Missing required parameter: type'),
result
)
const err = new ConfigurationError('Missing required parameter: type')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// check required url components
if (params['type'] != null && (params['index'] == null)) {
return callback(
new ConfigurationError('Missing required parameter of the url: index'),
result
)
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesFlush (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.flush](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-flush.html) request
*
@ -81,18 +81,14 @@ function buildIndicesFlush (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesFlushSynced (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.flush_synced](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-synced-flush.html) request
*
@ -76,18 +76,14 @@ function buildIndicesFlushSynced (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesForcemerge (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.forcemerge](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-forcemerge.html) request
*
@ -84,18 +84,14 @@ function buildIndicesForcemerge (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesFreeze (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.freeze](https://www.elastic.co/guide/en/elasticsearch/reference/current/frozen.html) request
*
@ -77,24 +77,18 @@ function buildIndicesFreeze (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesGet (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.get](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-index.html) request
*
@ -90,24 +90,18 @@ function buildIndicesGet (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesGetAlias (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.get_alias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request
*
@ -79,18 +79,14 @@ function buildIndicesGetAlias (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesGetFieldMapping (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.get_field_mapping](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-field-mapping.html) request
*
@ -86,24 +86,18 @@ function buildIndicesGetFieldMapping (opts) {
// check required parameters
if (params['fields'] == null) {
return callback(
new ConfigurationError('Missing required parameter: fields'),
result
)
const err = new ConfigurationError('Missing required parameter: fields')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesGetMapping (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.get_mapping](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-mapping.html) request
*
@ -85,18 +85,14 @@ function buildIndicesGetMapping (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesGetSettings (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.get_settings](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-get-settings.html) request
*
@ -88,18 +88,14 @@ function buildIndicesGetSettings (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesGetTemplate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.get_template](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request
*
@ -78,18 +78,14 @@ function buildIndicesGetTemplate (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesGetUpgrade (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.get_upgrade](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-upgrade.html) request
*
@ -76,18 +76,14 @@ function buildIndicesGetUpgrade (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesOpen (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.open](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-open-close.html) request
*
@ -84,24 +84,18 @@ function buildIndicesOpen (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesPutAlias (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.put_alias](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html) request
*
@ -74,32 +74,24 @@ function buildIndicesPutAlias (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['name'] == null) {
return callback(
new ConfigurationError('Missing required parameter: name'),
result
)
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
// check required url components
if (params['name'] != null && (params['index'] == null)) {
return callback(
new ConfigurationError('Missing required parameter of the url: index'),
result
)
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesPutMapping (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.put_mapping](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-put-mapping.html) request
*
@ -86,18 +86,14 @@ function buildIndicesPutMapping (opts) {
// check required parameters
if (params['body'] == null) {
return callback(
new ConfigurationError('Missing required parameter: body'),
result
)
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesPutSettings (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.put_settings](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-update-settings.html) request
*
@ -88,18 +88,14 @@ function buildIndicesPutSettings (opts) {
// check required parameters
if (params['body'] == null) {
return callback(
new ConfigurationError('Missing required parameter: body'),
result
)
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesPutTemplate (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.put_template](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html) request
*
@ -83,24 +83,18 @@ function buildIndicesPutTemplate (opts) {
// check required parameters
if (params['name'] == null) {
return callback(
new ConfigurationError('Missing required parameter: name'),
result
)
const err = new ConfigurationError('Missing required parameter: name')
return handleError(err, callback)
}
if (params['body'] == null) {
return callback(
new ConfigurationError('Missing required parameter: body'),
result
)
const err = new ConfigurationError('Missing required parameter: body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesRecovery (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.recovery](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-recovery.html) request
*
@ -72,18 +72,14 @@ function buildIndicesRecovery (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesRefresh (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.refresh](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-refresh.html) request
*
@ -76,18 +76,14 @@ function buildIndicesRefresh (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesRollover (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.rollover](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html) request
*
@ -83,26 +83,20 @@ function buildIndicesRollover (opts) {
// check required parameters
if (params['alias'] == null) {
return callback(
new ConfigurationError('Missing required parameter: alias'),
result
)
const err = new ConfigurationError('Missing required parameter: alias')
return handleError(err, callback)
}
// check required url components
if ((params['new_index'] != null || params['newIndex'] != null) && (params['alias'] == null)) {
return callback(
new ConfigurationError('Missing required parameter of the url: alias'),
result
)
const err = new ConfigurationError('Missing required parameter of the url: alias')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesSegments (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.segments](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-segments.html) request
*
@ -78,18 +78,14 @@ function buildIndicesSegments (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesShardStores (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.shard_stores](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shards-stores.html) request
*
@ -78,18 +78,14 @@ function buildIndicesShardStores (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesShrink (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.shrink](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-shrink-index.html) request
*
@ -80,32 +80,24 @@ function buildIndicesShrink (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['target'] == null) {
return callback(
new ConfigurationError('Missing required parameter: target'),
result
)
const err = new ConfigurationError('Missing required parameter: target')
return handleError(err, callback)
}
// check required url components
if (params['target'] != null && (params['index'] == null)) {
return callback(
new ConfigurationError('Missing required parameter of the url: index'),
result
)
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesSplit (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.split](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-split-index.html) request
*
@ -80,32 +80,24 @@ function buildIndicesSplit (opts) {
// check required parameters
if (params['index'] == null) {
return callback(
new ConfigurationError('Missing required parameter: index'),
result
)
const err = new ConfigurationError('Missing required parameter: index')
return handleError(err, callback)
}
if (params['target'] == null) {
return callback(
new ConfigurationError('Missing required parameter: target'),
result
)
const err = new ConfigurationError('Missing required parameter: target')
return handleError(err, callback)
}
// check required url components
if (params['target'] != null && (params['index'] == null)) {
return callback(
new ConfigurationError('Missing required parameter of the url: index'),
result
)
const err = new ConfigurationError('Missing required parameter of the url: index')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

View File

@ -24,7 +24,7 @@
function buildIndicesStats (opts) {
// eslint-disable-next-line no-unused-vars
const { makeRequest, ConfigurationError, result } = opts
const { makeRequest, ConfigurationError, handleError } = opts
/**
* Perform a [indices.stats](http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-stats.html) request
*
@ -85,18 +85,14 @@ function buildIndicesStats (opts) {
// check required parameters
if (params.body != null) {
return callback(
new ConfigurationError('This API does not require a body'),
result
)
const err = new ConfigurationError('This API does not require a body')
return handleError(err, callback)
}
// validate headers object
if (options.headers != null && typeof options.headers !== 'object') {
return callback(
new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`),
result
)
const err = new ConfigurationError(`Headers should be an object, instead got: ${typeof options.headers}`)
return handleError(err, callback)
}
var warnings = null

Some files were not shown because too many files have changed in this diff Show More