Skip to content

Commit 9cd4160

Browse files
Auto-generated code for main (#89)
Auto-generated API code
1 parent edc45f0 commit 9cd4160

File tree

6 files changed

+608
-162
lines changed

6 files changed

+608
-162
lines changed

docs/reference.asciidoc

Lines changed: 30 additions & 23 deletions
Large diffs are not rendered by default.

src/api/api/ingest.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export default class Ingest {
155155
async putPipeline (this: That, params: T.IngestPutPipelineRequest | TB.IngestPutPipelineRequest, options?: TransportRequestOptions): Promise<T.IngestPutPipelineResponse>
156156
async putPipeline (this: That, params: T.IngestPutPipelineRequest | TB.IngestPutPipelineRequest, options?: TransportRequestOptions): Promise<any> {
157157
const acceptedPath: string[] = ['id']
158-
const acceptedBody: string[] = ['_meta', 'description', 'on_failure', 'processors', 'version']
158+
const acceptedBody: string[] = ['_meta', 'description', 'on_failure', 'processors', 'version', 'deprecated']
159159
const querystring: Record<string, any> = {}
160160
// @ts-expect-error
161161
const userBody: any = params?.body
@@ -194,10 +194,10 @@ export default class Ingest {
194194
* Executes an ingest pipeline against a set of provided documents.
195195
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html | Elasticsearch API documentation}
196196
*/
197-
async simulate (this: That, params?: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestSimulateResponse>
198-
async simulate (this: That, params?: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IngestSimulateResponse, unknown>>
199-
async simulate (this: That, params?: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptions): Promise<T.IngestSimulateResponse>
200-
async simulate (this: That, params?: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptions): Promise<any> {
197+
async simulate (this: That, params: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IngestSimulateResponse>
198+
async simulate (this: That, params: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IngestSimulateResponse, unknown>>
199+
async simulate (this: That, params: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptions): Promise<T.IngestSimulateResponse>
200+
async simulate (this: That, params: T.IngestSimulateRequest | TB.IngestSimulateRequest, options?: TransportRequestOptions): Promise<any> {
201201
const acceptedPath: string[] = ['id']
202202
const acceptedBody: string[] = ['docs', 'pipeline']
203203
const querystring: Record<string, any> = {}
@@ -210,7 +210,6 @@ export default class Ingest {
210210
body = userBody != null ? { ...userBody } : undefined
211211
}
212212

213-
params = params ?? {}
214213
for (const key in params) {
215214
if (acceptedBody.includes(key)) {
216215
body = body ?? {}

src/api/api/open_point_in_time.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,23 @@ export default async function OpenPointInTimeApi (this: That, params: T.OpenPoin
4747
export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest | TB.OpenPointInTimeRequest, options?: TransportRequestOptions): Promise<T.OpenPointInTimeResponse>
4848
export default async function OpenPointInTimeApi (this: That, params: T.OpenPointInTimeRequest | TB.OpenPointInTimeRequest, options?: TransportRequestOptions): Promise<any> {
4949
const acceptedPath: string[] = ['index']
50+
const acceptedBody: string[] = ['index_filter']
5051
const querystring: Record<string, any> = {}
51-
const body = undefined
52+
// @ts-expect-error
53+
const userBody: any = params?.body
54+
let body: Record<string, any> | string
55+
if (typeof userBody === 'string') {
56+
body = userBody
57+
} else {
58+
body = userBody != null ? { ...userBody } : undefined
59+
}
5260

5361
for (const key in params) {
54-
if (acceptedPath.includes(key)) {
62+
if (acceptedBody.includes(key)) {
63+
body = body ?? {}
64+
// @ts-expect-error
65+
body[key] = params[key]
66+
} else if (acceptedPath.includes(key)) {
5567
continue
5668
} else if (key !== 'body') {
5769
// @ts-expect-error

src/api/api/search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default async function SearchApi<TDocument = unknown, TAggregations = Rec
4747
export default async function SearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise<T.SearchResponse<TDocument, TAggregations>>
4848
export default async function SearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>> (this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise<any> {
4949
const acceptedPath: string[] = ['index']
50-
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'knn', 'rank', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'retriever', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
50+
const acceptedBody: string[] = ['aggregations', 'aggs', 'collapse', 'explain', 'ext', 'from', 'highlight', 'track_total_hits', 'indices_boost', 'docvalue_fields', 'knn', 'min_score', 'post_filter', 'profile', 'query', 'rescore', 'retriever', 'script_fields', 'search_after', 'size', 'slice', 'sort', '_source', 'fields', 'suggest', 'terminate_after', 'timeout', 'track_scores', 'version', 'seq_no_primary_term', 'stored_fields', 'pit', 'runtime_mappings', 'stats']
5151
const querystring: Record<string, any> = {}
5252
// @ts-expect-error
5353
const userBody: any = params?.body

0 commit comments

Comments
 (0)