Skip to content

Auto-generated code for main #2908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 71 additions & 14 deletions docs/reference/api-reference.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/api/api/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default class Cluster {
body: [],
query: [
'flat_settings',
'settings_filter',
'include_defaults',
'local',
'master_timeout'
Expand Down Expand Up @@ -155,6 +156,7 @@ export default class Cluster {
],
query: [
'create',
'cause',
'master_timeout'
]
},
Expand Down
1 change: 1 addition & 0 deletions src/api/api/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const acceptedParams: Record<string, { path: string[], body: string[], query: st
'routing',
'_source',
'_source_excludes',
'_source_exclude_vectors',
'_source_includes',
'stored_fields',
'version',
Expand Down
1 change: 0 additions & 1 deletion src/api/api/get_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const acceptedParams: Record<string, { path: string[], body: string[], query: st
'_source',
'_source_excludes',
'_source_includes',
'stored_fields',
'version',
'version_type'
]
Expand Down
3 changes: 2 additions & 1 deletion src/api/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ const acceptedParams: Record<string, { path: string[], body: string[], query: st
'version',
'version_type',
'wait_for_active_shards',
'require_alias'
'require_alias',
'require_data_stream'
]
}
}
Expand Down
70 changes: 40 additions & 30 deletions src/api/api/indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,9 @@ export default class Indices {
'name'
],
body: [],
query: []
query: [
'master_timeout'
]
},
'indices.get_data_stream_options': {
path: [
Expand Down Expand Up @@ -600,8 +602,14 @@ export default class Indices {
path: [
'name'
],
body: [],
query: []
body: [
'mappings'
],
query: [
'dry_run',
'master_timeout',
'timeout'
]
},
'indices.put_data_stream_options': {
path: [
Expand Down Expand Up @@ -2507,13 +2515,13 @@ export default class Indices {
}

/**
* Gets a data stream's mappings
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html | Elasticsearch API documentation}
* Get data stream mappings. Get mapping information for one or more data streams.
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream-mappings | Elasticsearch API documentation}
*/
async getDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async getDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async getDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async getDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
async getDataStreamMappings (this: That, params: T.IndicesGetDataStreamMappingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesGetDataStreamMappingsResponse>
async getDataStreamMappings (this: That, params: T.IndicesGetDataStreamMappingsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesGetDataStreamMappingsResponse, unknown>>
async getDataStreamMappings (this: That, params: T.IndicesGetDataStreamMappingsRequest, options?: TransportRequestOptions): Promise<T.IndicesGetDataStreamMappingsResponse>
async getDataStreamMappings (this: That, params: T.IndicesGetDataStreamMappingsRequest, options?: TransportRequestOptions): Promise<any> {
const {
path: acceptedPath
} = this.acceptedParams['indices.get_data_stream_mappings']
Expand All @@ -2531,11 +2539,11 @@ export default class Indices {
}
}

params = params ?? {}
for (const key in params) {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body' && key !== 'querystring') {
// @ts-expect-error
querystring[key] = params[key]
}
}
Expand Down Expand Up @@ -3314,36 +3322,38 @@ export default class Indices {
}

/**
* Updates a data stream's mappings
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/master/data-streams.html | Elasticsearch API documentation}
* Update data stream mappings. This API can be used to override mappings on specific data streams. These overrides will take precedence over what is specified in the template that the data stream matches. The mapping change is only applied to new write indices that are created during rollover after this API is called. No indices are changed by this API.
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-stream-mappings | Elasticsearch API documentation}
*/
async putDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async putDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async putDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async putDataStreamMappings (this: That, params?: T.TODO, options?: TransportRequestOptions): Promise<any> {
async putDataStreamMappings (this: That, params: T.IndicesPutDataStreamMappingsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.IndicesPutDataStreamMappingsResponse>
async putDataStreamMappings (this: That, params: T.IndicesPutDataStreamMappingsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.IndicesPutDataStreamMappingsResponse, unknown>>
async putDataStreamMappings (this: That, params: T.IndicesPutDataStreamMappingsRequest, options?: TransportRequestOptions): Promise<T.IndicesPutDataStreamMappingsResponse>
async putDataStreamMappings (this: That, params: T.IndicesPutDataStreamMappingsRequest, options?: TransportRequestOptions): Promise<any> {
const {
path: acceptedPath
path: acceptedPath,
body: acceptedBody,
query: acceptedQuery
} = this.acceptedParams['indices.put_data_stream_mappings']

const userQuery = params?.querystring
const querystring: Record<string, any> = userQuery != null ? { ...userQuery } : {}

let body: Record<string, any> | string | undefined
const userBody = params?.body
if (userBody != null) {
if (typeof userBody === 'string') {
body = userBody
} else {
body = { ...userBody }
}
}

params = params ?? {}
let body: any = params.body ?? undefined
for (const key in params) {
if (acceptedPath.includes(key)) {
if (acceptedBody.includes(key)) {
// @ts-expect-error
body = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body' && key !== 'querystring') {
querystring[key] = params[key]
if (acceptedQuery.includes(key) || commonQueryParams.includes(key)) {
// @ts-expect-error
querystring[key] = params[key]
} else {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/api/api/inference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export default class Inference {
body: [
'query',
'input',
'input_type',
'task_settings'
],
query: [
Expand Down Expand Up @@ -1751,7 +1752,7 @@ export default class Inference {
}

/**
* Perform rereanking inference on the service
* Perform reranking inference on the service
* @see {@link https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-inference | Elasticsearch API documentation}
*/
async rerank (this: That, params: T.InferenceRerankRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.InferenceRerankResponse>
Expand Down
4 changes: 1 addition & 3 deletions src/api/api/ingest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ export default class Ingest {
'id'
],
body: [],
query: [
'master_timeout'
]
query: []
},
'ingest.get_pipeline': {
path: [
Expand Down
2 changes: 1 addition & 1 deletion src/api/api/license.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default class License {
body: [],
query: [
'acknowledge',
'type_query_string',
'type',
'master_timeout'
]
}
Expand Down
1 change: 1 addition & 0 deletions src/api/api/reindex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const acceptedParams: Record<string, { path: string[], body: string[], query: st
'requests_per_second',
'scroll',
'slices',
'max_docs',
'timeout',
'wait_for_active_shards',
'wait_for_completion',
Expand Down
1 change: 1 addition & 0 deletions src/api/api/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const acceptedParams: Record<string, { path: string[], body: string[], query: st
'version',
'_source',
'_source_excludes',
'_source_exclude_vectors',
'_source_includes',
'seq_no_primary_term',
'q',
Expand Down
1 change: 1 addition & 0 deletions src/api/api/search_mvt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const acceptedParams: Record<string, { path: string[], body: string[], query: st
'grid_precision',
'grid_type',
'size',
'track_total_hits',
'with_labels'
]
}
Expand Down
10 changes: 4 additions & 6 deletions src/api/api/security.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,7 @@ export default class Security {
'security.get_user_privileges': {
path: [],
body: [],
query: [
'application',
'priviledge',
'username'
]
query: []
},
'security.get_user_profile': {
path: [
Expand All @@ -376,7 +372,9 @@ export default class Security {
'password',
'run_as'
],
query: []
query: [
'refresh'
]
},
'security.has_privileges': {
path: [
Expand Down
3 changes: 2 additions & 1 deletion src/api/api/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ export default class Snapshot {
],
body: [],
query: [
'master_timeout'
'master_timeout',
'wait_for_completion'
]
},
'snapshot.delete_repository': {
Expand Down
Loading
Loading