Skip to content

Commit ad6b452

Browse files
Auto-generated API code (#3023)
1 parent 913609b commit ad6b452

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+6068
-1451
lines changed

docs/reference/api-reference.md

Lines changed: 85 additions & 40 deletions
Large diffs are not rendered by default.

src/api/api/async_search.ts

Lines changed: 106 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,21 @@ import {
2121
TransportResult
2222
} from '@elastic/transport'
2323
import * as T from '../types'
24+
import { kAcceptedParams } from '../../client'
2425

2526
interface That {
2627
transport: Transport
27-
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
28+
[kAcceptedParams]: Record<string, { path: string[], body: string[], query: string[] }>
2829
}
2930

3031
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
3132

3233
export default class AsyncSearch {
3334
transport: Transport
34-
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
35+
[kAcceptedParams]: Record<string, { path: string[], body: string[], query: string[] }>
3536
constructor (transport: Transport) {
3637
this.transport = transport
37-
this.acceptedParams = {
38+
this[kAcceptedParams] = {
3839
'async_search.delete': {
3940
path: [
4041
'id'
@@ -121,6 +122,7 @@ export default class AsyncSearch {
121122
'lenient',
122123
'max_concurrent_shard_requests',
123124
'preference',
125+
'project_routing',
124126
'request_cache',
125127
'routing',
126128
'search_type',
@@ -160,7 +162,7 @@ export default class AsyncSearch {
160162
async delete (this: That, params: T.AsyncSearchDeleteRequest, options?: TransportRequestOptions): Promise<any> {
161163
const {
162164
path: acceptedPath
163-
} = this.acceptedParams['async_search.delete']
165+
} = this[kAcceptedParams]['async_search.delete']
164166

165167
const userQuery = params?.querystring
166168
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
@@ -190,7 +192,10 @@ export default class AsyncSearch {
190192
name: 'async_search.delete',
191193
pathParts: {
192194
id: params.id
193-
}
195+
},
196+
acceptedParams: [
197+
'id'
198+
]
194199
}
195200
return await this.transport.request({ path, method, querystring, body, meta }, options)
196201
}
@@ -205,7 +210,7 @@ export default class AsyncSearch {
205210
async get<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params: T.AsyncSearchGetRequest, options?: TransportRequestOptions): Promise<any> {
206211
const {
207212
path: acceptedPath
208-
} = this.acceptedParams['async_search.get']
213+
} = this[kAcceptedParams]['async_search.get']
209214

210215
const userQuery = params?.querystring
211216
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
@@ -235,7 +240,13 @@ export default class AsyncSearch {
235240
name: 'async_search.get',
236241
pathParts: {
237242
id: params.id
238-
}
243+
},
244+
acceptedParams: [
245+
'id',
246+
'keep_alive',
247+
'typed_keys',
248+
'wait_for_completion_timeout'
249+
]
239250
}
240251
return await this.transport.request({ path, method, querystring, body, meta }, options)
241252
}
@@ -250,7 +261,7 @@ export default class AsyncSearch {
250261
async status (this: That, params: T.AsyncSearchStatusRequest, options?: TransportRequestOptions): Promise<any> {
251262
const {
252263
path: acceptedPath
253-
} = this.acceptedParams['async_search.status']
264+
} = this[kAcceptedParams]['async_search.status']
254265

255266
const userQuery = params?.querystring
256267
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
@@ -280,7 +291,11 @@ export default class AsyncSearch {
280291
name: 'async_search.status',
281292
pathParts: {
282293
id: params.id
283-
}
294+
},
295+
acceptedParams: [
296+
'id',
297+
'keep_alive'
298+
]
284299
}
285300
return await this.transport.request({ path, method, querystring, body, meta }, options)
286301
}
@@ -297,7 +312,7 @@ export default class AsyncSearch {
297312
path: acceptedPath,
298313
body: acceptedBody,
299314
query: acceptedQuery
300-
} = this.acceptedParams['async_search.submit']
315+
} = this[kAcceptedParams]['async_search.submit']
301316

302317
const userQuery = params?.querystring
303318
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
@@ -349,7 +364,87 @@ export default class AsyncSearch {
349364
name: 'async_search.submit',
350365
pathParts: {
351366
index: params.index
352-
}
367+
},
368+
acceptedParams: [
369+
'index',
370+
'aggregations',
371+
'aggs',
372+
'collapse',
373+
'explain',
374+
'ext',
375+
'from',
376+
'highlight',
377+
'track_total_hits',
378+
'indices_boost',
379+
'docvalue_fields',
380+
'knn',
381+
'min_score',
382+
'post_filter',
383+
'profile',
384+
'query',
385+
'rescore',
386+
'script_fields',
387+
'search_after',
388+
'size',
389+
'slice',
390+
'sort',
391+
'_source',
392+
'fields',
393+
'suggest',
394+
'terminate_after',
395+
'timeout',
396+
'track_scores',
397+
'version',
398+
'seq_no_primary_term',
399+
'stored_fields',
400+
'pit',
401+
'runtime_mappings',
402+
'stats',
403+
'wait_for_completion_timeout',
404+
'keep_alive',
405+
'keep_on_completion',
406+
'allow_no_indices',
407+
'allow_partial_search_results',
408+
'analyzer',
409+
'analyze_wildcard',
410+
'batched_reduce_size',
411+
'ccs_minimize_roundtrips',
412+
'default_operator',
413+
'df',
414+
'docvalue_fields',
415+
'expand_wildcards',
416+
'explain',
417+
'ignore_throttled',
418+
'ignore_unavailable',
419+
'lenient',
420+
'max_concurrent_shard_requests',
421+
'preference',
422+
'project_routing',
423+
'request_cache',
424+
'routing',
425+
'search_type',
426+
'stats',
427+
'stored_fields',
428+
'suggest_field',
429+
'suggest_mode',
430+
'suggest_size',
431+
'suggest_text',
432+
'terminate_after',
433+
'timeout',
434+
'track_total_hits',
435+
'track_scores',
436+
'typed_keys',
437+
'rest_total_hits_as_int',
438+
'version',
439+
'_source',
440+
'_source_excludes',
441+
'_source_includes',
442+
'seq_no_primary_term',
443+
'q',
444+
'size',
445+
'from',
446+
'sort'
447+
]
353448
}
354449
return await this.transport.request({ path, method, querystring, body, meta }, options)
355450
}

src/api/api/autoscaling.ts

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,21 @@ import {
2121
TransportResult
2222
} from '@elastic/transport'
2323
import * as T from '../types'
24+
import { kAcceptedParams } from '../../client'
2425

2526
interface That {
2627
transport: Transport
27-
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
28+
[kAcceptedParams]: Record<string, { path: string[], body: string[], query: string[] }>
2829
}
2930

3031
const commonQueryParams = ['error_trace', 'filter_path', 'human', 'pretty']
3132

3233
export default class Autoscaling {
3334
transport: Transport
34-
acceptedParams: Record<string, { path: string[], body: string[], query: string[] }>
35+
[kAcceptedParams]: Record<string, { path: string[], body: string[], query: string[] }>
3536
constructor (transport: Transport) {
3637
this.transport = transport
37-
this.acceptedParams = {
38+
this[kAcceptedParams] = {
3839
'autoscaling.delete_autoscaling_policy': {
3940
path: [
4041
'name'
@@ -86,7 +87,7 @@ export default class Autoscaling {
8687
async deleteAutoscalingPolicy (this: That, params: T.AutoscalingDeleteAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise<any> {
8788
const {
8889
path: acceptedPath
89-
} = this.acceptedParams['autoscaling.delete_autoscaling_policy']
90+
} = this[kAcceptedParams]['autoscaling.delete_autoscaling_policy']
9091

9192
const userQuery = params?.querystring
9293
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
@@ -116,7 +117,12 @@ export default class Autoscaling {
116117
name: 'autoscaling.delete_autoscaling_policy',
117118
pathParts: {
118119
name: params.name
119-
}
120+
},
121+
acceptedParams: [
122+
'name',
123+
'master_timeout',
124+
'timeout'
125+
]
120126
}
121127
return await this.transport.request({ path, method, querystring, body, meta }, options)
122128
}
@@ -131,7 +137,7 @@ export default class Autoscaling {
131137
async getAutoscalingCapacity (this: That, params?: T.AutoscalingGetAutoscalingCapacityRequest, options?: TransportRequestOptions): Promise<any> {
132138
const {
133139
path: acceptedPath
134-
} = this.acceptedParams['autoscaling.get_autoscaling_capacity']
140+
} = this[kAcceptedParams]['autoscaling.get_autoscaling_capacity']
135141

136142
const userQuery = params?.querystring
137143
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
@@ -159,7 +165,10 @@ export default class Autoscaling {
159165
const method = 'GET'
160166
const path = '/_autoscaling/capacity'
161167
const meta: TransportRequestMetadata = {
162-
name: 'autoscaling.get_autoscaling_capacity'
168+
name: 'autoscaling.get_autoscaling_capacity',
169+
acceptedParams: [
170+
'master_timeout'
171+
]
163172
}
164173
return await this.transport.request({ path, method, querystring, body, meta }, options)
165174
}
@@ -174,7 +183,7 @@ export default class Autoscaling {
174183
async getAutoscalingPolicy (this: That, params: T.AutoscalingGetAutoscalingPolicyRequest, options?: TransportRequestOptions): Promise<any> {
175184
const {
176185
path: acceptedPath
177-
} = this.acceptedParams['autoscaling.get_autoscaling_policy']
186+
} = this[kAcceptedParams]['autoscaling.get_autoscaling_policy']
178187

179188
const userQuery = params?.querystring
180189
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
@@ -204,7 +213,11 @@ export default class Autoscaling {
204213
name: 'autoscaling.get_autoscaling_policy',
205214
pathParts: {
206215
name: params.name
207-
}
216+
},
217+
acceptedParams: [
218+
'name',
219+
'master_timeout'
220+
]
208221
}
209222
return await this.transport.request({ path, method, querystring, body, meta }, options)
210223
}
@@ -221,7 +234,7 @@ export default class Autoscaling {
221234
path: acceptedPath,
222235
body: acceptedBody,
223236
query: acceptedQuery
224-
} = this.acceptedParams['autoscaling.put_autoscaling_policy']
237+
} = this[kAcceptedParams]['autoscaling.put_autoscaling_policy']
225238

226239
const userQuery = params?.querystring
227240
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}
@@ -251,7 +264,13 @@ export default class Autoscaling {
251264
name: 'autoscaling.put_autoscaling_policy',
252265
pathParts: {
253266
name: params.name
254-
}
267+
},
268+
acceptedParams: [
269+
'name',
270+
'policy',
271+
'master_timeout',
272+
'timeout'
273+
]
255274
}
256275
return await this.transport.request({ path, method, querystring, body, meta }, options)
257276
}

src/api/api/bulk.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,23 @@ export default async function BulkApi<TDocument = unknown, TPartialDocument = un
102102
name: 'bulk',
103103
pathParts: {
104104
index: params.index
105-
}
105+
},
106+
acceptedParams: [
107+
'index',
108+
'operations',
109+
'include_source_on_error',
110+
'list_executed_pipelines',
111+
'pipeline',
112+
'refresh',
113+
'routing',
114+
'_source',
115+
'_source_excludes',
116+
'_source_includes',
117+
'timeout',
118+
'wait_for_active_shards',
119+
'require_alias',
120+
'require_data_stream'
121+
]
106122
}
107123
return await this.transport.request({ path, method, querystring, bulkBody: body, meta }, options)
108124
}

src/api/api/capabilities.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ export default async function CapabilitiesApi (this: That, params?: T.TODO, opti
7171
const method = 'GET'
7272
const path = '/_capabilities'
7373
const meta: TransportRequestMetadata = {
74-
name: 'capabilities'
74+
name: 'capabilities',
75+
acceptedParams: [
76+
]
7577
}
7678
return await this.transport.request({ path, method, querystring, body, meta }, options)
7779
}

0 commit comments

Comments
 (0)