Skip to content

Commit

Permalink
Auto-generated API code
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Nov 9, 2023
1 parent 538efe0 commit 3a0c983
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
7 changes: 5 additions & 2 deletions docs/reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ If `false`, the response does not include the total number of hits matching the
** *`indices_boost` (Optional, Record<string, number>[])*: Boosts the _score of documents from specified indices.
** *`docvalue_fields` (Optional, { field, format, include_unmapped }[])*: Array of wildcard (`*`) patterns.
The request returns doc values for field names matching these patterns in the `hits.fields` property of the response.
** *`knn` (Optional, { field, query_vector, query_vector_builder, k, num_candidates, boost, filter } | { field, query_vector, query_vector_builder, k, num_candidates, boost, filter }[])*: Defines the approximate kNN search to run.
** *`knn` (Optional, { field, query_vector, query_vector_builder, k, num_candidates, boost, filter, similarity } | { field, query_vector, query_vector_builder, k, num_candidates, boost, filter, similarity }[])*: Defines the approximate kNN search to run.
** *`rank` (Optional, { rrf })*: Defines the Reciprocal Rank Fusion (RRF) to use.
** *`min_score` (Optional, number)*: Minimum `_score` for matching documents.
Documents with a lower `_score` are not included in the search results.
Expand Down Expand Up @@ -1305,7 +1305,7 @@ Defaults to 10,000 hits.
** *`indices_boost` (Optional, Record<string, number>[])*: Boosts the _score of documents from specified indices.
** *`docvalue_fields` (Optional, { field, format, include_unmapped }[])*: Array of wildcard (*) patterns. The request returns doc values for field
names matching these patterns in the hits.fields property of the response.
** *`knn` (Optional, { field, query_vector, query_vector_builder, k, num_candidates, boost, filter } | { field, query_vector, query_vector_builder, k, num_candidates, boost, filter }[])*: Defines the approximate kNN search to run.
** *`knn` (Optional, { field, query_vector, query_vector_builder, k, num_candidates, boost, filter, similarity } | { field, query_vector, query_vector_builder, k, num_candidates, boost, filter, similarity }[])*: Defines the approximate kNN search to run.
** *`min_score` (Optional, number)*: Minimum _score for matching documents. Documents with a lower _score are
not included in the search results.
** *`post_filter` (Optional, { bool, boosting, common, combined_fields, constant_score, dis_max, distance_feature, exists, function_score, fuzzy, geo_bounding_box, geo_distance, geo_polygon, geo_shape, has_child, has_parent, ids, intervals, match, match_all, match_bool_prefix, match_none, match_phrase, match_phrase_prefix, more_like_this, multi_match, nested, parent_id, percolate, pinned, prefix, query_string, range, rank_feature, regexp, rule_query, script, script_score, shape, simple_query_string, span_containing, field_masking_span, span_first, span_multi, span_near, span_not, span_or, span_term, span_within, term, terms, terms_set, text_expansion, wildcard, wrapper, type })*
Expand Down Expand Up @@ -6234,6 +6234,7 @@ client.ml.putTrainedModelVocabulary({ model_id, vocabulary })
** *`model_id` (string)*: The unique identifier of the trained model.
** *`vocabulary` (string[])*: The model vocabulary, which must not be empty.
** *`merges` (Optional, string[])*: The optional model merges if required by the tokenizer.
** *`scores` (Optional, number[])*: The optional vocabulary value scores if required by the tokenizer.

[discrete]
==== reset_job
Expand Down Expand Up @@ -8917,6 +8918,8 @@ client.transform.deleteTransform({ transform_id })
** *`transform_id` (string)*: Identifier for the transform.
** *`force` (Optional, boolean)*: If this value is false, the transform must be stopped before it can be deleted. If true, the transform is
deleted regardless of its current state.
** *`delete_dest_index` (Optional, boolean)*: If this value is true, the destination index is deleted together with the transform. If false, the destination
index will not be deleted
** *`timeout` (Optional, string | -1 | 0)*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

[discrete]
Expand Down
2 changes: 1 addition & 1 deletion src/api/api/ml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1923,7 +1923,7 @@ export default class Ml {
async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest | TB.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptions): Promise<T.MlPutTrainedModelVocabularyResponse>
async putTrainedModelVocabulary (this: That, params: T.MlPutTrainedModelVocabularyRequest | TB.MlPutTrainedModelVocabularyRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['model_id']
const acceptedBody: string[] = ['vocabulary', 'merges']
const acceptedBody: string[] = ['vocabulary', 'merges', 'scores']
const querystring: Record<string, any> = {}
// @ts-expect-error
const userBody: any = params?.body
Expand Down
15 changes: 6 additions & 9 deletions src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ export interface MsearchMultiSearchItem<TDocument = unknown> extends SearchRespo
status?: integer
}

export interface MsearchMultiSearchResult<TDocument = unknown> {
export interface MsearchMultiSearchResult<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> {
took: long
responses: MsearchResponseItem<TDocument>[]
}
Expand Down Expand Up @@ -780,7 +780,7 @@ export interface MsearchRequest extends RequestBase {

export type MsearchRequestItem = MsearchMultisearchHeader | MsearchMultisearchBody

export type MsearchResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> = MsearchMultiSearchResult<TDocument>
export type MsearchResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> = MsearchMultiSearchResult<TDocument, TAggregations>

export type MsearchResponseItem<TDocument = unknown> = MsearchMultiSearchItem<TDocument> | ErrorResponseBase

Expand All @@ -796,7 +796,7 @@ export interface MsearchTemplateRequest extends RequestBase {

export type MsearchTemplateRequestItem = MsearchMultisearchHeader | MsearchTemplateTemplateConfig

export type MsearchTemplateResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> = MsearchMultiSearchResult<TDocument>
export type MsearchTemplateResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> = MsearchMultiSearchResult<TDocument, TAggregations>

export interface MsearchTemplateTemplateConfig {
explain?: boolean
Expand Down Expand Up @@ -1146,7 +1146,6 @@ export interface SearchRequest extends RequestBase {
_source_includes?: Fields
q?: string
aggregations?: Record<string, AggregationsAggregationContainer>
/** @alias aggregations */
aggs?: Record<string, AggregationsAggregationContainer>
collapse?: SearchFieldCollapse
explain?: boolean
Expand Down Expand Up @@ -2272,6 +2271,7 @@ export interface KnnQuery {
num_candidates: long
boost?: float
filter?: QueryDslQueryContainer | QueryDslQueryContainer[]
similarity?: float
}

export interface LatLonGeoLocation {
Expand Down Expand Up @@ -6114,7 +6114,6 @@ export interface AsyncSearchSubmitRequest extends RequestBase {
_source_includes?: Fields
q?: string
aggregations?: Record<string, AggregationsAggregationContainer>
/** @alias aggregations */
aggs?: Record<string, AggregationsAggregationContainer>
collapse?: SearchFieldCollapse
explain?: boolean
Expand Down Expand Up @@ -9196,7 +9195,6 @@ export interface FleetSearchRequest extends RequestBase {
wait_for_checkpoints?: FleetCheckpoint[]
allow_partial_search_results?: boolean
aggregations?: Record<string, AggregationsAggregationContainer>
/** @alias aggregations */
aggs?: Record<string, AggregationsAggregationContainer>
collapse?: SearchFieldCollapse
explain?: boolean
Expand Down Expand Up @@ -13831,7 +13829,6 @@ export interface MlPutDatafeedRequest extends RequestBase {
delayed_data_check_config?: MlDelayedDataCheckConfig
frequency?: Duration
indices?: Indices
/** @alias indices */
indexes?: Indices
indices_options?: IndicesOptions
job_id?: Id
Expand Down Expand Up @@ -14031,6 +14028,7 @@ export interface MlPutTrainedModelVocabularyRequest extends RequestBase {
model_id: Id
vocabulary: string[]
merges?: string[]
scores?: double[]
}

export type MlPutTrainedModelVocabularyResponse = AcknowledgedResponseBase
Expand Down Expand Up @@ -14163,7 +14161,6 @@ export interface MlUpdateDatafeedRequest extends RequestBase {
delayed_data_check_config?: MlDelayedDataCheckConfig
frequency?: Duration
indices?: string[]
/** @alias indices */
indexes?: string[]
indices_options?: IndicesOptions
job_id?: Id
Expand Down Expand Up @@ -15433,7 +15430,6 @@ export interface RollupRollupSearchRequest extends RequestBase {
rest_total_hits_as_int?: boolean
typed_keys?: boolean
aggregations?: Record<string, AggregationsAggregationContainer>
/** @alias aggregations */
aggs?: Record<string, AggregationsAggregationContainer>
query?: QueryDslQueryContainer
size?: integer
Expand Down Expand Up @@ -17361,6 +17357,7 @@ export interface TransformTimeSync {
export interface TransformDeleteTransformRequest extends RequestBase {
transform_id: Id
force?: boolean
delete_dest_index?: boolean
timeout?: Duration
}

Expand Down
15 changes: 6 additions & 9 deletions src/api/typesWithBodyKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ export interface MsearchMultiSearchItem<TDocument = unknown> extends SearchRespo
status?: integer
}

export interface MsearchMultiSearchResult<TDocument = unknown> {
export interface MsearchMultiSearchResult<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> {
took: long
responses: MsearchResponseItem<TDocument>[]
}
Expand Down Expand Up @@ -809,7 +809,7 @@ export interface MsearchRequest extends RequestBase {

export type MsearchRequestItem = MsearchMultisearchHeader | MsearchMultisearchBody

export type MsearchResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> = MsearchMultiSearchResult<TDocument>
export type MsearchResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> = MsearchMultiSearchResult<TDocument, TAggregations>

export type MsearchResponseItem<TDocument = unknown> = MsearchMultiSearchItem<TDocument> | ErrorResponseBase

Expand All @@ -826,7 +826,7 @@ export interface MsearchTemplateRequest extends RequestBase {

export type MsearchTemplateRequestItem = MsearchMultisearchHeader | MsearchTemplateTemplateConfig

export type MsearchTemplateResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> = MsearchMultiSearchResult<TDocument>
export type MsearchTemplateResponse<TDocument = unknown, TAggregations = Record<AggregateName, AggregationsAggregate>> = MsearchMultiSearchResult<TDocument, TAggregations>

export interface MsearchTemplateTemplateConfig {
explain?: boolean
Expand Down Expand Up @@ -1200,7 +1200,6 @@ export interface SearchRequest extends RequestBase {
/** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */
body?: {
aggregations?: Record<string, AggregationsAggregationContainer>
/** @alias aggregations */
aggs?: Record<string, AggregationsAggregationContainer>
collapse?: SearchFieldCollapse
explain?: boolean
Expand Down Expand Up @@ -2345,6 +2344,7 @@ export interface KnnQuery {
num_candidates: long
boost?: float
filter?: QueryDslQueryContainer | QueryDslQueryContainer[]
similarity?: float
}

export interface LatLonGeoLocation {
Expand Down Expand Up @@ -6189,7 +6189,6 @@ export interface AsyncSearchSubmitRequest extends RequestBase {
/** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */
body?: {
aggregations?: Record<string, AggregationsAggregationContainer>
/** @alias aggregations */
aggs?: Record<string, AggregationsAggregationContainer>
collapse?: SearchFieldCollapse
explain?: boolean
Expand Down Expand Up @@ -9306,7 +9305,6 @@ export interface FleetSearchRequest extends RequestBase {
/** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */
body?: {
aggregations?: Record<string, AggregationsAggregationContainer>
/** @alias aggregations */
aggs?: Record<string, AggregationsAggregationContainer>
collapse?: SearchFieldCollapse
explain?: boolean
Expand Down Expand Up @@ -14078,7 +14076,6 @@ export interface MlPutDatafeedRequest extends RequestBase {
delayed_data_check_config?: MlDelayedDataCheckConfig
frequency?: Duration
indices?: Indices
/** @alias indices */
indexes?: Indices
indices_options?: IndicesOptions
job_id?: Id
Expand Down Expand Up @@ -14293,6 +14290,7 @@ export interface MlPutTrainedModelVocabularyRequest extends RequestBase {
body?: {
vocabulary: string[]
merges?: string[]
scores?: double[]
}
}

Expand Down Expand Up @@ -14440,7 +14438,6 @@ export interface MlUpdateDatafeedRequest extends RequestBase {
delayed_data_check_config?: MlDelayedDataCheckConfig
frequency?: Duration
indices?: string[]
/** @alias indices */
indexes?: string[]
indices_options?: IndicesOptions
job_id?: Id
Expand Down Expand Up @@ -15736,7 +15733,6 @@ export interface RollupRollupSearchRequest extends RequestBase {
/** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */
body?: {
aggregations?: Record<string, AggregationsAggregationContainer>
/** @alias aggregations */
aggs?: Record<string, AggregationsAggregationContainer>
query?: QueryDslQueryContainer
size?: integer
Expand Down Expand Up @@ -17771,6 +17767,7 @@ export interface TransformTimeSync {
export interface TransformDeleteTransformRequest extends RequestBase {
transform_id: Id
force?: boolean
delete_dest_index?: boolean
timeout?: Duration
}

Expand Down

0 comments on commit 3a0c983

Please sign in to comment.