@opensearch-project/opensearch 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.json +26 -0
  3. package/.prettierrc.json +5 -0
  4. package/.whitesource +15 -0
  5. package/ADMINS.md +18 -11
  6. package/COMPATIBILITY.md +24 -0
  7. package/DEVELOPER_GUIDE.md +22 -5
  8. package/MAINTAINERS.md +23 -18
  9. package/README.md +102 -106
  10. package/RELEASING.md +3 -3
  11. package/SECURITY.md +1 -1
  12. package/api/api/bulk.js +53 -26
  13. package/api/api/cat.js +354 -264
  14. package/api/api/clear_scroll.js +17 -17
  15. package/api/api/cluster.js +366 -219
  16. package/api/api/count.js +55 -24
  17. package/api/api/create.js +50 -24
  18. package/api/api/dangling_indices.js +95 -51
  19. package/api/api/delete.js +49 -22
  20. package/api/api/delete_by_query.js +88 -25
  21. package/api/api/delete_by_query_rethrottle.js +33 -19
  22. package/api/api/delete_script.js +31 -17
  23. package/api/api/exists.js +55 -22
  24. package/api/api/exists_source.js +60 -27
  25. package/api/api/explain.js +60 -22
  26. package/api/api/features.js +56 -35
  27. package/api/api/field_caps.js +36 -18
  28. package/api/api/get.js +55 -22
  29. package/api/api/get_script.js +30 -17
  30. package/api/api/get_script_context.js +15 -15
  31. package/api/api/get_script_languages.js +15 -15
  32. package/api/api/get_source.js +55 -22
  33. package/api/api/index.js +60 -28
  34. package/api/api/indices.js +1068 -857
  35. package/api/api/info.js +15 -15
  36. package/api/api/ingest.js +132 -96
  37. package/api/api/mget.js +50 -26
  38. package/api/api/msearch.js +49 -26
  39. package/api/api/msearch_template.js +53 -26
  40. package/api/api/mtermvectors.js +48 -24
  41. package/api/api/nodes.js +281 -154
  42. package/api/api/ping.js +15 -15
  43. package/api/api/put_script.js +40 -25
  44. package/api/api/rank_eval.js +37 -20
  45. package/api/api/reindex.js +38 -17
  46. package/api/api/reindex_rethrottle.js +32 -19
  47. package/api/api/render_search_template.js +18 -18
  48. package/api/api/scripts_painless_execute.js +15 -15
  49. package/api/api/scroll.js +31 -17
  50. package/api/api/search.js +108 -24
  51. package/api/api/search_shards.js +36 -18
  52. package/api/api/search_template.js +64 -26
  53. package/api/api/shutdown.js +66 -54
  54. package/api/api/snapshot.js +347 -224
  55. package/api/api/tasks.js +65 -46
  56. package/api/api/terms_enum.js +17 -17
  57. package/api/api/termvectors.js +57 -26
  58. package/api/api/update.js +64 -24
  59. package/api/api/update_by_query.js +89 -23
  60. package/api/api/update_by_query_rethrottle.js +33 -19
  61. package/api/index.js +267 -179
  62. package/api/new.d.ts +2042 -529
  63. package/api/opensearch_dashboards.d.ts +275 -0
  64. package/api/requestParams.d.ts +301 -69
  65. package/api/types.d.ts +6204 -5719
  66. package/api/utils.js +22 -22
  67. package/codecov.yml +2 -2
  68. package/index.d.ts +4779 -934
  69. package/index.js +153 -140
  70. package/index.mjs +9 -9
  71. package/lib/Connection.d.ts +37 -26
  72. package/lib/Connection.js +163 -168
  73. package/lib/Helpers.d.ts +103 -63
  74. package/lib/Helpers.js +398 -371
  75. package/lib/Serializer.d.ts +2 -2
  76. package/lib/Serializer.js +39 -39
  77. package/lib/Transport.d.ts +30 -12
  78. package/lib/Transport.js +383 -324
  79. package/lib/errors.d.ts +25 -7
  80. package/lib/errors.js +75 -71
  81. package/lib/pool/BaseConnectionPool.js +100 -97
  82. package/lib/pool/CloudConnectionPool.js +16 -16
  83. package/lib/pool/ConnectionPool.js +105 -105
  84. package/lib/pool/index.d.ts +8 -6
  85. package/lib/pool/index.js +6 -6
  86. package/package.json +13 -8
@@ -28,70 +28,157 @@
28
28
  * under the License.
29
29
  */
30
30
 
31
- 'use strict'
31
+ 'use strict';
32
32
 
33
33
  /* eslint camelcase: 0 */
34
34
  /* eslint no-unused-vars: 0 */
35
35
 
36
- const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils')
37
- const acceptedQuerystring = ['timeout', 'master_timeout', 'ignore_unavailable', 'allow_no_indices', 'expand_wildcards', 'pretty', 'human', 'error_trace', 'source', 'filter_path', 'index', 'fielddata', 'fields', 'query', 'request', 'wait_for_active_shards', 'include_type_name', 'run_expensive_tasks', 'flush', 'local', 'flat_settings', 'include_defaults', 'force', 'wait_if_ongoing', 'max_num_segments', 'only_expunge_deletes', 'create', 'cause', 'write_index_only', 'preserve_existing', 'order', 'detailed', 'active_only', 'dry_run', 'verbose', 'status', 'copy_settings', 'completion_fields', 'fielddata_fields', 'groups', 'level', 'types', 'include_segment_file_sizes', 'include_unloaded_segments', 'forbid_closed_indices', 'wait_for_completion', 'only_ancient_segments', 'explain', 'q', 'analyzer', 'analyze_wildcard', 'default_operator', 'df', 'lenient', 'rewrite', 'all_shards']
38
- const snakeCase = { masterTimeout: 'master_timeout', ignoreUnavailable: 'ignore_unavailable', allowNoIndices: 'allow_no_indices', expandWildcards: 'expand_wildcards', errorTrace: 'error_trace', filterPath: 'filter_path', waitForActiveShards: 'wait_for_active_shards', includeTypeName: 'include_type_name', runExpensiveTasks: 'run_expensive_tasks', flatSettings: 'flat_settings', includeDefaults: 'include_defaults', waitIfOngoing: 'wait_if_ongoing', maxNumSegments: 'max_num_segments', onlyExpungeDeletes: 'only_expunge_deletes', writeIndexOnly: 'write_index_only', preserveExisting: 'preserve_existing', activeOnly: 'active_only', dryRun: 'dry_run', copySettings: 'copy_settings', completionFields: 'completion_fields', fielddataFields: 'fielddata_fields', includeSegmentFileSizes: 'include_segment_file_sizes', includeUnloadedSegments: 'include_unloaded_segments', forbidClosedIndices: 'forbid_closed_indices', waitForCompletion: 'wait_for_completion', onlyAncientSegments: 'only_ancient_segments', analyzeWildcard: 'analyze_wildcard', defaultOperator: 'default_operator', allShards: 'all_shards' }
39
-
40
- function IndicesApi (transport, ConfigurationError) {
41
- this.transport = transport
42
- this[kConfigurationError] = ConfigurationError
36
+ const { handleError, snakeCaseKeys, normalizeArguments, kConfigurationError } = require('../utils');
37
+ const acceptedQuerystring = [
38
+ 'cluster_manager_timeout',
39
+ 'timeout',
40
+ 'master_timeout',
41
+ 'ignore_unavailable',
42
+ 'allow_no_indices',
43
+ 'expand_wildcards',
44
+ 'pretty',
45
+ 'human',
46
+ 'error_trace',
47
+ 'source',
48
+ 'filter_path',
49
+ 'index',
50
+ 'fielddata',
51
+ 'fields',
52
+ 'query',
53
+ 'request',
54
+ 'wait_for_active_shards',
55
+ 'run_expensive_tasks',
56
+ 'flush',
57
+ 'local',
58
+ 'flat_settings',
59
+ 'include_defaults',
60
+ 'force',
61
+ 'wait_if_ongoing',
62
+ 'max_num_segments',
63
+ 'only_expunge_deletes',
64
+ 'create',
65
+ 'cause',
66
+ 'write_index_only',
67
+ 'preserve_existing',
68
+ 'order',
69
+ 'detailed',
70
+ 'active_only',
71
+ 'dry_run',
72
+ 'verbose',
73
+ 'status',
74
+ 'copy_settings',
75
+ 'completion_fields',
76
+ 'fielddata_fields',
77
+ 'groups',
78
+ 'level',
79
+ 'types',
80
+ 'include_segment_file_sizes',
81
+ 'include_unloaded_segments',
82
+ 'forbid_closed_indices',
83
+ 'wait_for_completion',
84
+ 'only_ancient_segments',
85
+ 'explain',
86
+ 'q',
87
+ 'analyzer',
88
+ 'analyze_wildcard',
89
+ 'default_operator',
90
+ 'df',
91
+ 'lenient',
92
+ 'rewrite',
93
+ 'all_shards',
94
+ ];
95
+ const snakeCase = {
96
+ clusterManagerTimeout: 'cluster_manager_timeout',
97
+ masterTimeout: 'master_timeout',
98
+ ignoreUnavailable: 'ignore_unavailable',
99
+ allowNoIndices: 'allow_no_indices',
100
+ expandWildcards: 'expand_wildcards',
101
+ errorTrace: 'error_trace',
102
+ filterPath: 'filter_path',
103
+ waitForActiveShards: 'wait_for_active_shards',
104
+ runExpensiveTasks: 'run_expensive_tasks',
105
+ flatSettings: 'flat_settings',
106
+ includeDefaults: 'include_defaults',
107
+ waitIfOngoing: 'wait_if_ongoing',
108
+ maxNumSegments: 'max_num_segments',
109
+ onlyExpungeDeletes: 'only_expunge_deletes',
110
+ writeIndexOnly: 'write_index_only',
111
+ preserveExisting: 'preserve_existing',
112
+ activeOnly: 'active_only',
113
+ dryRun: 'dry_run',
114
+ copySettings: 'copy_settings',
115
+ completionFields: 'completion_fields',
116
+ fielddataFields: 'fielddata_fields',
117
+ includeSegmentFileSizes: 'include_segment_file_sizes',
118
+ includeUnloadedSegments: 'include_unloaded_segments',
119
+ forbidClosedIndices: 'forbid_closed_indices',
120
+ waitForCompletion: 'wait_for_completion',
121
+ onlyAncientSegments: 'only_ancient_segments',
122
+ analyzeWildcard: 'analyze_wildcard',
123
+ defaultOperator: 'default_operator',
124
+ allShards: 'all_shards',
125
+ };
126
+
127
+ function IndicesApi(transport, ConfigurationError) {
128
+ this.transport = transport;
129
+ this[kConfigurationError] = ConfigurationError;
43
130
  }
44
131
 
45
- IndicesApi.prototype.addBlock = function indicesAddBlockApi (params, options, callback) {
46
- ;[params, options, callback] = normalizeArguments(params, options, callback)
132
+ IndicesApi.prototype.addBlock = function indicesAddBlockApi(params, options, callback) {
133
+ [params, options, callback] = normalizeArguments(params, options, callback);
47
134
 
48
135
  // check required parameters
49
136
  if (params.index == null) {
50
- const err = new this[kConfigurationError]('Missing required parameter: index')
51
- return handleError(err, callback)
137
+ const err = new this[kConfigurationError]('Missing required parameter: index');
138
+ return handleError(err, callback);
52
139
  }
53
140
  if (params.block == null) {
54
- const err = new this[kConfigurationError]('Missing required parameter: block')
55
- return handleError(err, callback)
141
+ const err = new this[kConfigurationError]('Missing required parameter: block');
142
+ return handleError(err, callback);
56
143
  }
57
144
 
58
145
  // check required url components
59
- if (params.block != null && (params.index == null)) {
60
- const err = new this[kConfigurationError]('Missing required parameter of the url: index')
61
- return handleError(err, callback)
146
+ if (params.block != null && params.index == null) {
147
+ const err = new this[kConfigurationError]('Missing required parameter of the url: index');
148
+ return handleError(err, callback);
62
149
  }
63
150
 
64
- let { method, body, index, block, ...querystring } = params
65
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
151
+ let { method, body, index, block, ...querystring } = params;
152
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
66
153
 
67
- let path = ''
68
- if (method == null) method = 'PUT'
69
- path = '/' + encodeURIComponent(index) + '/' + '_block' + '/' + encodeURIComponent(block)
154
+ let path = '';
155
+ if (method == null) method = 'PUT';
156
+ path = '/' + encodeURIComponent(index) + '/' + '_block' + '/' + encodeURIComponent(block);
70
157
 
71
158
  // build request object
72
159
  const request = {
73
160
  method,
74
161
  path,
75
162
  body: body || '',
76
- querystring
77
- }
163
+ querystring,
164
+ };
78
165
 
79
- return this.transport.request(request, options, callback)
80
- }
166
+ return this.transport.request(request, options, callback);
167
+ };
81
168
 
82
- IndicesApi.prototype.analyze = function indicesAnalyzeApi (params, options, callback) {
83
- ;[params, options, callback] = normalizeArguments(params, options, callback)
169
+ IndicesApi.prototype.analyze = function indicesAnalyzeApi(params, options, callback) {
170
+ [params, options, callback] = normalizeArguments(params, options, callback);
84
171
 
85
- let { method, body, index, ...querystring } = params
86
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
172
+ let { method, body, index, ...querystring } = params;
173
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
87
174
 
88
- let path = ''
89
- if ((index) != null) {
90
- if (method == null) method = body == null ? 'GET' : 'POST'
91
- path = '/' + encodeURIComponent(index) + '/' + '_analyze'
175
+ let path = '';
176
+ if (index != null) {
177
+ if (method == null) method = body == null ? 'GET' : 'POST';
178
+ path = '/' + encodeURIComponent(index) + '/' + '_analyze';
92
179
  } else {
93
- if (method == null) method = body == null ? 'GET' : 'POST'
94
- path = '/' + '_analyze'
180
+ if (method == null) method = body == null ? 'GET' : 'POST';
181
+ path = '/' + '_analyze';
95
182
  }
96
183
 
97
184
  // build request object
@@ -99,25 +186,25 @@ IndicesApi.prototype.analyze = function indicesAnalyzeApi (params, options, call
99
186
  method,
100
187
  path,
101
188
  body: body || '',
102
- querystring
103
- }
189
+ querystring,
190
+ };
104
191
 
105
- return this.transport.request(request, options, callback)
106
- }
192
+ return this.transport.request(request, options, callback);
193
+ };
107
194
 
108
- IndicesApi.prototype.clearCache = function indicesClearCacheApi (params, options, callback) {
109
- ;[params, options, callback] = normalizeArguments(params, options, callback)
195
+ IndicesApi.prototype.clearCache = function indicesClearCacheApi(params, options, callback) {
196
+ [params, options, callback] = normalizeArguments(params, options, callback);
110
197
 
111
- let { method, body, index, ...querystring } = params
112
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
198
+ let { method, body, index, ...querystring } = params;
199
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
113
200
 
114
- let path = ''
115
- if ((index) != null) {
116
- if (method == null) method = 'POST'
117
- path = '/' + encodeURIComponent(index) + '/' + '_cache' + '/' + 'clear'
201
+ let path = '';
202
+ if (index != null) {
203
+ if (method == null) method = 'POST';
204
+ path = '/' + encodeURIComponent(index) + '/' + '_cache' + '/' + 'clear';
118
205
  } else {
119
- if (method == null) method = 'POST'
120
- path = '/' + '_cache' + '/' + 'clear'
206
+ if (method == null) method = 'POST';
207
+ path = '/' + '_cache' + '/' + 'clear';
121
208
  }
122
209
 
123
210
  // build request object
@@ -125,159 +212,159 @@ IndicesApi.prototype.clearCache = function indicesClearCacheApi (params, options
125
212
  method,
126
213
  path,
127
214
  body: body || '',
128
- querystring
129
- }
215
+ querystring,
216
+ };
130
217
 
131
- return this.transport.request(request, options, callback)
132
- }
218
+ return this.transport.request(request, options, callback);
219
+ };
133
220
 
134
- IndicesApi.prototype.clone = function indicesCloneApi (params, options, callback) {
135
- ;[params, options, callback] = normalizeArguments(params, options, callback)
221
+ IndicesApi.prototype.clone = function indicesCloneApi(params, options, callback) {
222
+ [params, options, callback] = normalizeArguments(params, options, callback);
136
223
 
137
224
  // check required parameters
138
225
  if (params.index == null) {
139
- const err = new this[kConfigurationError]('Missing required parameter: index')
140
- return handleError(err, callback)
226
+ const err = new this[kConfigurationError]('Missing required parameter: index');
227
+ return handleError(err, callback);
141
228
  }
142
229
  if (params.target == null) {
143
- const err = new this[kConfigurationError]('Missing required parameter: target')
144
- return handleError(err, callback)
230
+ const err = new this[kConfigurationError]('Missing required parameter: target');
231
+ return handleError(err, callback);
145
232
  }
146
233
 
147
234
  // check required url components
148
- if (params.target != null && (params.index == null)) {
149
- const err = new this[kConfigurationError]('Missing required parameter of the url: index')
150
- return handleError(err, callback)
235
+ if (params.target != null && params.index == null) {
236
+ const err = new this[kConfigurationError]('Missing required parameter of the url: index');
237
+ return handleError(err, callback);
151
238
  }
152
239
 
153
- let { method, body, index, target, ...querystring } = params
154
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
240
+ let { method, body, index, target, ...querystring } = params;
241
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
155
242
 
156
- let path = ''
157
- if (method == null) method = 'PUT'
158
- path = '/' + encodeURIComponent(index) + '/' + '_clone' + '/' + encodeURIComponent(target)
243
+ let path = '';
244
+ if (method == null) method = 'PUT';
245
+ path = '/' + encodeURIComponent(index) + '/' + '_clone' + '/' + encodeURIComponent(target);
159
246
 
160
247
  // build request object
161
248
  const request = {
162
249
  method,
163
250
  path,
164
251
  body: body || '',
165
- querystring
166
- }
252
+ querystring,
253
+ };
167
254
 
168
- return this.transport.request(request, options, callback)
169
- }
255
+ return this.transport.request(request, options, callback);
256
+ };
170
257
 
171
- IndicesApi.prototype.close = function indicesCloseApi (params, options, callback) {
172
- ;[params, options, callback] = normalizeArguments(params, options, callback)
258
+ IndicesApi.prototype.close = function indicesCloseApi(params, options, callback) {
259
+ [params, options, callback] = normalizeArguments(params, options, callback);
173
260
 
174
261
  // check required parameters
175
262
  if (params.index == null) {
176
- const err = new this[kConfigurationError]('Missing required parameter: index')
177
- return handleError(err, callback)
263
+ const err = new this[kConfigurationError]('Missing required parameter: index');
264
+ return handleError(err, callback);
178
265
  }
179
266
 
180
- let { method, body, index, ...querystring } = params
181
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
267
+ let { method, body, index, ...querystring } = params;
268
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
182
269
 
183
- let path = ''
184
- if (method == null) method = 'POST'
185
- path = '/' + encodeURIComponent(index) + '/' + '_close'
270
+ let path = '';
271
+ if (method == null) method = 'POST';
272
+ path = '/' + encodeURIComponent(index) + '/' + '_close';
186
273
 
187
274
  // build request object
188
275
  const request = {
189
276
  method,
190
277
  path,
191
278
  body: body || '',
192
- querystring
193
- }
279
+ querystring,
280
+ };
194
281
 
195
- return this.transport.request(request, options, callback)
196
- }
282
+ return this.transport.request(request, options, callback);
283
+ };
197
284
 
198
- IndicesApi.prototype.create = function indicesCreateApi (params, options, callback) {
199
- ;[params, options, callback] = normalizeArguments(params, options, callback)
285
+ IndicesApi.prototype.create = function indicesCreateApi(params, options, callback) {
286
+ [params, options, callback] = normalizeArguments(params, options, callback);
200
287
 
201
288
  // check required parameters
202
289
  if (params.index == null) {
203
- const err = new this[kConfigurationError]('Missing required parameter: index')
204
- return handleError(err, callback)
290
+ const err = new this[kConfigurationError]('Missing required parameter: index');
291
+ return handleError(err, callback);
205
292
  }
206
293
 
207
- let { method, body, index, ...querystring } = params
208
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
294
+ let { method, body, index, ...querystring } = params;
295
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
209
296
 
210
- let path = ''
211
- if (method == null) method = 'PUT'
212
- path = '/' + encodeURIComponent(index)
297
+ let path = '';
298
+ if (method == null) method = 'PUT';
299
+ path = '/' + encodeURIComponent(index);
213
300
 
214
301
  // build request object
215
302
  const request = {
216
303
  method,
217
304
  path,
218
305
  body: body || '',
219
- querystring
220
- }
306
+ querystring,
307
+ };
221
308
 
222
- return this.transport.request(request, options, callback)
223
- }
309
+ return this.transport.request(request, options, callback);
310
+ };
224
311
 
225
- IndicesApi.prototype.delete = function indicesDeleteApi (params, options, callback) {
226
- ;[params, options, callback] = normalizeArguments(params, options, callback)
312
+ IndicesApi.prototype.delete = function indicesDeleteApi(params, options, callback) {
313
+ [params, options, callback] = normalizeArguments(params, options, callback);
227
314
 
228
315
  // check required parameters
229
316
  if (params.index == null) {
230
- const err = new this[kConfigurationError]('Missing required parameter: index')
231
- return handleError(err, callback)
317
+ const err = new this[kConfigurationError]('Missing required parameter: index');
318
+ return handleError(err, callback);
232
319
  }
233
320
 
234
- let { method, body, index, ...querystring } = params
235
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
321
+ let { method, body, index, ...querystring } = params;
322
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
236
323
 
237
- let path = ''
238
- if (method == null) method = 'DELETE'
239
- path = '/' + encodeURIComponent(index)
324
+ let path = '';
325
+ if (method == null) method = 'DELETE';
326
+ path = '/' + encodeURIComponent(index);
240
327
 
241
328
  // build request object
242
329
  const request = {
243
330
  method,
244
331
  path,
245
332
  body: body || '',
246
- querystring
247
- }
333
+ querystring,
334
+ };
248
335
 
249
- return this.transport.request(request, options, callback)
250
- }
336
+ return this.transport.request(request, options, callback);
337
+ };
251
338
 
252
- IndicesApi.prototype.deleteAlias = function indicesDeleteAliasApi (params, options, callback) {
253
- ;[params, options, callback] = normalizeArguments(params, options, callback)
339
+ IndicesApi.prototype.deleteAlias = function indicesDeleteAliasApi(params, options, callback) {
340
+ [params, options, callback] = normalizeArguments(params, options, callback);
254
341
 
255
342
  // check required parameters
256
343
  if (params.index == null) {
257
- const err = new this[kConfigurationError]('Missing required parameter: index')
258
- return handleError(err, callback)
344
+ const err = new this[kConfigurationError]('Missing required parameter: index');
345
+ return handleError(err, callback);
259
346
  }
260
347
  if (params.name == null) {
261
- const err = new this[kConfigurationError]('Missing required parameter: name')
262
- return handleError(err, callback)
348
+ const err = new this[kConfigurationError]('Missing required parameter: name');
349
+ return handleError(err, callback);
263
350
  }
264
351
 
265
352
  // check required url components
266
- if (params.name != null && (params.index == null)) {
267
- const err = new this[kConfigurationError]('Missing required parameter of the url: index')
268
- return handleError(err, callback)
353
+ if (params.name != null && params.index == null) {
354
+ const err = new this[kConfigurationError]('Missing required parameter of the url: index');
355
+ return handleError(err, callback);
269
356
  }
270
357
 
271
- let { method, body, index, name, ...querystring } = params
272
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
358
+ let { method, body, index, name, ...querystring } = params;
359
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
273
360
 
274
- let path = ''
275
- if ((index) != null && (name) != null) {
276
- if (method == null) method = 'DELETE'
277
- path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
361
+ let path = '';
362
+ if (index != null && name != null) {
363
+ if (method == null) method = 'DELETE';
364
+ path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name);
278
365
  } else {
279
- if (method == null) method = 'DELETE'
280
- path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
366
+ if (method == null) method = 'DELETE';
367
+ path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name);
281
368
  }
282
369
 
283
370
  // build request object
@@ -285,139 +372,143 @@ IndicesApi.prototype.deleteAlias = function indicesDeleteAliasApi (params, optio
285
372
  method,
286
373
  path,
287
374
  body: body || '',
288
- querystring
289
- }
375
+ querystring,
376
+ };
290
377
 
291
- return this.transport.request(request, options, callback)
292
- }
378
+ return this.transport.request(request, options, callback);
379
+ };
293
380
 
294
- IndicesApi.prototype.deleteIndexTemplate = function indicesDeleteIndexTemplateApi (params, options, callback) {
295
- ;[params, options, callback] = normalizeArguments(params, options, callback)
381
+ IndicesApi.prototype.deleteIndexTemplate = function indicesDeleteIndexTemplateApi(
382
+ params,
383
+ options,
384
+ callback
385
+ ) {
386
+ [params, options, callback] = normalizeArguments(params, options, callback);
296
387
 
297
388
  // check required parameters
298
389
  if (params.name == null) {
299
- const err = new this[kConfigurationError]('Missing required parameter: name')
300
- return handleError(err, callback)
390
+ const err = new this[kConfigurationError]('Missing required parameter: name');
391
+ return handleError(err, callback);
301
392
  }
302
393
 
303
- let { method, body, name, ...querystring } = params
304
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
394
+ let { method, body, name, ...querystring } = params;
395
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
305
396
 
306
- let path = ''
307
- if (method == null) method = 'DELETE'
308
- path = '/' + '_index_template' + '/' + encodeURIComponent(name)
397
+ let path = '';
398
+ if (method == null) method = 'DELETE';
399
+ path = '/' + '_index_template' + '/' + encodeURIComponent(name);
309
400
 
310
401
  // build request object
311
402
  const request = {
312
403
  method,
313
404
  path,
314
405
  body: body || '',
315
- querystring
316
- }
406
+ querystring,
407
+ };
317
408
 
318
- return this.transport.request(request, options, callback)
319
- }
409
+ return this.transport.request(request, options, callback);
410
+ };
320
411
 
321
- IndicesApi.prototype.deleteTemplate = function indicesDeleteTemplateApi (params, options, callback) {
322
- ;[params, options, callback] = normalizeArguments(params, options, callback)
412
+ IndicesApi.prototype.deleteTemplate = function indicesDeleteTemplateApi(params, options, callback) {
413
+ [params, options, callback] = normalizeArguments(params, options, callback);
323
414
 
324
415
  // check required parameters
325
416
  if (params.name == null) {
326
- const err = new this[kConfigurationError]('Missing required parameter: name')
327
- return handleError(err, callback)
417
+ const err = new this[kConfigurationError]('Missing required parameter: name');
418
+ return handleError(err, callback);
328
419
  }
329
420
 
330
- let { method, body, name, ...querystring } = params
331
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
421
+ let { method, body, name, ...querystring } = params;
422
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
332
423
 
333
- let path = ''
334
- if (method == null) method = 'DELETE'
335
- path = '/' + '_template' + '/' + encodeURIComponent(name)
424
+ let path = '';
425
+ if (method == null) method = 'DELETE';
426
+ path = '/' + '_template' + '/' + encodeURIComponent(name);
336
427
 
337
428
  // build request object
338
429
  const request = {
339
430
  method,
340
431
  path,
341
432
  body: body || '',
342
- querystring
343
- }
433
+ querystring,
434
+ };
344
435
 
345
- return this.transport.request(request, options, callback)
346
- }
436
+ return this.transport.request(request, options, callback);
437
+ };
347
438
 
348
- IndicesApi.prototype.diskUsage = function indicesDiskUsageApi (params, options, callback) {
349
- ;[params, options, callback] = normalizeArguments(params, options, callback)
439
+ IndicesApi.prototype.diskUsage = function indicesDiskUsageApi(params, options, callback) {
440
+ [params, options, callback] = normalizeArguments(params, options, callback);
350
441
 
351
442
  // check required parameters
352
443
  if (params.index == null) {
353
- const err = new this[kConfigurationError]('Missing required parameter: index')
354
- return handleError(err, callback)
444
+ const err = new this[kConfigurationError]('Missing required parameter: index');
445
+ return handleError(err, callback);
355
446
  }
356
447
 
357
- let { method, body, index, ...querystring } = params
358
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
448
+ let { method, body, index, ...querystring } = params;
449
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
359
450
 
360
- let path = ''
361
- if (method == null) method = 'POST'
362
- path = '/' + encodeURIComponent(index) + '/' + '_disk_usage'
451
+ let path = '';
452
+ if (method == null) method = 'POST';
453
+ path = '/' + encodeURIComponent(index) + '/' + '_disk_usage';
363
454
 
364
455
  // build request object
365
456
  const request = {
366
457
  method,
367
458
  path,
368
459
  body: body || '',
369
- querystring
370
- }
460
+ querystring,
461
+ };
371
462
 
372
- return this.transport.request(request, options, callback)
373
- }
463
+ return this.transport.request(request, options, callback);
464
+ };
374
465
 
375
- IndicesApi.prototype.exists = function indicesExistsApi (params, options, callback) {
376
- ;[params, options, callback] = normalizeArguments(params, options, callback)
466
+ IndicesApi.prototype.exists = function indicesExistsApi(params, options, callback) {
467
+ [params, options, callback] = normalizeArguments(params, options, callback);
377
468
 
378
469
  // check required parameters
379
470
  if (params.index == null) {
380
- const err = new this[kConfigurationError]('Missing required parameter: index')
381
- return handleError(err, callback)
471
+ const err = new this[kConfigurationError]('Missing required parameter: index');
472
+ return handleError(err, callback);
382
473
  }
383
474
 
384
- let { method, body, index, ...querystring } = params
385
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
475
+ let { method, body, index, ...querystring } = params;
476
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
386
477
 
387
- let path = ''
388
- if (method == null) method = 'HEAD'
389
- path = '/' + encodeURIComponent(index)
478
+ let path = '';
479
+ if (method == null) method = 'HEAD';
480
+ path = '/' + encodeURIComponent(index);
390
481
 
391
482
  // build request object
392
483
  const request = {
393
484
  method,
394
485
  path,
395
486
  body: null,
396
- querystring
397
- }
487
+ querystring,
488
+ };
398
489
 
399
- return this.transport.request(request, options, callback)
400
- }
490
+ return this.transport.request(request, options, callback);
491
+ };
401
492
 
402
- IndicesApi.prototype.existsAlias = function indicesExistsAliasApi (params, options, callback) {
403
- ;[params, options, callback] = normalizeArguments(params, options, callback)
493
+ IndicesApi.prototype.existsAlias = function indicesExistsAliasApi(params, options, callback) {
494
+ [params, options, callback] = normalizeArguments(params, options, callback);
404
495
 
405
496
  // check required parameters
406
497
  if (params.name == null) {
407
- const err = new this[kConfigurationError]('Missing required parameter: name')
408
- return handleError(err, callback)
498
+ const err = new this[kConfigurationError]('Missing required parameter: name');
499
+ return handleError(err, callback);
409
500
  }
410
501
 
411
- let { method, body, name, index, ...querystring } = params
412
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
502
+ let { method, body, name, index, ...querystring } = params;
503
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
413
504
 
414
- let path = ''
415
- if ((index) != null && (name) != null) {
416
- if (method == null) method = 'HEAD'
417
- path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
505
+ let path = '';
506
+ if (index != null && name != null) {
507
+ if (method == null) method = 'HEAD';
508
+ path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name);
418
509
  } else {
419
- if (method == null) method = 'HEAD'
420
- path = '/' + '_alias' + '/' + encodeURIComponent(name)
510
+ if (method == null) method = 'HEAD';
511
+ path = '/' + '_alias' + '/' + encodeURIComponent(name);
421
512
  }
422
513
 
423
514
  // build request object
@@ -425,143 +516,114 @@ IndicesApi.prototype.existsAlias = function indicesExistsAliasApi (params, optio
425
516
  method,
426
517
  path,
427
518
  body: null,
428
- querystring
429
- }
519
+ querystring,
520
+ };
430
521
 
431
- return this.transport.request(request, options, callback)
432
- }
522
+ return this.transport.request(request, options, callback);
523
+ };
433
524
 
434
- IndicesApi.prototype.existsIndexTemplate = function indicesExistsIndexTemplateApi (params, options, callback) {
435
- ;[params, options, callback] = normalizeArguments(params, options, callback)
525
+ IndicesApi.prototype.existsIndexTemplate = function indicesExistsIndexTemplateApi(
526
+ params,
527
+ options,
528
+ callback
529
+ ) {
530
+ [params, options, callback] = normalizeArguments(params, options, callback);
436
531
 
437
532
  // check required parameters
438
533
  if (params.name == null) {
439
- const err = new this[kConfigurationError]('Missing required parameter: name')
440
- return handleError(err, callback)
534
+ const err = new this[kConfigurationError]('Missing required parameter: name');
535
+ return handleError(err, callback);
441
536
  }
442
537
 
443
- let { method, body, name, ...querystring } = params
444
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
538
+ let { method, body, name, ...querystring } = params;
539
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
445
540
 
446
- let path = ''
447
- if (method == null) method = 'HEAD'
448
- path = '/' + '_index_template' + '/' + encodeURIComponent(name)
541
+ let path = '';
542
+ if (method == null) method = 'HEAD';
543
+ path = '/' + '_index_template' + '/' + encodeURIComponent(name);
449
544
 
450
545
  // build request object
451
546
  const request = {
452
547
  method,
453
548
  path,
454
549
  body: null,
455
- querystring
456
- }
550
+ querystring,
551
+ };
457
552
 
458
- return this.transport.request(request, options, callback)
459
- }
553
+ return this.transport.request(request, options, callback);
554
+ };
460
555
 
461
- IndicesApi.prototype.existsTemplate = function indicesExistsTemplateApi (params, options, callback) {
462
- ;[params, options, callback] = normalizeArguments(params, options, callback)
556
+ IndicesApi.prototype.existsTemplate = function indicesExistsTemplateApi(params, options, callback) {
557
+ [params, options, callback] = normalizeArguments(params, options, callback);
463
558
 
464
559
  // check required parameters
465
560
  if (params.name == null) {
466
- const err = new this[kConfigurationError]('Missing required parameter: name')
467
- return handleError(err, callback)
468
- }
469
-
470
- let { method, body, name, ...querystring } = params
471
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
472
-
473
- let path = ''
474
- if (method == null) method = 'HEAD'
475
- path = '/' + '_template' + '/' + encodeURIComponent(name)
476
-
477
- // build request object
478
- const request = {
479
- method,
480
- path,
481
- body: null,
482
- querystring
561
+ const err = new this[kConfigurationError]('Missing required parameter: name');
562
+ return handleError(err, callback);
483
563
  }
484
564
 
485
- return this.transport.request(request, options, callback)
486
- }
487
-
488
- IndicesApi.prototype.existsType = function indicesExistsTypeApi (params, options, callback) {
489
- ;[params, options, callback] = normalizeArguments(params, options, callback)
490
-
491
- // check required parameters
492
- if (params.index == null) {
493
- const err = new this[kConfigurationError]('Missing required parameter: index')
494
- return handleError(err, callback)
495
- }
496
- if (params.type == null) {
497
- const err = new this[kConfigurationError]('Missing required parameter: type')
498
- return handleError(err, callback)
499
- }
565
+ let { method, body, name, ...querystring } = params;
566
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
500
567
 
501
- // check required url components
502
- if (params.type != null && (params.index == null)) {
503
- const err = new this[kConfigurationError]('Missing required parameter of the url: index')
504
- return handleError(err, callback)
505
- }
506
-
507
- let { method, body, index, type, ...querystring } = params
508
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
509
-
510
- let path = ''
511
- if (method == null) method = 'HEAD'
512
- path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
568
+ let path = '';
569
+ if (method == null) method = 'HEAD';
570
+ path = '/' + '_template' + '/' + encodeURIComponent(name);
513
571
 
514
572
  // build request object
515
573
  const request = {
516
574
  method,
517
575
  path,
518
576
  body: null,
519
- querystring
520
- }
577
+ querystring,
578
+ };
521
579
 
522
- return this.transport.request(request, options, callback)
523
- }
580
+ return this.transport.request(request, options, callback);
581
+ };
524
582
 
525
- IndicesApi.prototype.fieldUsageStats = function indicesFieldUsageStatsApi (params, options, callback) {
526
- ;[params, options, callback] = normalizeArguments(params, options, callback)
583
+ IndicesApi.prototype.fieldUsageStats = function indicesFieldUsageStatsApi(
584
+ params,
585
+ options,
586
+ callback
587
+ ) {
588
+ [params, options, callback] = normalizeArguments(params, options, callback);
527
589
 
528
590
  // check required parameters
529
591
  if (params.index == null) {
530
- const err = new this[kConfigurationError]('Missing required parameter: index')
531
- return handleError(err, callback)
592
+ const err = new this[kConfigurationError]('Missing required parameter: index');
593
+ return handleError(err, callback);
532
594
  }
533
595
 
534
- let { method, body, index, ...querystring } = params
535
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
596
+ let { method, body, index, ...querystring } = params;
597
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
536
598
 
537
- let path = ''
538
- if (method == null) method = 'GET'
539
- path = '/' + encodeURIComponent(index) + '/' + '_field_usage_stats'
599
+ let path = '';
600
+ if (method == null) method = 'GET';
601
+ path = '/' + encodeURIComponent(index) + '/' + '_field_usage_stats';
540
602
 
541
603
  // build request object
542
604
  const request = {
543
605
  method,
544
606
  path,
545
607
  body: null,
546
- querystring
547
- }
608
+ querystring,
609
+ };
548
610
 
549
- return this.transport.request(request, options, callback)
550
- }
611
+ return this.transport.request(request, options, callback);
612
+ };
551
613
 
552
- IndicesApi.prototype.flush = function indicesFlushApi (params, options, callback) {
553
- ;[params, options, callback] = normalizeArguments(params, options, callback)
614
+ IndicesApi.prototype.flush = function indicesFlushApi(params, options, callback) {
615
+ [params, options, callback] = normalizeArguments(params, options, callback);
554
616
 
555
- let { method, body, index, ...querystring } = params
556
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
617
+ let { method, body, index, ...querystring } = params;
618
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
557
619
 
558
- let path = ''
559
- if ((index) != null) {
560
- if (method == null) method = body == null ? 'GET' : 'POST'
561
- path = '/' + encodeURIComponent(index) + '/' + '_flush'
620
+ let path = '';
621
+ if (index != null) {
622
+ if (method == null) method = body == null ? 'GET' : 'POST';
623
+ path = '/' + encodeURIComponent(index) + '/' + '_flush';
562
624
  } else {
563
- if (method == null) method = body == null ? 'GET' : 'POST'
564
- path = '/' + '_flush'
625
+ if (method == null) method = body == null ? 'GET' : 'POST';
626
+ path = '/' + '_flush';
565
627
  }
566
628
 
567
629
  // build request object
@@ -569,46 +631,25 @@ IndicesApi.prototype.flush = function indicesFlushApi (params, options, callback
569
631
  method,
570
632
  path,
571
633
  body: body || '',
572
- querystring
573
- }
574
-
575
- return this.transport.request(request, options, callback)
576
- }
634
+ querystring,
635
+ };
577
636
 
578
- IndicesApi.prototype.flushSynced = function indicesFlushSyncedApi (params, options, callback) {
579
- ;[params, options, callback] = normalizeArguments(params, options, callback)
637
+ return this.transport.request(request, options, callback);
638
+ };
580
639
 
581
- let { method, body, index, ...querystring } = params
582
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
640
+ IndicesApi.prototype.forcemerge = function indicesForcemergeApi(params, options, callback) {
641
+ [params, options, callback] = normalizeArguments(params, options, callback);
583
642
 
584
- let path = ''
585
- if (method == null) method = body == null ? 'GET' : 'POST'
586
- path = '/' + encodeURIComponent(index) + '/' + '_flush' + '/' + 'synced'
643
+ let { method, body, index, ...querystring } = params;
644
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
587
645
 
588
- // build request object
589
- const request = {
590
- method,
591
- path,
592
- body: body || '',
593
- querystring
594
- }
595
-
596
- return this.transport.request(request, options, callback)
597
- }
598
-
599
- IndicesApi.prototype.forcemerge = function indicesForcemergeApi (params, options, callback) {
600
- ;[params, options, callback] = normalizeArguments(params, options, callback)
601
-
602
- let { method, body, index, ...querystring } = params
603
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
604
-
605
- let path = ''
606
- if ((index) != null) {
607
- if (method == null) method = 'POST'
608
- path = '/' + encodeURIComponent(index) + '/' + '_forcemerge'
646
+ let path = '';
647
+ if (index != null) {
648
+ if (method == null) method = 'POST';
649
+ path = '/' + encodeURIComponent(index) + '/' + '_forcemerge';
609
650
  } else {
610
- if (method == null) method = 'POST'
611
- path = '/' + '_forcemerge'
651
+ if (method == null) method = 'POST';
652
+ path = '/' + '_forcemerge';
612
653
  }
613
654
 
614
655
  // build request object
@@ -616,58 +657,58 @@ IndicesApi.prototype.forcemerge = function indicesForcemergeApi (params, options
616
657
  method,
617
658
  path,
618
659
  body: body || '',
619
- querystring
620
- }
660
+ querystring,
661
+ };
621
662
 
622
- return this.transport.request(request, options, callback)
623
- }
663
+ return this.transport.request(request, options, callback);
664
+ };
624
665
 
625
- IndicesApi.prototype.get = function indicesGetApi (params, options, callback) {
626
- ;[params, options, callback] = normalizeArguments(params, options, callback)
666
+ IndicesApi.prototype.get = function indicesGetApi(params, options, callback) {
667
+ [params, options, callback] = normalizeArguments(params, options, callback);
627
668
 
628
669
  // check required parameters
629
670
  if (params.index == null) {
630
- const err = new this[kConfigurationError]('Missing required parameter: index')
631
- return handleError(err, callback)
671
+ const err = new this[kConfigurationError]('Missing required parameter: index');
672
+ return handleError(err, callback);
632
673
  }
633
674
 
634
- let { method, body, index, ...querystring } = params
635
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
675
+ let { method, body, index, ...querystring } = params;
676
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
636
677
 
637
- let path = ''
638
- if (method == null) method = 'GET'
639
- path = '/' + encodeURIComponent(index)
678
+ let path = '';
679
+ if (method == null) method = 'GET';
680
+ path = '/' + encodeURIComponent(index);
640
681
 
641
682
  // build request object
642
683
  const request = {
643
684
  method,
644
685
  path,
645
686
  body: null,
646
- querystring
647
- }
648
-
649
- return this.transport.request(request, options, callback)
650
- }
651
-
652
- IndicesApi.prototype.getAlias = function indicesGetAliasApi (params, options, callback) {
653
- ;[params, options, callback] = normalizeArguments(params, options, callback)
654
-
655
- let { method, body, name, index, ...querystring } = params
656
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
657
-
658
- let path = ''
659
- if ((index) != null && (name) != null) {
660
- if (method == null) method = 'GET'
661
- path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
662
- } else if ((name) != null) {
663
- if (method == null) method = 'GET'
664
- path = '/' + '_alias' + '/' + encodeURIComponent(name)
665
- } else if ((index) != null) {
666
- if (method == null) method = 'GET'
667
- path = '/' + encodeURIComponent(index) + '/' + '_alias'
687
+ querystring,
688
+ };
689
+
690
+ return this.transport.request(request, options, callback);
691
+ };
692
+
693
+ IndicesApi.prototype.getAlias = function indicesGetAliasApi(params, options, callback) {
694
+ [params, options, callback] = normalizeArguments(params, options, callback);
695
+
696
+ let { method, body, name, index, ...querystring } = params;
697
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
698
+
699
+ let path = '';
700
+ if (index != null && name != null) {
701
+ if (method == null) method = 'GET';
702
+ path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name);
703
+ } else if (name != null) {
704
+ if (method == null) method = 'GET';
705
+ path = '/' + '_alias' + '/' + encodeURIComponent(name);
706
+ } else if (index != null) {
707
+ if (method == null) method = 'GET';
708
+ path = '/' + encodeURIComponent(index) + '/' + '_alias';
668
709
  } else {
669
- if (method == null) method = 'GET'
670
- path = '/' + '_alias'
710
+ if (method == null) method = 'GET';
711
+ path = '/' + '_alias';
671
712
  }
672
713
 
673
714
  // build request object
@@ -675,37 +716,67 @@ IndicesApi.prototype.getAlias = function indicesGetAliasApi (params, options, ca
675
716
  method,
676
717
  path,
677
718
  body: null,
678
- querystring
679
- }
719
+ querystring,
720
+ };
680
721
 
681
- return this.transport.request(request, options, callback)
682
- }
722
+ return this.transport.request(request, options, callback);
723
+ };
683
724
 
684
- IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi (params, options, callback) {
685
- ;[params, options, callback] = normalizeArguments(params, options, callback)
725
+ IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi(
726
+ params,
727
+ options,
728
+ callback
729
+ ) {
730
+ [params, options, callback] = normalizeArguments(params, options, callback);
686
731
 
687
732
  // check required parameters
688
733
  if (params.fields == null) {
689
- const err = new this[kConfigurationError]('Missing required parameter: fields')
690
- return handleError(err, callback)
691
- }
692
-
693
- let { method, body, fields, index, type, ...querystring } = params
694
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
695
-
696
- let path = ''
697
- if ((index) != null && (type) != null && (fields) != null) {
698
- if (method == null) method = 'GET'
699
- path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields)
700
- } else if ((index) != null && (fields) != null) {
701
- if (method == null) method = 'GET'
702
- path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields)
703
- } else if ((type) != null && (fields) != null) {
704
- if (method == null) method = 'GET'
705
- path = '/' + '_mapping' + '/' + encodeURIComponent(type) + '/' + 'field' + '/' + encodeURIComponent(fields)
734
+ const err = new this[kConfigurationError]('Missing required parameter: fields');
735
+ return handleError(err, callback);
736
+ }
737
+
738
+ let { method, body, fields, index, type, ...querystring } = params;
739
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
740
+
741
+ let path = '';
742
+ if (index != null && type != null && fields != null) {
743
+ if (method == null) method = 'GET';
744
+ path =
745
+ '/' +
746
+ encodeURIComponent(index) +
747
+ '/' +
748
+ '_mapping' +
749
+ '/' +
750
+ encodeURIComponent(type) +
751
+ '/' +
752
+ 'field' +
753
+ '/' +
754
+ encodeURIComponent(fields);
755
+ } else if (index != null && fields != null) {
756
+ if (method == null) method = 'GET';
757
+ path =
758
+ '/' +
759
+ encodeURIComponent(index) +
760
+ '/' +
761
+ '_mapping' +
762
+ '/' +
763
+ 'field' +
764
+ '/' +
765
+ encodeURIComponent(fields);
766
+ } else if (type != null && fields != null) {
767
+ if (method == null) method = 'GET';
768
+ path =
769
+ '/' +
770
+ '_mapping' +
771
+ '/' +
772
+ encodeURIComponent(type) +
773
+ '/' +
774
+ 'field' +
775
+ '/' +
776
+ encodeURIComponent(fields);
706
777
  } else {
707
- if (method == null) method = 'GET'
708
- path = '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields)
778
+ if (method == null) method = 'GET';
779
+ path = '/' + '_mapping' + '/' + 'field' + '/' + encodeURIComponent(fields);
709
780
  }
710
781
 
711
782
  // build request object
@@ -713,25 +784,29 @@ IndicesApi.prototype.getFieldMapping = function indicesGetFieldMappingApi (param
713
784
  method,
714
785
  path,
715
786
  body: null,
716
- querystring
717
- }
718
-
719
- return this.transport.request(request, options, callback)
720
- }
721
-
722
- IndicesApi.prototype.getIndexTemplate = function indicesGetIndexTemplateApi (params, options, callback) {
723
- ;[params, options, callback] = normalizeArguments(params, options, callback)
724
-
725
- let { method, body, name, ...querystring } = params
726
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
727
-
728
- let path = ''
729
- if ((name) != null) {
730
- if (method == null) method = 'GET'
731
- path = '/' + '_index_template' + '/' + encodeURIComponent(name)
787
+ querystring,
788
+ };
789
+
790
+ return this.transport.request(request, options, callback);
791
+ };
792
+
793
+ IndicesApi.prototype.getIndexTemplate = function indicesGetIndexTemplateApi(
794
+ params,
795
+ options,
796
+ callback
797
+ ) {
798
+ [params, options, callback] = normalizeArguments(params, options, callback);
799
+
800
+ let { method, body, name, ...querystring } = params;
801
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
802
+
803
+ let path = '';
804
+ if (name != null) {
805
+ if (method == null) method = 'GET';
806
+ path = '/' + '_index_template' + '/' + encodeURIComponent(name);
732
807
  } else {
733
- if (method == null) method = 'GET'
734
- path = '/' + '_index_template'
808
+ if (method == null) method = 'GET';
809
+ path = '/' + '_index_template';
735
810
  }
736
811
 
737
812
  // build request object
@@ -739,31 +814,31 @@ IndicesApi.prototype.getIndexTemplate = function indicesGetIndexTemplateApi (par
739
814
  method,
740
815
  path,
741
816
  body: null,
742
- querystring
743
- }
744
-
745
- return this.transport.request(request, options, callback)
746
- }
747
-
748
- IndicesApi.prototype.getMapping = function indicesGetMappingApi (params, options, callback) {
749
- ;[params, options, callback] = normalizeArguments(params, options, callback)
750
-
751
- let { method, body, index, type, ...querystring } = params
752
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
753
-
754
- let path = ''
755
- if ((index) != null && (type) != null) {
756
- if (method == null) method = 'GET'
757
- path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
758
- } else if ((index) != null) {
759
- if (method == null) method = 'GET'
760
- path = '/' + encodeURIComponent(index) + '/' + '_mapping'
761
- } else if ((type) != null) {
762
- if (method == null) method = 'GET'
763
- path = '/' + '_mapping' + '/' + encodeURIComponent(type)
817
+ querystring,
818
+ };
819
+
820
+ return this.transport.request(request, options, callback);
821
+ };
822
+
823
+ IndicesApi.prototype.getMapping = function indicesGetMappingApi(params, options, callback) {
824
+ [params, options, callback] = normalizeArguments(params, options, callback);
825
+
826
+ let { method, body, index, type, ...querystring } = params;
827
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
828
+
829
+ let path = '';
830
+ if (index != null && type != null) {
831
+ if (method == null) method = 'GET';
832
+ path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type);
833
+ } else if (index != null) {
834
+ if (method == null) method = 'GET';
835
+ path = '/' + encodeURIComponent(index) + '/' + '_mapping';
836
+ } else if (type != null) {
837
+ if (method == null) method = 'GET';
838
+ path = '/' + '_mapping' + '/' + encodeURIComponent(type);
764
839
  } else {
765
- if (method == null) method = 'GET'
766
- path = '/' + '_mapping'
840
+ if (method == null) method = 'GET';
841
+ path = '/' + '_mapping';
767
842
  }
768
843
 
769
844
  // build request object
@@ -771,31 +846,31 @@ IndicesApi.prototype.getMapping = function indicesGetMappingApi (params, options
771
846
  method,
772
847
  path,
773
848
  body: null,
774
- querystring
775
- }
776
-
777
- return this.transport.request(request, options, callback)
778
- }
779
-
780
- IndicesApi.prototype.getSettings = function indicesGetSettingsApi (params, options, callback) {
781
- ;[params, options, callback] = normalizeArguments(params, options, callback)
782
-
783
- let { method, body, index, name, ...querystring } = params
784
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
785
-
786
- let path = ''
787
- if ((index) != null && (name) != null) {
788
- if (method == null) method = 'GET'
789
- path = '/' + encodeURIComponent(index) + '/' + '_settings' + '/' + encodeURIComponent(name)
790
- } else if ((index) != null) {
791
- if (method == null) method = 'GET'
792
- path = '/' + encodeURIComponent(index) + '/' + '_settings'
793
- } else if ((name) != null) {
794
- if (method == null) method = 'GET'
795
- path = '/' + '_settings' + '/' + encodeURIComponent(name)
849
+ querystring,
850
+ };
851
+
852
+ return this.transport.request(request, options, callback);
853
+ };
854
+
855
+ IndicesApi.prototype.getSettings = function indicesGetSettingsApi(params, options, callback) {
856
+ [params, options, callback] = normalizeArguments(params, options, callback);
857
+
858
+ let { method, body, index, name, ...querystring } = params;
859
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
860
+
861
+ let path = '';
862
+ if (index != null && name != null) {
863
+ if (method == null) method = 'GET';
864
+ path = '/' + encodeURIComponent(index) + '/' + '_settings' + '/' + encodeURIComponent(name);
865
+ } else if (index != null) {
866
+ if (method == null) method = 'GET';
867
+ path = '/' + encodeURIComponent(index) + '/' + '_settings';
868
+ } else if (name != null) {
869
+ if (method == null) method = 'GET';
870
+ path = '/' + '_settings' + '/' + encodeURIComponent(name);
796
871
  } else {
797
- if (method == null) method = 'GET'
798
- path = '/' + '_settings'
872
+ if (method == null) method = 'GET';
873
+ path = '/' + '_settings';
799
874
  }
800
875
 
801
876
  // build request object
@@ -803,25 +878,25 @@ IndicesApi.prototype.getSettings = function indicesGetSettingsApi (params, optio
803
878
  method,
804
879
  path,
805
880
  body: null,
806
- querystring
807
- }
881
+ querystring,
882
+ };
808
883
 
809
- return this.transport.request(request, options, callback)
810
- }
884
+ return this.transport.request(request, options, callback);
885
+ };
811
886
 
812
- IndicesApi.prototype.getTemplate = function indicesGetTemplateApi (params, options, callback) {
813
- ;[params, options, callback] = normalizeArguments(params, options, callback)
887
+ IndicesApi.prototype.getTemplate = function indicesGetTemplateApi(params, options, callback) {
888
+ [params, options, callback] = normalizeArguments(params, options, callback);
814
889
 
815
- let { method, body, name, ...querystring } = params
816
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
890
+ let { method, body, name, ...querystring } = params;
891
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
817
892
 
818
- let path = ''
819
- if ((name) != null) {
820
- if (method == null) method = 'GET'
821
- path = '/' + '_template' + '/' + encodeURIComponent(name)
893
+ let path = '';
894
+ if (name != null) {
895
+ if (method == null) method = 'GET';
896
+ path = '/' + '_template' + '/' + encodeURIComponent(name);
822
897
  } else {
823
- if (method == null) method = 'GET'
824
- path = '/' + '_template'
898
+ if (method == null) method = 'GET';
899
+ path = '/' + '_template';
825
900
  }
826
901
 
827
902
  // build request object
@@ -829,89 +904,89 @@ IndicesApi.prototype.getTemplate = function indicesGetTemplateApi (params, optio
829
904
  method,
830
905
  path,
831
906
  body: null,
832
- querystring
833
- }
907
+ querystring,
908
+ };
834
909
 
835
- return this.transport.request(request, options, callback)
836
- }
910
+ return this.transport.request(request, options, callback);
911
+ };
837
912
 
838
- IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi (params, options, callback) {
839
- ;[params, options, callback] = normalizeArguments(params, options, callback)
913
+ IndicesApi.prototype.getUpgrade = function indicesGetUpgradeApi(params, options, callback) {
914
+ [params, options, callback] = normalizeArguments(params, options, callback);
840
915
 
841
- let { method, body, index, ...querystring } = params
842
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
916
+ let { method, body, index, ...querystring } = params;
917
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
843
918
 
844
- let path = ''
845
- if (method == null) method = 'GET'
846
- path = '/' + encodeURIComponent(index) + '/' + '_upgrade'
919
+ let path = '';
920
+ if (method == null) method = 'GET';
921
+ path = '/' + encodeURIComponent(index) + '/' + '_upgrade';
847
922
 
848
923
  // build request object
849
924
  const request = {
850
925
  method,
851
926
  path,
852
927
  body: null,
853
- querystring
854
- }
928
+ querystring,
929
+ };
855
930
 
856
- return this.transport.request(request, options, callback)
857
- }
931
+ return this.transport.request(request, options, callback);
932
+ };
858
933
 
859
- IndicesApi.prototype.open = function indicesOpenApi (params, options, callback) {
860
- ;[params, options, callback] = normalizeArguments(params, options, callback)
934
+ IndicesApi.prototype.open = function indicesOpenApi(params, options, callback) {
935
+ [params, options, callback] = normalizeArguments(params, options, callback);
861
936
 
862
937
  // check required parameters
863
938
  if (params.index == null) {
864
- const err = new this[kConfigurationError]('Missing required parameter: index')
865
- return handleError(err, callback)
939
+ const err = new this[kConfigurationError]('Missing required parameter: index');
940
+ return handleError(err, callback);
866
941
  }
867
942
 
868
- let { method, body, index, ...querystring } = params
869
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
943
+ let { method, body, index, ...querystring } = params;
944
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
870
945
 
871
- let path = ''
872
- if (method == null) method = 'POST'
873
- path = '/' + encodeURIComponent(index) + '/' + '_open'
946
+ let path = '';
947
+ if (method == null) method = 'POST';
948
+ path = '/' + encodeURIComponent(index) + '/' + '_open';
874
949
 
875
950
  // build request object
876
951
  const request = {
877
952
  method,
878
953
  path,
879
954
  body: body || '',
880
- querystring
881
- }
955
+ querystring,
956
+ };
882
957
 
883
- return this.transport.request(request, options, callback)
884
- }
958
+ return this.transport.request(request, options, callback);
959
+ };
885
960
 
886
- IndicesApi.prototype.putAlias = function indicesPutAliasApi (params, options, callback) {
887
- ;[params, options, callback] = normalizeArguments(params, options, callback)
961
+ IndicesApi.prototype.putAlias = function indicesPutAliasApi(params, options, callback) {
962
+ [params, options, callback] = normalizeArguments(params, options, callback);
888
963
 
889
964
  // check required parameters
890
965
  if (params.index == null) {
891
- const err = new this[kConfigurationError]('Missing required parameter: index')
892
- return handleError(err, callback)
966
+ const err = new this[kConfigurationError]('Missing required parameter: index');
967
+ return handleError(err, callback);
893
968
  }
894
969
  if (params.name == null) {
895
- const err = new this[kConfigurationError]('Missing required parameter: name')
896
- return handleError(err, callback)
970
+ const err = new this[kConfigurationError]('Missing required parameter: name');
971
+ return handleError(err, callback);
897
972
  }
898
973
 
899
974
  // check required url components
900
- if (params.name != null && (params.index == null)) {
901
- const err = new this[kConfigurationError]('Missing required parameter of the url: index')
902
- return handleError(err, callback)
975
+ if (params.name != null && params.index == null) {
976
+ const err = new this[kConfigurationError]('Missing required parameter of the url: index');
977
+ return handleError(err, callback);
903
978
  }
904
979
 
905
- let { method, body, index, name, ...querystring } = params
906
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
980
+ let { method, body, index, name, ...querystring } = params;
981
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
907
982
 
908
- let path = ''
909
- if ((index) != null && (name) != null) {
910
- if (method == null) method = 'PUT'
911
- path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name)
983
+ let path = '';
984
+ if (index != null && name != null) {
985
+ if (method == null) method = 'PUT';
986
+ path = '/' + encodeURIComponent(index) + '/' + '_alias' + '/' + encodeURIComponent(name);
912
987
  } else {
913
- if (method == null) method = 'PUT'
914
- path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name)
988
+ if (method == null) method = 'PUT';
989
+ path = '/' + encodeURIComponent(index) + '/' + '_aliases' + '/' + encodeURIComponent(name);
915
990
  }
916
991
 
917
992
  // build request object
@@ -919,80 +994,84 @@ IndicesApi.prototype.putAlias = function indicesPutAliasApi (params, options, ca
919
994
  method,
920
995
  path,
921
996
  body: body || '',
922
- querystring
923
- }
997
+ querystring,
998
+ };
924
999
 
925
- return this.transport.request(request, options, callback)
926
- }
1000
+ return this.transport.request(request, options, callback);
1001
+ };
927
1002
 
928
- IndicesApi.prototype.putIndexTemplate = function indicesPutIndexTemplateApi (params, options, callback) {
929
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1003
+ IndicesApi.prototype.putIndexTemplate = function indicesPutIndexTemplateApi(
1004
+ params,
1005
+ options,
1006
+ callback
1007
+ ) {
1008
+ [params, options, callback] = normalizeArguments(params, options, callback);
930
1009
 
931
1010
  // check required parameters
932
1011
  if (params.name == null) {
933
- const err = new this[kConfigurationError]('Missing required parameter: name')
934
- return handleError(err, callback)
1012
+ const err = new this[kConfigurationError]('Missing required parameter: name');
1013
+ return handleError(err, callback);
935
1014
  }
936
1015
  if (params.body == null) {
937
- const err = new this[kConfigurationError]('Missing required parameter: body')
938
- return handleError(err, callback)
1016
+ const err = new this[kConfigurationError]('Missing required parameter: body');
1017
+ return handleError(err, callback);
939
1018
  }
940
1019
 
941
- let { method, body, name, ...querystring } = params
942
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1020
+ let { method, body, name, ...querystring } = params;
1021
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
943
1022
 
944
- let path = ''
945
- if (method == null) method = 'PUT'
946
- path = '/' + '_index_template' + '/' + encodeURIComponent(name)
1023
+ let path = '';
1024
+ if (method == null) method = 'PUT';
1025
+ path = '/' + '_index_template' + '/' + encodeURIComponent(name);
947
1026
 
948
1027
  // build request object
949
1028
  const request = {
950
1029
  method,
951
1030
  path,
952
1031
  body: body || '',
953
- querystring
954
- }
1032
+ querystring,
1033
+ };
955
1034
 
956
- return this.transport.request(request, options, callback)
957
- }
1035
+ return this.transport.request(request, options, callback);
1036
+ };
958
1037
 
959
- IndicesApi.prototype.putMapping = function indicesPutMappingApi (params, options, callback) {
960
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1038
+ IndicesApi.prototype.putMapping = function indicesPutMappingApi(params, options, callback) {
1039
+ [params, options, callback] = normalizeArguments(params, options, callback);
961
1040
 
962
1041
  // check required parameters
963
1042
  if (params.body == null) {
964
- const err = new this[kConfigurationError]('Missing required parameter: body')
965
- return handleError(err, callback)
966
- }
967
-
968
- let { method, body, index, type, ...querystring } = params
969
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
970
-
971
- let path = ''
972
- if ((index) != null && (type) != null) {
973
- if (method == null) method = 'PUT'
974
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mapping'
975
- } else if ((index) != null && (type) != null) {
976
- if (method == null) method = 'PUT'
977
- path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type)
978
- } else if ((index) != null && (type) != null) {
979
- if (method == null) method = 'PUT'
980
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mappings'
981
- } else if ((index) != null && (type) != null) {
982
- if (method == null) method = 'PUT'
983
- path = '/' + encodeURIComponent(index) + '/' + '_mappings' + '/' + encodeURIComponent(type)
984
- } else if ((index) != null) {
985
- if (method == null) method = 'PUT'
986
- path = '/' + encodeURIComponent(index) + '/' + '_mapping'
987
- } else if ((type) != null) {
988
- if (method == null) method = 'PUT'
989
- path = '/' + '_mappings' + '/' + encodeURIComponent(type)
990
- } else if ((index) != null) {
991
- if (method == null) method = 'PUT'
992
- path = '/' + encodeURIComponent(index) + '/' + '_mappings'
1043
+ const err = new this[kConfigurationError]('Missing required parameter: body');
1044
+ return handleError(err, callback);
1045
+ }
1046
+
1047
+ let { method, body, index, type, ...querystring } = params;
1048
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1049
+
1050
+ let path = '';
1051
+ if (index != null && type != null) {
1052
+ if (method == null) method = 'PUT';
1053
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mapping';
1054
+ } else if (index != null && type != null) {
1055
+ if (method == null) method = 'PUT';
1056
+ path = '/' + encodeURIComponent(index) + '/' + '_mapping' + '/' + encodeURIComponent(type);
1057
+ } else if (index != null && type != null) {
1058
+ if (method == null) method = 'PUT';
1059
+ path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_mappings';
1060
+ } else if (index != null && type != null) {
1061
+ if (method == null) method = 'PUT';
1062
+ path = '/' + encodeURIComponent(index) + '/' + '_mappings' + '/' + encodeURIComponent(type);
1063
+ } else if (index != null) {
1064
+ if (method == null) method = 'PUT';
1065
+ path = '/' + encodeURIComponent(index) + '/' + '_mapping';
1066
+ } else if (type != null) {
1067
+ if (method == null) method = 'PUT';
1068
+ path = '/' + '_mappings' + '/' + encodeURIComponent(type);
1069
+ } else if (index != null) {
1070
+ if (method == null) method = 'PUT';
1071
+ path = '/' + encodeURIComponent(index) + '/' + '_mappings';
993
1072
  } else {
994
- if (method == null) method = 'PUT'
995
- path = '/' + '_mapping' + '/' + encodeURIComponent(type)
1073
+ if (method == null) method = 'PUT';
1074
+ path = '/' + '_mapping' + '/' + encodeURIComponent(type);
996
1075
  }
997
1076
 
998
1077
  // build request object
@@ -1000,31 +1079,31 @@ IndicesApi.prototype.putMapping = function indicesPutMappingApi (params, options
1000
1079
  method,
1001
1080
  path,
1002
1081
  body: body || '',
1003
- querystring
1004
- }
1082
+ querystring,
1083
+ };
1005
1084
 
1006
- return this.transport.request(request, options, callback)
1007
- }
1085
+ return this.transport.request(request, options, callback);
1086
+ };
1008
1087
 
1009
- IndicesApi.prototype.putSettings = function indicesPutSettingsApi (params, options, callback) {
1010
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1088
+ IndicesApi.prototype.putSettings = function indicesPutSettingsApi(params, options, callback) {
1089
+ [params, options, callback] = normalizeArguments(params, options, callback);
1011
1090
 
1012
1091
  // check required parameters
1013
1092
  if (params.body == null) {
1014
- const err = new this[kConfigurationError]('Missing required parameter: body')
1015
- return handleError(err, callback)
1093
+ const err = new this[kConfigurationError]('Missing required parameter: body');
1094
+ return handleError(err, callback);
1016
1095
  }
1017
1096
 
1018
- let { method, body, index, ...querystring } = params
1019
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1097
+ let { method, body, index, ...querystring } = params;
1098
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1020
1099
 
1021
- let path = ''
1022
- if ((index) != null) {
1023
- if (method == null) method = 'PUT'
1024
- path = '/' + encodeURIComponent(index) + '/' + '_settings'
1100
+ let path = '';
1101
+ if (index != null) {
1102
+ if (method == null) method = 'PUT';
1103
+ path = '/' + encodeURIComponent(index) + '/' + '_settings';
1025
1104
  } else {
1026
- if (method == null) method = 'PUT'
1027
- path = '/' + '_settings'
1105
+ if (method == null) method = 'PUT';
1106
+ path = '/' + '_settings';
1028
1107
  }
1029
1108
 
1030
1109
  // build request object
@@ -1032,56 +1111,56 @@ IndicesApi.prototype.putSettings = function indicesPutSettingsApi (params, optio
1032
1111
  method,
1033
1112
  path,
1034
1113
  body: body || '',
1035
- querystring
1036
- }
1114
+ querystring,
1115
+ };
1037
1116
 
1038
- return this.transport.request(request, options, callback)
1039
- }
1117
+ return this.transport.request(request, options, callback);
1118
+ };
1040
1119
 
1041
- IndicesApi.prototype.putTemplate = function indicesPutTemplateApi (params, options, callback) {
1042
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1120
+ IndicesApi.prototype.putTemplate = function indicesPutTemplateApi(params, options, callback) {
1121
+ [params, options, callback] = normalizeArguments(params, options, callback);
1043
1122
 
1044
1123
  // check required parameters
1045
1124
  if (params.name == null) {
1046
- const err = new this[kConfigurationError]('Missing required parameter: name')
1047
- return handleError(err, callback)
1125
+ const err = new this[kConfigurationError]('Missing required parameter: name');
1126
+ return handleError(err, callback);
1048
1127
  }
1049
1128
  if (params.body == null) {
1050
- const err = new this[kConfigurationError]('Missing required parameter: body')
1051
- return handleError(err, callback)
1129
+ const err = new this[kConfigurationError]('Missing required parameter: body');
1130
+ return handleError(err, callback);
1052
1131
  }
1053
1132
 
1054
- let { method, body, name, ...querystring } = params
1055
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1133
+ let { method, body, name, ...querystring } = params;
1134
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1056
1135
 
1057
- let path = ''
1058
- if (method == null) method = 'PUT'
1059
- path = '/' + '_template' + '/' + encodeURIComponent(name)
1136
+ let path = '';
1137
+ if (method == null) method = 'PUT';
1138
+ path = '/' + '_template' + '/' + encodeURIComponent(name);
1060
1139
 
1061
1140
  // build request object
1062
1141
  const request = {
1063
1142
  method,
1064
1143
  path,
1065
1144
  body: body || '',
1066
- querystring
1067
- }
1145
+ querystring,
1146
+ };
1068
1147
 
1069
- return this.transport.request(request, options, callback)
1070
- }
1148
+ return this.transport.request(request, options, callback);
1149
+ };
1071
1150
 
1072
- IndicesApi.prototype.recovery = function indicesRecoveryApi (params, options, callback) {
1073
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1151
+ IndicesApi.prototype.recovery = function indicesRecoveryApi(params, options, callback) {
1152
+ [params, options, callback] = normalizeArguments(params, options, callback);
1074
1153
 
1075
- let { method, body, index, ...querystring } = params
1076
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1154
+ let { method, body, index, ...querystring } = params;
1155
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1077
1156
 
1078
- let path = ''
1079
- if ((index) != null) {
1080
- if (method == null) method = 'GET'
1081
- path = '/' + encodeURIComponent(index) + '/' + '_recovery'
1157
+ let path = '';
1158
+ if (index != null) {
1159
+ if (method == null) method = 'GET';
1160
+ path = '/' + encodeURIComponent(index) + '/' + '_recovery';
1082
1161
  } else {
1083
- if (method == null) method = 'GET'
1084
- path = '/' + '_recovery'
1162
+ if (method == null) method = 'GET';
1163
+ path = '/' + '_recovery';
1085
1164
  }
1086
1165
 
1087
1166
  // build request object
@@ -1089,25 +1168,25 @@ IndicesApi.prototype.recovery = function indicesRecoveryApi (params, options, ca
1089
1168
  method,
1090
1169
  path,
1091
1170
  body: null,
1092
- querystring
1093
- }
1171
+ querystring,
1172
+ };
1094
1173
 
1095
- return this.transport.request(request, options, callback)
1096
- }
1174
+ return this.transport.request(request, options, callback);
1175
+ };
1097
1176
 
1098
- IndicesApi.prototype.refresh = function indicesRefreshApi (params, options, callback) {
1099
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1177
+ IndicesApi.prototype.refresh = function indicesRefreshApi(params, options, callback) {
1178
+ [params, options, callback] = normalizeArguments(params, options, callback);
1100
1179
 
1101
- let { method, body, index, ...querystring } = params
1102
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1180
+ let { method, body, index, ...querystring } = params;
1181
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1103
1182
 
1104
- let path = ''
1105
- if ((index) != null) {
1106
- if (method == null) method = body == null ? 'GET' : 'POST'
1107
- path = '/' + encodeURIComponent(index) + '/' + '_refresh'
1183
+ let path = '';
1184
+ if (index != null) {
1185
+ if (method == null) method = body == null ? 'GET' : 'POST';
1186
+ path = '/' + encodeURIComponent(index) + '/' + '_refresh';
1108
1187
  } else {
1109
- if (method == null) method = body == null ? 'GET' : 'POST'
1110
- path = '/' + '_refresh'
1188
+ if (method == null) method = body == null ? 'GET' : 'POST';
1189
+ path = '/' + '_refresh';
1111
1190
  }
1112
1191
 
1113
1192
  // build request object
@@ -1115,64 +1194,70 @@ IndicesApi.prototype.refresh = function indicesRefreshApi (params, options, call
1115
1194
  method,
1116
1195
  path,
1117
1196
  body: body || '',
1118
- querystring
1119
- }
1197
+ querystring,
1198
+ };
1120
1199
 
1121
- return this.transport.request(request, options, callback)
1122
- }
1200
+ return this.transport.request(request, options, callback);
1201
+ };
1123
1202
 
1124
- IndicesApi.prototype.resolveIndex = function indicesResolveIndexApi (params, options, callback) {
1125
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1203
+ IndicesApi.prototype.resolveIndex = function indicesResolveIndexApi(params, options, callback) {
1204
+ [params, options, callback] = normalizeArguments(params, options, callback);
1126
1205
 
1127
1206
  // check required parameters
1128
1207
  if (params.name == null) {
1129
- const err = new this[kConfigurationError]('Missing required parameter: name')
1130
- return handleError(err, callback)
1208
+ const err = new this[kConfigurationError]('Missing required parameter: name');
1209
+ return handleError(err, callback);
1131
1210
  }
1132
1211
 
1133
- let { method, body, name, ...querystring } = params
1134
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1212
+ let { method, body, name, ...querystring } = params;
1213
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1135
1214
 
1136
- let path = ''
1137
- if (method == null) method = 'GET'
1138
- path = '/' + '_resolve' + '/' + 'index' + '/' + encodeURIComponent(name)
1215
+ let path = '';
1216
+ if (method == null) method = 'GET';
1217
+ path = '/' + '_resolve' + '/' + 'index' + '/' + encodeURIComponent(name);
1139
1218
 
1140
1219
  // build request object
1141
1220
  const request = {
1142
1221
  method,
1143
1222
  path,
1144
1223
  body: null,
1145
- querystring
1146
- }
1224
+ querystring,
1225
+ };
1147
1226
 
1148
- return this.transport.request(request, options, callback)
1149
- }
1227
+ return this.transport.request(request, options, callback);
1228
+ };
1150
1229
 
1151
- IndicesApi.prototype.rollover = function indicesRolloverApi (params, options, callback) {
1152
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1230
+ IndicesApi.prototype.rollover = function indicesRolloverApi(params, options, callback) {
1231
+ [params, options, callback] = normalizeArguments(params, options, callback);
1153
1232
 
1154
1233
  // check required parameters
1155
1234
  if (params.alias == null) {
1156
- const err = new this[kConfigurationError]('Missing required parameter: alias')
1157
- return handleError(err, callback)
1235
+ const err = new this[kConfigurationError]('Missing required parameter: alias');
1236
+ return handleError(err, callback);
1158
1237
  }
1159
1238
 
1160
1239
  // check required url components
1161
- if ((params.new_index != null || params.newIndex != null) && (params.alias == null)) {
1162
- const err = new this[kConfigurationError]('Missing required parameter of the url: alias')
1163
- return handleError(err, callback)
1164
- }
1165
-
1166
- let { method, body, alias, newIndex, new_index, ...querystring } = params
1167
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1168
-
1169
- let path = ''
1170
- if ((alias) != null && (new_index || newIndex) != null) {
1171
- if (method == null) method = 'POST'
1172
- path = '/' + encodeURIComponent(alias) + '/' + '_rollover' + '/' + encodeURIComponent(new_index || newIndex)
1240
+ if ((params.new_index != null || params.newIndex != null) && params.alias == null) {
1241
+ const err = new this[kConfigurationError]('Missing required parameter of the url: alias');
1242
+ return handleError(err, callback);
1243
+ }
1244
+
1245
+ let { method, body, alias, newIndex, new_index, ...querystring } = params;
1246
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1247
+
1248
+ let path = '';
1249
+ if (alias != null && (new_index || newIndex) != null) {
1250
+ if (method == null) method = 'POST';
1251
+ path =
1252
+ '/' +
1253
+ encodeURIComponent(alias) +
1254
+ '/' +
1255
+ '_rollover' +
1256
+ '/' +
1257
+ encodeURIComponent(new_index || newIndex);
1173
1258
  } else {
1174
- if (method == null) method = 'POST'
1175
- path = '/' + encodeURIComponent(alias) + '/' + '_rollover'
1259
+ if (method == null) method = 'POST';
1260
+ path = '/' + encodeURIComponent(alias) + '/' + '_rollover';
1176
1261
  }
1177
1262
 
1178
1263
  // build request object
@@ -1180,25 +1265,25 @@ IndicesApi.prototype.rollover = function indicesRolloverApi (params, options, ca
1180
1265
  method,
1181
1266
  path,
1182
1267
  body: body || '',
1183
- querystring
1184
- }
1268
+ querystring,
1269
+ };
1185
1270
 
1186
- return this.transport.request(request, options, callback)
1187
- }
1271
+ return this.transport.request(request, options, callback);
1272
+ };
1188
1273
 
1189
- IndicesApi.prototype.segments = function indicesSegmentsApi (params, options, callback) {
1190
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1274
+ IndicesApi.prototype.segments = function indicesSegmentsApi(params, options, callback) {
1275
+ [params, options, callback] = normalizeArguments(params, options, callback);
1191
1276
 
1192
- let { method, body, index, ...querystring } = params
1193
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1277
+ let { method, body, index, ...querystring } = params;
1278
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1194
1279
 
1195
- let path = ''
1196
- if ((index) != null) {
1197
- if (method == null) method = 'GET'
1198
- path = '/' + encodeURIComponent(index) + '/' + '_segments'
1280
+ let path = '';
1281
+ if (index != null) {
1282
+ if (method == null) method = 'GET';
1283
+ path = '/' + encodeURIComponent(index) + '/' + '_segments';
1199
1284
  } else {
1200
- if (method == null) method = 'GET'
1201
- path = '/' + '_segments'
1285
+ if (method == null) method = 'GET';
1286
+ path = '/' + '_segments';
1202
1287
  }
1203
1288
 
1204
1289
  // build request object
@@ -1206,25 +1291,25 @@ IndicesApi.prototype.segments = function indicesSegmentsApi (params, options, ca
1206
1291
  method,
1207
1292
  path,
1208
1293
  body: null,
1209
- querystring
1210
- }
1294
+ querystring,
1295
+ };
1211
1296
 
1212
- return this.transport.request(request, options, callback)
1213
- }
1297
+ return this.transport.request(request, options, callback);
1298
+ };
1214
1299
 
1215
- IndicesApi.prototype.shardStores = function indicesShardStoresApi (params, options, callback) {
1216
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1300
+ IndicesApi.prototype.shardStores = function indicesShardStoresApi(params, options, callback) {
1301
+ [params, options, callback] = normalizeArguments(params, options, callback);
1217
1302
 
1218
- let { method, body, index, ...querystring } = params
1219
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1303
+ let { method, body, index, ...querystring } = params;
1304
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1220
1305
 
1221
- let path = ''
1222
- if ((index) != null) {
1223
- if (method == null) method = 'GET'
1224
- path = '/' + encodeURIComponent(index) + '/' + '_shard_stores'
1306
+ let path = '';
1307
+ if (index != null) {
1308
+ if (method == null) method = 'GET';
1309
+ path = '/' + encodeURIComponent(index) + '/' + '_shard_stores';
1225
1310
  } else {
1226
- if (method == null) method = 'GET'
1227
- path = '/' + '_shard_stores'
1311
+ if (method == null) method = 'GET';
1312
+ path = '/' + '_shard_stores';
1228
1313
  }
1229
1314
 
1230
1315
  // build request object
@@ -1232,89 +1317,97 @@ IndicesApi.prototype.shardStores = function indicesShardStoresApi (params, optio
1232
1317
  method,
1233
1318
  path,
1234
1319
  body: null,
1235
- querystring
1236
- }
1320
+ querystring,
1321
+ };
1237
1322
 
1238
- return this.transport.request(request, options, callback)
1239
- }
1323
+ return this.transport.request(request, options, callback);
1324
+ };
1240
1325
 
1241
- IndicesApi.prototype.shrink = function indicesShrinkApi (params, options, callback) {
1242
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1326
+ IndicesApi.prototype.shrink = function indicesShrinkApi(params, options, callback) {
1327
+ [params, options, callback] = normalizeArguments(params, options, callback);
1243
1328
 
1244
1329
  // check required parameters
1245
1330
  if (params.index == null) {
1246
- const err = new this[kConfigurationError]('Missing required parameter: index')
1247
- return handleError(err, callback)
1331
+ const err = new this[kConfigurationError]('Missing required parameter: index');
1332
+ return handleError(err, callback);
1248
1333
  }
1249
1334
  if (params.target == null) {
1250
- const err = new this[kConfigurationError]('Missing required parameter: target')
1251
- return handleError(err, callback)
1335
+ const err = new this[kConfigurationError]('Missing required parameter: target');
1336
+ return handleError(err, callback);
1252
1337
  }
1253
1338
 
1254
1339
  // check required url components
1255
- if (params.target != null && (params.index == null)) {
1256
- const err = new this[kConfigurationError]('Missing required parameter of the url: index')
1257
- return handleError(err, callback)
1340
+ if (params.target != null && params.index == null) {
1341
+ const err = new this[kConfigurationError]('Missing required parameter of the url: index');
1342
+ return handleError(err, callback);
1258
1343
  }
1259
1344
 
1260
- let { method, body, index, target, ...querystring } = params
1261
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1345
+ let { method, body, index, target, ...querystring } = params;
1346
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1262
1347
 
1263
- let path = ''
1264
- if (method == null) method = 'PUT'
1265
- path = '/' + encodeURIComponent(index) + '/' + '_shrink' + '/' + encodeURIComponent(target)
1348
+ let path = '';
1349
+ if (method == null) method = 'PUT';
1350
+ path = '/' + encodeURIComponent(index) + '/' + '_shrink' + '/' + encodeURIComponent(target);
1266
1351
 
1267
1352
  // build request object
1268
1353
  const request = {
1269
1354
  method,
1270
1355
  path,
1271
1356
  body: body || '',
1272
- querystring
1273
- }
1357
+ querystring,
1358
+ };
1274
1359
 
1275
- return this.transport.request(request, options, callback)
1276
- }
1360
+ return this.transport.request(request, options, callback);
1361
+ };
1277
1362
 
1278
- IndicesApi.prototype.simulateIndexTemplate = function indicesSimulateIndexTemplateApi (params, options, callback) {
1279
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1363
+ IndicesApi.prototype.simulateIndexTemplate = function indicesSimulateIndexTemplateApi(
1364
+ params,
1365
+ options,
1366
+ callback
1367
+ ) {
1368
+ [params, options, callback] = normalizeArguments(params, options, callback);
1280
1369
 
1281
1370
  // check required parameters
1282
1371
  if (params.name == null) {
1283
- const err = new this[kConfigurationError]('Missing required parameter: name')
1284
- return handleError(err, callback)
1372
+ const err = new this[kConfigurationError]('Missing required parameter: name');
1373
+ return handleError(err, callback);
1285
1374
  }
1286
1375
 
1287
- let { method, body, name, ...querystring } = params
1288
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1376
+ let { method, body, name, ...querystring } = params;
1377
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1289
1378
 
1290
- let path = ''
1291
- if (method == null) method = 'POST'
1292
- path = '/' + '_index_template' + '/' + '_simulate_index' + '/' + encodeURIComponent(name)
1379
+ let path = '';
1380
+ if (method == null) method = 'POST';
1381
+ path = '/' + '_index_template' + '/' + '_simulate_index' + '/' + encodeURIComponent(name);
1293
1382
 
1294
1383
  // build request object
1295
1384
  const request = {
1296
1385
  method,
1297
1386
  path,
1298
1387
  body: body || '',
1299
- querystring
1300
- }
1301
-
1302
- return this.transport.request(request, options, callback)
1303
- }
1304
-
1305
- IndicesApi.prototype.simulateTemplate = function indicesSimulateTemplateApi (params, options, callback) {
1306
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1307
-
1308
- let { method, body, name, ...querystring } = params
1309
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1310
-
1311
- let path = ''
1312
- if ((name) != null) {
1313
- if (method == null) method = 'POST'
1314
- path = '/' + '_index_template' + '/' + '_simulate' + '/' + encodeURIComponent(name)
1388
+ querystring,
1389
+ };
1390
+
1391
+ return this.transport.request(request, options, callback);
1392
+ };
1393
+
1394
+ IndicesApi.prototype.simulateTemplate = function indicesSimulateTemplateApi(
1395
+ params,
1396
+ options,
1397
+ callback
1398
+ ) {
1399
+ [params, options, callback] = normalizeArguments(params, options, callback);
1400
+
1401
+ let { method, body, name, ...querystring } = params;
1402
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1403
+
1404
+ let path = '';
1405
+ if (name != null) {
1406
+ if (method == null) method = 'POST';
1407
+ path = '/' + '_index_template' + '/' + '_simulate' + '/' + encodeURIComponent(name);
1315
1408
  } else {
1316
- if (method == null) method = 'POST'
1317
- path = '/' + '_index_template' + '/' + '_simulate'
1409
+ if (method == null) method = 'POST';
1410
+ path = '/' + '_index_template' + '/' + '_simulate';
1318
1411
  }
1319
1412
 
1320
1413
  // build request object
@@ -1322,68 +1415,68 @@ IndicesApi.prototype.simulateTemplate = function indicesSimulateTemplateApi (par
1322
1415
  method,
1323
1416
  path,
1324
1417
  body: body || '',
1325
- querystring
1326
- }
1418
+ querystring,
1419
+ };
1327
1420
 
1328
- return this.transport.request(request, options, callback)
1329
- }
1421
+ return this.transport.request(request, options, callback);
1422
+ };
1330
1423
 
1331
- IndicesApi.prototype.split = function indicesSplitApi (params, options, callback) {
1332
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1424
+ IndicesApi.prototype.split = function indicesSplitApi(params, options, callback) {
1425
+ [params, options, callback] = normalizeArguments(params, options, callback);
1333
1426
 
1334
1427
  // check required parameters
1335
1428
  if (params.index == null) {
1336
- const err = new this[kConfigurationError]('Missing required parameter: index')
1337
- return handleError(err, callback)
1429
+ const err = new this[kConfigurationError]('Missing required parameter: index');
1430
+ return handleError(err, callback);
1338
1431
  }
1339
1432
  if (params.target == null) {
1340
- const err = new this[kConfigurationError]('Missing required parameter: target')
1341
- return handleError(err, callback)
1433
+ const err = new this[kConfigurationError]('Missing required parameter: target');
1434
+ return handleError(err, callback);
1342
1435
  }
1343
1436
 
1344
1437
  // check required url components
1345
- if (params.target != null && (params.index == null)) {
1346
- const err = new this[kConfigurationError]('Missing required parameter of the url: index')
1347
- return handleError(err, callback)
1438
+ if (params.target != null && params.index == null) {
1439
+ const err = new this[kConfigurationError]('Missing required parameter of the url: index');
1440
+ return handleError(err, callback);
1348
1441
  }
1349
1442
 
1350
- let { method, body, index, target, ...querystring } = params
1351
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1443
+ let { method, body, index, target, ...querystring } = params;
1444
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1352
1445
 
1353
- let path = ''
1354
- if (method == null) method = 'PUT'
1355
- path = '/' + encodeURIComponent(index) + '/' + '_split' + '/' + encodeURIComponent(target)
1446
+ let path = '';
1447
+ if (method == null) method = 'PUT';
1448
+ path = '/' + encodeURIComponent(index) + '/' + '_split' + '/' + encodeURIComponent(target);
1356
1449
 
1357
1450
  // build request object
1358
1451
  const request = {
1359
1452
  method,
1360
1453
  path,
1361
1454
  body: body || '',
1362
- querystring
1363
- }
1364
-
1365
- return this.transport.request(request, options, callback)
1366
- }
1367
-
1368
- IndicesApi.prototype.stats = function indicesStatsApi (params, options, callback) {
1369
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1370
-
1371
- let { method, body, metric, index, ...querystring } = params
1372
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1373
-
1374
- let path = ''
1375
- if ((index) != null && (metric) != null) {
1376
- if (method == null) method = 'GET'
1377
- path = '/' + encodeURIComponent(index) + '/' + '_stats' + '/' + encodeURIComponent(metric)
1378
- } else if ((metric) != null) {
1379
- if (method == null) method = 'GET'
1380
- path = '/' + '_stats' + '/' + encodeURIComponent(metric)
1381
- } else if ((index) != null) {
1382
- if (method == null) method = 'GET'
1383
- path = '/' + encodeURIComponent(index) + '/' + '_stats'
1455
+ querystring,
1456
+ };
1457
+
1458
+ return this.transport.request(request, options, callback);
1459
+ };
1460
+
1461
+ IndicesApi.prototype.stats = function indicesStatsApi(params, options, callback) {
1462
+ [params, options, callback] = normalizeArguments(params, options, callback);
1463
+
1464
+ let { method, body, metric, index, ...querystring } = params;
1465
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1466
+
1467
+ let path = '';
1468
+ if (index != null && metric != null) {
1469
+ if (method == null) method = 'GET';
1470
+ path = '/' + encodeURIComponent(index) + '/' + '_stats' + '/' + encodeURIComponent(metric);
1471
+ } else if (metric != null) {
1472
+ if (method == null) method = 'GET';
1473
+ path = '/' + '_stats' + '/' + encodeURIComponent(metric);
1474
+ } else if (index != null) {
1475
+ if (method == null) method = 'GET';
1476
+ path = '/' + encodeURIComponent(index) + '/' + '_stats';
1384
1477
  } else {
1385
- if (method == null) method = 'GET'
1386
- path = '/' + '_stats'
1478
+ if (method == null) method = 'GET';
1479
+ path = '/' + '_stats';
1387
1480
  }
1388
1481
 
1389
1482
  // build request object
@@ -1391,82 +1484,90 @@ IndicesApi.prototype.stats = function indicesStatsApi (params, options, callback
1391
1484
  method,
1392
1485
  path,
1393
1486
  body: null,
1394
- querystring
1395
- }
1487
+ querystring,
1488
+ };
1396
1489
 
1397
- return this.transport.request(request, options, callback)
1398
- }
1490
+ return this.transport.request(request, options, callback);
1491
+ };
1399
1492
 
1400
- IndicesApi.prototype.updateAliases = function indicesUpdateAliasesApi (params, options, callback) {
1401
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1493
+ IndicesApi.prototype.updateAliases = function indicesUpdateAliasesApi(params, options, callback) {
1494
+ [params, options, callback] = normalizeArguments(params, options, callback);
1402
1495
 
1403
1496
  // check required parameters
1404
1497
  if (params.body == null) {
1405
- const err = new this[kConfigurationError]('Missing required parameter: body')
1406
- return handleError(err, callback)
1498
+ const err = new this[kConfigurationError]('Missing required parameter: body');
1499
+ return handleError(err, callback);
1407
1500
  }
1408
1501
 
1409
- let { method, body, ...querystring } = params
1410
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1502
+ let { method, body, ...querystring } = params;
1503
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1411
1504
 
1412
- let path = ''
1413
- if (method == null) method = 'POST'
1414
- path = '/' + '_aliases'
1505
+ let path = '';
1506
+ if (method == null) method = 'POST';
1507
+ path = '/' + '_aliases';
1415
1508
 
1416
1509
  // build request object
1417
1510
  const request = {
1418
1511
  method,
1419
1512
  path,
1420
1513
  body: body || '',
1421
- querystring
1422
- }
1514
+ querystring,
1515
+ };
1423
1516
 
1424
- return this.transport.request(request, options, callback)
1425
- }
1517
+ return this.transport.request(request, options, callback);
1518
+ };
1426
1519
 
1427
- IndicesApi.prototype.upgrade = function indicesUpgradeApi (params, options, callback) {
1428
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1520
+ IndicesApi.prototype.upgrade = function indicesUpgradeApi(params, options, callback) {
1521
+ [params, options, callback] = normalizeArguments(params, options, callback);
1429
1522
 
1430
- let { method, body, index, ...querystring } = params
1431
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1523
+ let { method, body, index, ...querystring } = params;
1524
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1432
1525
 
1433
- let path = ''
1434
- if (method == null) method = 'POST'
1435
- path = '/' + encodeURIComponent(index) + '/' + '_upgrade'
1526
+ let path = '';
1527
+ if (method == null) method = 'POST';
1528
+ path = '/' + encodeURIComponent(index) + '/' + '_upgrade';
1436
1529
 
1437
1530
  // build request object
1438
1531
  const request = {
1439
1532
  method,
1440
1533
  path,
1441
1534
  body: body || '',
1442
- querystring
1443
- }
1535
+ querystring,
1536
+ };
1444
1537
 
1445
- return this.transport.request(request, options, callback)
1446
- }
1538
+ return this.transport.request(request, options, callback);
1539
+ };
1447
1540
 
1448
- IndicesApi.prototype.validateQuery = function indicesValidateQueryApi (params, options, callback) {
1449
- ;[params, options, callback] = normalizeArguments(params, options, callback)
1541
+ IndicesApi.prototype.validateQuery = function indicesValidateQueryApi(params, options, callback) {
1542
+ [params, options, callback] = normalizeArguments(params, options, callback);
1450
1543
 
1451
1544
  // check required url components
1452
- if (params.type != null && (params.index == null)) {
1453
- const err = new this[kConfigurationError]('Missing required parameter of the url: index')
1454
- return handleError(err, callback)
1455
- }
1456
-
1457
- let { method, body, index, type, ...querystring } = params
1458
- querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)
1459
-
1460
- let path = ''
1461
- if ((index) != null && (type) != null) {
1462
- if (method == null) method = body == null ? 'GET' : 'POST'
1463
- path = '/' + encodeURIComponent(index) + '/' + encodeURIComponent(type) + '/' + '_validate' + '/' + 'query'
1464
- } else if ((index) != null) {
1465
- if (method == null) method = body == null ? 'GET' : 'POST'
1466
- path = '/' + encodeURIComponent(index) + '/' + '_validate' + '/' + 'query'
1545
+ if (params.type != null && params.index == null) {
1546
+ const err = new this[kConfigurationError]('Missing required parameter of the url: index');
1547
+ return handleError(err, callback);
1548
+ }
1549
+
1550
+ let { method, body, index, type, ...querystring } = params;
1551
+ querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring);
1552
+
1553
+ let path = '';
1554
+ if (index != null && type != null) {
1555
+ if (method == null) method = body == null ? 'GET' : 'POST';
1556
+ path =
1557
+ '/' +
1558
+ encodeURIComponent(index) +
1559
+ '/' +
1560
+ encodeURIComponent(type) +
1561
+ '/' +
1562
+ '_validate' +
1563
+ '/' +
1564
+ 'query';
1565
+ } else if (index != null) {
1566
+ if (method == null) method = body == null ? 'GET' : 'POST';
1567
+ path = '/' + encodeURIComponent(index) + '/' + '_validate' + '/' + 'query';
1467
1568
  } else {
1468
- if (method == null) method = body == null ? 'GET' : 'POST'
1469
- path = '/' + '_validate' + '/' + 'query'
1569
+ if (method == null) method = body == null ? 'GET' : 'POST';
1570
+ path = '/' + '_validate' + '/' + 'query';
1470
1571
  }
1471
1572
 
1472
1573
  // build request object
@@ -1474,43 +1575,153 @@ IndicesApi.prototype.validateQuery = function indicesValidateQueryApi (params, o
1474
1575
  method,
1475
1576
  path,
1476
1577
  body: body || '',
1477
- querystring
1478
- }
1578
+ querystring,
1579
+ };
1479
1580
 
1480
- return this.transport.request(request, options, callback)
1481
- }
1581
+ return this.transport.request(request, options, callback);
1582
+ };
1482
1583
 
1483
1584
  Object.defineProperties(IndicesApi.prototype, {
1484
- add_block: { get () { return this.addBlock } },
1485
- clear_cache: { get () { return this.clearCache } },
1486
- delete_alias: { get () { return this.deleteAlias } },
1487
- delete_index_template: { get () { return this.deleteIndexTemplate } },
1488
- delete_template: { get () { return this.deleteTemplate } },
1489
- disk_usage: { get () { return this.diskUsage } },
1490
- exists_alias: { get () { return this.existsAlias } },
1491
- exists_index_template: { get () { return this.existsIndexTemplate } },
1492
- exists_template: { get () { return this.existsTemplate } },
1493
- exists_type: { get () { return this.existsType } },
1494
- field_usage_stats: { get () { return this.fieldUsageStats } },
1495
- flush_synced: { get () { return this.flushSynced } },
1496
- get_alias: { get () { return this.getAlias } },
1497
- get_field_mapping: { get () { return this.getFieldMapping } },
1498
- get_index_template: { get () { return this.getIndexTemplate } },
1499
- get_mapping: { get () { return this.getMapping } },
1500
- get_settings: { get () { return this.getSettings } },
1501
- get_template: { get () { return this.getTemplate } },
1502
- get_upgrade: { get () { return this.getUpgrade } },
1503
- put_alias: { get () { return this.putAlias } },
1504
- put_index_template: { get () { return this.putIndexTemplate } },
1505
- put_mapping: { get () { return this.putMapping } },
1506
- put_settings: { get () { return this.putSettings } },
1507
- put_template: { get () { return this.putTemplate } },
1508
- resolve_index: { get () { return this.resolveIndex } },
1509
- shard_stores: { get () { return this.shardStores } },
1510
- simulate_index_template: { get () { return this.simulateIndexTemplate } },
1511
- simulate_template: { get () { return this.simulateTemplate } },
1512
- update_aliases: { get () { return this.updateAliases } },
1513
- validate_query: { get () { return this.validateQuery } }
1514
- })
1515
-
1516
- module.exports = IndicesApi
1585
+ add_block: {
1586
+ get() {
1587
+ return this.addBlock;
1588
+ },
1589
+ },
1590
+ clear_cache: {
1591
+ get() {
1592
+ return this.clearCache;
1593
+ },
1594
+ },
1595
+ delete_alias: {
1596
+ get() {
1597
+ return this.deleteAlias;
1598
+ },
1599
+ },
1600
+ delete_index_template: {
1601
+ get() {
1602
+ return this.deleteIndexTemplate;
1603
+ },
1604
+ },
1605
+ delete_template: {
1606
+ get() {
1607
+ return this.deleteTemplate;
1608
+ },
1609
+ },
1610
+ disk_usage: {
1611
+ get() {
1612
+ return this.diskUsage;
1613
+ },
1614
+ },
1615
+ exists_alias: {
1616
+ get() {
1617
+ return this.existsAlias;
1618
+ },
1619
+ },
1620
+ exists_index_template: {
1621
+ get() {
1622
+ return this.existsIndexTemplate;
1623
+ },
1624
+ },
1625
+ exists_template: {
1626
+ get() {
1627
+ return this.existsTemplate;
1628
+ },
1629
+ },
1630
+ field_usage_stats: {
1631
+ get() {
1632
+ return this.fieldUsageStats;
1633
+ },
1634
+ },
1635
+ get_alias: {
1636
+ get() {
1637
+ return this.getAlias;
1638
+ },
1639
+ },
1640
+ get_field_mapping: {
1641
+ get() {
1642
+ return this.getFieldMapping;
1643
+ },
1644
+ },
1645
+ get_index_template: {
1646
+ get() {
1647
+ return this.getIndexTemplate;
1648
+ },
1649
+ },
1650
+ get_mapping: {
1651
+ get() {
1652
+ return this.getMapping;
1653
+ },
1654
+ },
1655
+ get_settings: {
1656
+ get() {
1657
+ return this.getSettings;
1658
+ },
1659
+ },
1660
+ get_template: {
1661
+ get() {
1662
+ return this.getTemplate;
1663
+ },
1664
+ },
1665
+ get_upgrade: {
1666
+ get() {
1667
+ return this.getUpgrade;
1668
+ },
1669
+ },
1670
+ put_alias: {
1671
+ get() {
1672
+ return this.putAlias;
1673
+ },
1674
+ },
1675
+ put_index_template: {
1676
+ get() {
1677
+ return this.putIndexTemplate;
1678
+ },
1679
+ },
1680
+ put_mapping: {
1681
+ get() {
1682
+ return this.putMapping;
1683
+ },
1684
+ },
1685
+ put_settings: {
1686
+ get() {
1687
+ return this.putSettings;
1688
+ },
1689
+ },
1690
+ put_template: {
1691
+ get() {
1692
+ return this.putTemplate;
1693
+ },
1694
+ },
1695
+ resolve_index: {
1696
+ get() {
1697
+ return this.resolveIndex;
1698
+ },
1699
+ },
1700
+ shard_stores: {
1701
+ get() {
1702
+ return this.shardStores;
1703
+ },
1704
+ },
1705
+ simulate_index_template: {
1706
+ get() {
1707
+ return this.simulateIndexTemplate;
1708
+ },
1709
+ },
1710
+ simulate_template: {
1711
+ get() {
1712
+ return this.simulateTemplate;
1713
+ },
1714
+ },
1715
+ update_aliases: {
1716
+ get() {
1717
+ return this.updateAliases;
1718
+ },
1719
+ },
1720
+ validate_query: {
1721
+ get() {
1722
+ return this.validateQuery;
1723
+ },
1724
+ },
1725
+ });
1726
+
1727
+ module.exports = IndicesApi;