diff --git a/config/version-serverless.txt b/config/version-serverless.txt index db3905bf8..3eefcb9dd 100644 --- a/config/version-serverless.txt +++ b/config/version-serverless.txt @@ -1 +1 @@ -8.11.0 +1.0.0 diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java index 77b7cb210..70ae7c8a6 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java @@ -94,6 +94,7 @@ import co.elastic.clients.elasticsearch.core.UpdateResponse; import co.elastic.clients.elasticsearch.enrich.ElasticsearchEnrichAsyncClient; import co.elastic.clients.elasticsearch.eql.ElasticsearchEqlAsyncClient; +import co.elastic.clients.elasticsearch.esql.ElasticsearchEsqlAsyncClient; import co.elastic.clients.elasticsearch.graph.ElasticsearchGraphAsyncClient; import co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesAsyncClient; import co.elastic.clients.elasticsearch.inference.ElasticsearchInferenceAsyncClient; @@ -101,6 +102,7 @@ import co.elastic.clients.elasticsearch.license.ElasticsearchLicenseAsyncClient; import co.elastic.clients.elasticsearch.logstash.ElasticsearchLogstashAsyncClient; import co.elastic.clients.elasticsearch.ml.ElasticsearchMlAsyncClient; +import co.elastic.clients.elasticsearch.query_rule.ElasticsearchQueryRuleAsyncClient; import co.elastic.clients.elasticsearch.query_ruleset.ElasticsearchQueryRulesetAsyncClient; import co.elastic.clients.elasticsearch.search_application.ElasticsearchSearchApplicationAsyncClient; import co.elastic.clients.elasticsearch.security.ElasticsearchSecurityAsyncClient; @@ -177,6 +179,10 @@ public ElasticsearchEqlAsyncClient eql() { return new ElasticsearchEqlAsyncClient(this.transport, this.transportOptions); } + public ElasticsearchEsqlAsyncClient esql() { + return new ElasticsearchEsqlAsyncClient(this.transport, this.transportOptions); + } + public ElasticsearchGraphAsyncClient graph() { return new ElasticsearchGraphAsyncClient(this.transport, this.transportOptions); } @@ -205,6 +211,10 @@ public ElasticsearchMlAsyncClient ml() { return new ElasticsearchMlAsyncClient(this.transport, this.transportOptions); } + public ElasticsearchQueryRuleAsyncClient queryRule() { + return new ElasticsearchQueryRuleAsyncClient(this.transport, this.transportOptions); + } + public ElasticsearchQueryRulesetAsyncClient queryRuleset() { return new ElasticsearchQueryRulesetAsyncClient(this.transport, this.transportOptions); } @@ -236,11 +246,11 @@ public ElasticsearchTransformAsyncClient transform() { // ----- Endpoint: bulk /** - * Allows to perform multiple index/update/delete operations in a single - * request. + * Performs multiple indexing or delete operations in a single API call. This + * reduces overhead and can greatly increase indexing speed. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/docs-bulk.html">Documentation * on elastic.co */ @@ -252,14 +262,14 @@ public CompletableFuture bulk(BulkRequest request) { } /** - * Allows to perform multiple index/update/delete operations in a single - * request. + * Performs multiple indexing or delete operations in a single API call. This + * reduces overhead and can greatly increase indexing speed. * * @param fn * a function that initializes a builder to create the * {@link BulkRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/docs-bulk.html">Documentation * on elastic.co */ @@ -268,11 +278,11 @@ public final CompletableFuture bulk(FunctionDocumentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/docs-bulk.html">Documentation * on elastic.co */ @@ -284,10 +294,10 @@ public CompletableFuture bulk() { // ----- Endpoint: clear_scroll /** - * Explicitly clears the search context for a scroll. + * Clears the search context and results for a scrolling search. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/clear-scroll-api.html">Documentation * on elastic.co */ @@ -299,13 +309,13 @@ public CompletableFuture clearScroll(ClearScrollRequest req } /** - * Explicitly clears the search context for a scroll. + * Clears the search context and results for a scrolling search. * * @param fn * a function that initializes a builder to create the * {@link ClearScrollRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/clear-scroll-api.html">Documentation * on elastic.co */ @@ -315,10 +325,10 @@ public final CompletableFuture clearScroll( } /** - * Explicitly clears the search context for a scroll. + * Clears the search context and results for a scrolling search. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/clear-scroll-api.html">Documentation * on elastic.co */ @@ -330,10 +340,10 @@ public CompletableFuture clearScroll() { // ----- Endpoint: close_point_in_time /** - * Close a point in time + * Closes a point-in-time. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/point-in-time-api.html">Documentation * on elastic.co */ @@ -345,13 +355,13 @@ public CompletableFuture closePointInTime(ClosePointIn } /** - * Close a point in time + * Closes a point-in-time. * * @param fn * a function that initializes a builder to create the * {@link ClosePointInTimeRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/point-in-time-api.html">Documentation * on elastic.co */ @@ -409,10 +419,9 @@ public CompletableFuture count() { // ----- Endpoint: create /** - * Creates a new document in the index. - *

- * Returns a 409 response when a document with a same ID already exists in the - * index. + * Adds a JSON document to the specified data stream or index and makes it + * searchable. If the target is an index and the document already exists, the + * request updates the document and increments its version. * * @see Documentation @@ -427,10 +436,9 @@ public CompletableFuture create(CreateRequest - * Returns a 409 response when a document with a same ID already exists in the - * index. + * Adds a JSON document to the specified data stream or index and makes it + * searchable. If the target is an index and the document already exists, the + * request updates the document and increments its version. * * @param fn * a function that initializes a builder to create the @@ -448,7 +456,7 @@ public final CompletableFuture create( // ----- Endpoint: delete /** - * Removes a document from the index. + * Removes a JSON document from the specified index. * * @see Documentation @@ -463,7 +471,7 @@ public CompletableFuture delete(DeleteRequest request) { } /** - * Removes a document from the index. + * Removes a JSON document from the specified index. * * @param fn * a function that initializes a builder to create the @@ -481,7 +489,7 @@ public final CompletableFuture delete( // ----- Endpoint: delete_by_query /** - * Deletes documents matching the provided query. + * Deletes documents that match the specified query. * * @see Documentation @@ -496,7 +504,7 @@ public CompletableFuture deleteByQuery(DeleteByQueryReque } /** - * Deletes documents matching the provided query. + * Deletes documents that match the specified query. * * @param fn * a function that initializes a builder to create the @@ -514,7 +522,7 @@ public final CompletableFuture deleteByQuery( // ----- Endpoint: delete_script /** - * Deletes a script. + * Deletes a stored script or search template. * * @see Documentation @@ -529,7 +537,7 @@ public CompletableFuture deleteScript(DeleteScriptRequest } /** - * Deletes a script. + * Deletes a stored script or search template. * * @param fn * a function that initializes a builder to create the @@ -547,7 +555,7 @@ public final CompletableFuture deleteScript( // ----- Endpoint: exists /** - * Returns information about whether a document exists in an index. + * Checks if a document in an index exists. * * @see Documentation @@ -562,7 +570,7 @@ public CompletableFuture exists(ExistsRequest request) { } /** - * Returns information about whether a document exists in an index. + * Checks if a document in an index exists. * * @param fn * a function that initializes a builder to create the @@ -580,7 +588,7 @@ public final CompletableFuture exists( // ----- Endpoint: exists_source /** - * Returns information about whether a document source exists in an index. + * Checks if a document's _source is stored. * * @see Documentation @@ -595,7 +603,7 @@ public CompletableFuture existsSource(ExistsSourceRequest reque } /** - * Returns information about whether a document source exists in an index. + * Checks if a document's _source is stored. * * @param fn * a function that initializes a builder to create the @@ -613,7 +621,8 @@ public final CompletableFuture existsSource( // ----- Endpoint: explain /** - * Returns information about why a specific matches (or doesn't match) a query. + * Returns information about why a specific document matches (or doesn’t match) + * a query. * * @see Documentation @@ -625,13 +634,14 @@ public CompletableFuture> explain(Explain @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ExplainRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.explain.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.explain.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Returns information about why a specific matches (or doesn't match) a query. + * Returns information about why a specific document matches (or doesn’t match) + * a query. * * @param fn * a function that initializes a builder to create the @@ -647,7 +657,8 @@ public final CompletableFuture> explain( } /** - * Returns information about why a specific matches (or doesn't match) a query. + * Returns information about why a specific document matches (or doesn’t match) + * a query. * * @see Documentation @@ -659,13 +670,14 @@ public CompletableFuture> explain(Explain @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ExplainRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.explain.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.explain.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Returns information about why a specific matches (or doesn't match) a query. + * Returns information about why a specific document matches (or doesn’t match) + * a query. * * @param fn * a function that initializes a builder to create the @@ -683,8 +695,11 @@ public final CompletableFuture> explain( // ----- Endpoint: field_caps /** - * Returns the information about the capabilities of fields among multiple - * indices. + * The field capabilities API returns the information about the capabilities of + * fields among multiple indices. The field capabilities API returns runtime + * fields like any other field. For example, a runtime field with a type of + * keyword is returned as any other field that belongs to the + * keyword family. * * @see Documentation @@ -699,8 +714,11 @@ public CompletableFuture fieldCaps(FieldCapsRequest request) } /** - * Returns the information about the capabilities of fields among multiple - * indices. + * The field capabilities API returns the information about the capabilities of + * fields among multiple indices. The field capabilities API returns runtime + * fields like any other field. For example, a runtime field with a type of + * keyword is returned as any other field that belongs to the + * keyword family. * * @param fn * a function that initializes a builder to create the @@ -716,8 +734,11 @@ public final CompletableFuture fieldCaps( } /** - * Returns the information about the capabilities of fields among multiple - * indices. + * The field capabilities API returns the information about the capabilities of + * fields among multiple indices. The field capabilities API returns runtime + * fields like any other field. For example, a runtime field with a type of + * keyword is returned as any other field that belongs to the + * keyword family. * * @see Documentation @@ -744,7 +765,7 @@ public CompletableFuture> get(GetRequest requ @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.get.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } @@ -777,7 +798,7 @@ public CompletableFuture> get(GetRequest requ @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.get.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } @@ -801,7 +822,7 @@ public final CompletableFuture> get( // ----- Endpoint: get_script /** - * Returns a script. + * Retrieves a stored script or search template. * * @see Documentation @@ -816,7 +837,7 @@ public CompletableFuture getScript(GetScriptRequest request) } /** - * Returns a script. + * Retrieves a stored script or search template. * * @param fn * a function that initializes a builder to create the @@ -846,7 +867,8 @@ public CompletableFuture> getSource(Get @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetSourceRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get_source.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.get_source.Response.TDocument", + getDeserializer(tDocumentClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } @@ -880,7 +902,8 @@ public CompletableFuture> getSource(Get @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetSourceRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get_source.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.get_source.Response.TDocument", + getDeserializer(tDocumentType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } @@ -904,7 +927,9 @@ public final CompletableFuture> getSour // ----- Endpoint: index /** - * Creates or updates a document in an index. + * Adds a JSON document to the specified data stream or index and makes it + * searchable. If the target is an index and the document already exists, the + * request updates the document and increments its version. * * @see Documentation @@ -919,7 +944,9 @@ public CompletableFuture index(IndexRequest CompletableFuture> mget(MgetRequest r @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.mget.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.mget.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } @@ -995,7 +1022,7 @@ public CompletableFuture> mget(MgetRequest r @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.mget.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.mget.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } @@ -1031,7 +1058,7 @@ public CompletableFuture> msearch(Msearch @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.msearch.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } @@ -1065,7 +1092,7 @@ public CompletableFuture> msearch(Msearch @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.msearch.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } @@ -1089,7 +1116,7 @@ public final CompletableFuture> msearch( // ----- Endpoint: msearch_template /** - * Allows to execute several search template operations in one request. + * Runs multiple templated searches with a single request. * * @see Documentation @@ -1101,13 +1128,14 @@ public CompletableFuture> msearch @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchTemplateRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch_template.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.msearch_template.Response.TDocument", + getDeserializer(tDocumentClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Allows to execute several search template operations in one request. + * Runs multiple templated searches with a single request. * * @param fn * a function that initializes a builder to create the @@ -1124,7 +1152,7 @@ public final CompletableFuture> m } /** - * Allows to execute several search template operations in one request. + * Runs multiple templated searches with a single request. * * @see Documentation @@ -1136,13 +1164,14 @@ public CompletableFuture> msearch @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchTemplateRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch_template.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.msearch_template.Response.TDocument", + getDeserializer(tDocumentType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Allows to execute several search template operations in one request. + * Runs multiple templated searches with a single request. * * @param fn * a function that initializes a builder to create the @@ -1206,10 +1235,17 @@ public CompletableFuture mtermvectors() { // ----- Endpoint: open_point_in_time /** - * Open a point in time that can be used in subsequent searches + * A search request by default executes against the most recent visible data of + * the target indices, which is called point in time. Elasticsearch pit (point + * in time) is a lightweight view into the state of the data as it existed when + * initiated. In some cases, it’s preferred to perform multiple search requests + * using the same point in time. For example, if refreshes happen between + * search_after requests, then the results of those requests might + * not be consistent as changes happening between searches are only visible to + * the more recent point in time. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/point-in-time-api.html">Documentation * on elastic.co */ @@ -1221,13 +1257,20 @@ public CompletableFuture openPointInTime(OpenPointInTim } /** - * Open a point in time that can be used in subsequent searches + * A search request by default executes against the most recent visible data of + * the target indices, which is called point in time. Elasticsearch pit (point + * in time) is a lightweight view into the state of the data as it existed when + * initiated. In some cases, it’s preferred to perform multiple search requests + * using the same point in time. For example, if refreshes happen between + * search_after requests, then the results of those requests might + * not be consistent as changes happening between searches are only visible to + * the more recent point in time. * * @param fn * a function that initializes a builder to create the * {@link OpenPointInTimeRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/point-in-time-api.html">Documentation * on elastic.co */ @@ -1252,7 +1295,7 @@ public CompletableFuture ping() { // ----- Endpoint: put_script /** - * Creates or updates a script. + * Creates or updates a stored script or search template. * * @see Documentation @@ -1267,7 +1310,7 @@ public CompletableFuture putScript(PutScriptRequest request) } /** - * Creates or updates a script. + * Creates or updates a stored script or search template. * * @param fn * a function that initializes a builder to create the @@ -1285,8 +1328,8 @@ public final CompletableFuture putScript( // ----- Endpoint: rank_eval /** - * Allows to evaluate the quality of ranked search results over a set of typical - * search queries + * Enables you to evaluate the quality of ranked search results over a set of + * typical search queries. * * @see Documentation @@ -1301,8 +1344,8 @@ public CompletableFuture rankEval(RankEvalRequest request) { } /** - * Allows to evaluate the quality of ranked search results over a set of typical - * search queries + * Enables you to evaluate the quality of ranked search results over a set of + * typical search queries. * * @param fn * a function that initializes a builder to create the @@ -1357,7 +1400,7 @@ public final CompletableFuture reindex( // ----- Endpoint: render_search_template /** - * Allows to use the Mustache language to pre-render a search definition. + * Renders a search template as a search request body. * * @see Documentation @@ -1372,7 +1415,7 @@ public CompletableFuture renderSearchTemplate(Rend } /** - * Allows to use the Mustache language to pre-render a search definition. + * Renders a search template as a search request body. * * @param fn * a function that initializes a builder to create the @@ -1388,7 +1431,7 @@ public final CompletableFuture renderSearchTemplat } /** - * Allows to use the Mustache language to pre-render a search definition. + * Renders a search template as a search request body. * * @see Documentation @@ -1403,7 +1446,7 @@ public CompletableFuture renderSearchTemplate() { // ----- Endpoint: scripts_painless_execute /** - * Allows an arbitrary script to be executed and a result to be returned + * Runs a script and returns a result. * * @see Documentation @@ -1415,14 +1458,14 @@ public CompletableFuture> scri @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScriptsPainlessExecuteRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scripts_painless_execute.TResult", + "co.elastic.clients:Deserializer:_global.scripts_painless_execute.Response.TResult", getDeserializer(tResultClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Allows an arbitrary script to be executed and a result to be returned + * Runs a script and returns a result. * * @param fn * a function that initializes a builder to create the @@ -1439,7 +1482,7 @@ public final CompletableFuture } /** - * Allows an arbitrary script to be executed and a result to be returned + * Runs a script and returns a result. * * @see Documentation @@ -1451,14 +1494,14 @@ public CompletableFuture> scri @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScriptsPainlessExecuteRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scripts_painless_execute.TResult", + "co.elastic.clients:Deserializer:_global.scripts_painless_execute.Response.TResult", getDeserializer(tResultType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Allows an arbitrary script to be executed and a result to be returned + * Runs a script and returns a result. * * @param fn * a function that initializes a builder to create the @@ -1489,7 +1532,7 @@ public CompletableFuture> scroll(ScrollReq @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scroll.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.scroll.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } @@ -1522,7 +1565,7 @@ public CompletableFuture> scroll(ScrollReq @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scroll.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.scroll.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } @@ -1546,7 +1589,9 @@ public final CompletableFuture> scroll( // ----- Endpoint: search /** - * Returns results matching a query. + * Returns search hits that match the query defined in the request. You can + * provide search queries using the q query string parameter or the + * request body. If both are specified, only the query parameter is used. * * @see Documentation @@ -1558,13 +1603,15 @@ public CompletableFuture> search(SearchReq @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.search.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Returns results matching a query. + * Returns search hits that match the query defined in the request. You can + * provide search queries using the q query string parameter or the + * request body. If both are specified, only the query parameter is used. * * @param fn * a function that initializes a builder to create the @@ -1580,7 +1627,9 @@ public final CompletableFuture> search( } /** - * Returns results matching a query. + * Returns search hits that match the query defined in the request. You can + * provide search queries using the q query string parameter or the + * request body. If both are specified, only the query parameter is used. * * @see Documentation @@ -1591,13 +1640,15 @@ public CompletableFuture> search(SearchReq @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.search.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Returns results matching a query. + * Returns search hits that match the query defined in the request. You can + * provide search queries using the q query string parameter or the + * request body. If both are specified, only the query parameter is used. * * @param fn * a function that initializes a builder to create the @@ -1650,7 +1701,7 @@ public final CompletableFuture searchMvt( // ----- Endpoint: search_template /** - * Allows to use the Mustache language to pre-render a search definition. + * Runs a search with a search template. * * @see Documentation @@ -1662,13 +1713,14 @@ public CompletableFuture> searchTe @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchTemplateRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search_template.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.search_template.Response.TDocument", + getDeserializer(tDocumentClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Allows to use the Mustache language to pre-render a search definition. + * Runs a search with a search template. * * @param fn * a function that initializes a builder to create the @@ -1685,7 +1737,7 @@ public final CompletableFuture> se } /** - * Allows to use the Mustache language to pre-render a search definition. + * Runs a search with a search template. * * @see Documentation @@ -1697,13 +1749,14 @@ public CompletableFuture> searchTe @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchTemplateRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search_template.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.search_template.Response.TDocument", + getDeserializer(tDocumentType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Allows to use the Mustache language to pre-render a search definition. + * Runs a search with a search template. * * @param fn * a function that initializes a builder to create the @@ -1805,7 +1858,7 @@ public CompletableFuture @SuppressWarnings("unchecked") JsonEndpoint, UpdateResponse, ErrorResponse> endpoint = (JsonEndpoint, UpdateResponse, ErrorResponse>) UpdateRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.update.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.update.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } @@ -1840,7 +1893,7 @@ public CompletableFuture @SuppressWarnings("unchecked") JsonEndpoint, UpdateResponse, ErrorResponse> endpoint = (JsonEndpoint, UpdateResponse, ErrorResponse>) UpdateRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.update.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.update.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } @@ -1866,8 +1919,8 @@ public final CompletableFutureDocumentation @@ -1883,8 +1936,8 @@ public CompletableFuture updateByQuery(UpdateByQueryReque /** * Updates documents that match the specified query. If no query is specified, - * performs an update on every document in the index without changing the - * source, for example to pick up a mapping change. + * performs an update on every document in the data stream or index without + * modifying the source, which is useful for picking up mapping changes. * * @param fn * a function that initializes a builder to create the diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java index 9a67f064f..826b81fbf 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java @@ -95,6 +95,7 @@ import co.elastic.clients.elasticsearch.core.UpdateResponse; import co.elastic.clients.elasticsearch.enrich.ElasticsearchEnrichClient; import co.elastic.clients.elasticsearch.eql.ElasticsearchEqlClient; +import co.elastic.clients.elasticsearch.esql.ElasticsearchEsqlClient; import co.elastic.clients.elasticsearch.graph.ElasticsearchGraphClient; import co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient; import co.elastic.clients.elasticsearch.inference.ElasticsearchInferenceClient; @@ -102,6 +103,7 @@ import co.elastic.clients.elasticsearch.license.ElasticsearchLicenseClient; import co.elastic.clients.elasticsearch.logstash.ElasticsearchLogstashClient; import co.elastic.clients.elasticsearch.ml.ElasticsearchMlClient; +import co.elastic.clients.elasticsearch.query_rule.ElasticsearchQueryRuleClient; import co.elastic.clients.elasticsearch.query_ruleset.ElasticsearchQueryRulesetClient; import co.elastic.clients.elasticsearch.search_application.ElasticsearchSearchApplicationClient; import co.elastic.clients.elasticsearch.security.ElasticsearchSecurityClient; @@ -178,6 +180,10 @@ public ElasticsearchEqlClient eql() { return new ElasticsearchEqlClient(this.transport, this.transportOptions); } + public ElasticsearchEsqlClient esql() { + return new ElasticsearchEsqlClient(this.transport, this.transportOptions); + } + public ElasticsearchGraphClient graph() { return new ElasticsearchGraphClient(this.transport, this.transportOptions); } @@ -206,6 +212,10 @@ public ElasticsearchMlClient ml() { return new ElasticsearchMlClient(this.transport, this.transportOptions); } + public ElasticsearchQueryRuleClient queryRule() { + return new ElasticsearchQueryRuleClient(this.transport, this.transportOptions); + } + public ElasticsearchQueryRulesetClient queryRuleset() { return new ElasticsearchQueryRulesetClient(this.transport, this.transportOptions); } @@ -237,11 +247,11 @@ public ElasticsearchTransformClient transform() { // ----- Endpoint: bulk /** - * Allows to perform multiple index/update/delete operations in a single - * request. + * Performs multiple indexing or delete operations in a single API call. This + * reduces overhead and can greatly increase indexing speed. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/docs-bulk.html">Documentation * on elastic.co */ @@ -253,14 +263,14 @@ public BulkResponse bulk(BulkRequest request) throws IOException, ElasticsearchE } /** - * Allows to perform multiple index/update/delete operations in a single - * request. + * Performs multiple indexing or delete operations in a single API call. This + * reduces overhead and can greatly increase indexing speed. * * @param fn * a function that initializes a builder to create the * {@link BulkRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/docs-bulk.html">Documentation * on elastic.co */ @@ -270,11 +280,11 @@ public final BulkResponse bulk(FunctionDocumentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/docs-bulk.html">Documentation * on elastic.co */ @@ -286,10 +296,10 @@ public BulkResponse bulk() throws IOException, ElasticsearchException { // ----- Endpoint: clear_scroll /** - * Explicitly clears the search context for a scroll. + * Clears the search context and results for a scrolling search. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/clear-scroll-api.html">Documentation * on elastic.co */ @@ -301,13 +311,13 @@ public ClearScrollResponse clearScroll(ClearScrollRequest request) throws IOExce } /** - * Explicitly clears the search context for a scroll. + * Clears the search context and results for a scrolling search. * * @param fn * a function that initializes a builder to create the * {@link ClearScrollRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/clear-scroll-api.html">Documentation * on elastic.co */ @@ -318,10 +328,10 @@ public final ClearScrollResponse clearScroll( } /** - * Explicitly clears the search context for a scroll. + * Clears the search context and results for a scrolling search. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/clear-scroll-api.html">Documentation * on elastic.co */ @@ -333,10 +343,10 @@ public ClearScrollResponse clearScroll() throws IOException, ElasticsearchExcept // ----- Endpoint: close_point_in_time /** - * Close a point in time + * Closes a point-in-time. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/point-in-time-api.html">Documentation * on elastic.co */ @@ -349,13 +359,13 @@ public ClosePointInTimeResponse closePointInTime(ClosePointInTimeRequest request } /** - * Close a point in time + * Closes a point-in-time. * * @param fn * a function that initializes a builder to create the * {@link ClosePointInTimeRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/point-in-time-api.html">Documentation * on elastic.co */ @@ -414,10 +424,9 @@ public CountResponse count() throws IOException, ElasticsearchException { // ----- Endpoint: create /** - * Creates a new document in the index. - *

- * Returns a 409 response when a document with a same ID already exists in the - * index. + * Adds a JSON document to the specified data stream or index and makes it + * searchable. If the target is an index and the document already exists, the + * request updates the document and increments its version. * * @see Documentation @@ -433,10 +442,9 @@ public CreateResponse create(CreateRequest request) } /** - * Creates a new document in the index. - *

- * Returns a 409 response when a document with a same ID already exists in the - * index. + * Adds a JSON document to the specified data stream or index and makes it + * searchable. If the target is an index and the document already exists, the + * request updates the document and increments its version. * * @param fn * a function that initializes a builder to create the @@ -455,7 +463,7 @@ public final CreateResponse create( // ----- Endpoint: delete /** - * Removes a document from the index. + * Removes a JSON document from the specified index. * * @see Documentation @@ -470,7 +478,7 @@ public DeleteResponse delete(DeleteRequest request) throws IOException, Elastics } /** - * Removes a document from the index. + * Removes a JSON document from the specified index. * * @param fn * a function that initializes a builder to create the @@ -488,7 +496,7 @@ public final DeleteResponse delete(FunctionDocumentation @@ -504,7 +512,7 @@ public DeleteByQueryResponse deleteByQuery(DeleteByQueryRequest request) } /** - * Deletes documents matching the provided query. + * Deletes documents that match the specified query. * * @param fn * a function that initializes a builder to create the @@ -523,7 +531,7 @@ public final DeleteByQueryResponse deleteByQuery( // ----- Endpoint: delete_script /** - * Deletes a script. + * Deletes a stored script or search template. * * @see Documentation @@ -538,7 +546,7 @@ public DeleteScriptResponse deleteScript(DeleteScriptRequest request) throws IOE } /** - * Deletes a script. + * Deletes a stored script or search template. * * @param fn * a function that initializes a builder to create the @@ -557,7 +565,7 @@ public final DeleteScriptResponse deleteScript( // ----- Endpoint: exists /** - * Returns information about whether a document exists in an index. + * Checks if a document in an index exists. * * @see Documentation @@ -572,7 +580,7 @@ public BooleanResponse exists(ExistsRequest request) throws IOException, Elastic } /** - * Returns information about whether a document exists in an index. + * Checks if a document in an index exists. * * @param fn * a function that initializes a builder to create the @@ -590,7 +598,7 @@ public final BooleanResponse exists(Function_source is stored. * * @see Documentation @@ -605,7 +613,7 @@ public BooleanResponse existsSource(ExistsSourceRequest request) throws IOExcept } /** - * Returns information about whether a document source exists in an index. + * Checks if a document's _source is stored. * * @param fn * a function that initializes a builder to create the @@ -624,7 +632,8 @@ public final BooleanResponse existsSource( // ----- Endpoint: explain /** - * Returns information about why a specific matches (or doesn't match) a query. + * Returns information about why a specific document matches (or doesn’t match) + * a query. * * @see Documentation @@ -636,13 +645,14 @@ public ExplainResponse explain(ExplainRequest request, Cl @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ExplainRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.explain.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.explain.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Returns information about why a specific matches (or doesn't match) a query. + * Returns information about why a specific document matches (or doesn’t match) + * a query. * * @param fn * a function that initializes a builder to create the @@ -659,7 +669,8 @@ public final ExplainResponse explain( } /** - * Returns information about why a specific matches (or doesn't match) a query. + * Returns information about why a specific document matches (or doesn’t match) + * a query. * * @see Documentation @@ -671,13 +682,14 @@ public ExplainResponse explain(ExplainRequest request, Ty @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ExplainRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.explain.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.explain.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Returns information about why a specific matches (or doesn't match) a query. + * Returns information about why a specific document matches (or doesn’t match) + * a query. * * @param fn * a function that initializes a builder to create the @@ -696,8 +708,11 @@ public final ExplainResponse explain( // ----- Endpoint: field_caps /** - * Returns the information about the capabilities of fields among multiple - * indices. + * The field capabilities API returns the information about the capabilities of + * fields among multiple indices. The field capabilities API returns runtime + * fields like any other field. For example, a runtime field with a type of + * keyword is returned as any other field that belongs to the + * keyword family. * * @see Documentation @@ -712,8 +727,11 @@ public FieldCapsResponse fieldCaps(FieldCapsRequest request) throws IOException, } /** - * Returns the information about the capabilities of fields among multiple - * indices. + * The field capabilities API returns the information about the capabilities of + * fields among multiple indices. The field capabilities API returns runtime + * fields like any other field. For example, a runtime field with a type of + * keyword is returned as any other field that belongs to the + * keyword family. * * @param fn * a function that initializes a builder to create the @@ -729,8 +747,11 @@ public final FieldCapsResponse fieldCaps(Functionkeyword family. * * @see Documentation @@ -757,7 +778,7 @@ public GetResponse get(GetRequest request, Class, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.get.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } @@ -791,7 +812,7 @@ public GetResponse get(GetRequest request, Type tDocument @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.get.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } @@ -815,7 +836,7 @@ public final GetResponse get(FunctionDocumentation @@ -830,7 +851,7 @@ public GetScriptResponse getScript(GetScriptRequest request) throws IOException, } /** - * Returns a script. + * Retrieves a stored script or search template. * * @param fn * a function that initializes a builder to create the @@ -860,7 +881,8 @@ public GetSourceResponse getSource(GetSourceRequest reque @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetSourceRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get_source.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.get_source.Response.TDocument", + getDeserializer(tDocumentClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } @@ -895,7 +917,8 @@ public GetSourceResponse getSource(GetSourceRequest reque @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetSourceRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.get_source.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.get_source.Response.TDocument", + getDeserializer(tDocumentType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } @@ -920,7 +943,9 @@ public final GetSourceResponse getSource( // ----- Endpoint: index /** - * Creates or updates a document in an index. + * Adds a JSON document to the specified data stream or index and makes it + * searchable. If the target is an index and the document already exists, the + * request updates the document and increments its version. * * @see Documentation @@ -935,7 +960,9 @@ public IndexResponse index(IndexRequest request) throws I } /** - * Creates or updates a document in an index. + * Adds a JSON document to the specified data stream or index and makes it + * searchable. If the target is an index and the document already exists, the + * request updates the document and increments its version. * * @param fn * a function that initializes a builder to create the @@ -979,7 +1006,7 @@ public MgetResponse mget(MgetRequest request, Class, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.mget.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.mget.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } @@ -1013,7 +1040,7 @@ public MgetResponse mget(MgetRequest request, Type tDocum @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.mget.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.mget.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } @@ -1049,7 +1076,7 @@ public MsearchResponse msearch(MsearchRequest request, Cl @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.msearch.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } @@ -1084,7 +1111,7 @@ public MsearchResponse msearch(MsearchRequest request, Ty @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.msearch.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } @@ -1109,7 +1136,7 @@ public final MsearchResponse msearch( // ----- Endpoint: msearch_template /** - * Allows to execute several search template operations in one request. + * Runs multiple templated searches with a single request. * * @see Documentation @@ -1121,13 +1148,14 @@ public MsearchTemplateResponse msearchTemplate(MsearchTem @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchTemplateRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch_template.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.msearch_template.Response.TDocument", + getDeserializer(tDocumentClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Allows to execute several search template operations in one request. + * Runs multiple templated searches with a single request. * * @param fn * a function that initializes a builder to create the @@ -1144,7 +1172,7 @@ public final MsearchTemplateResponse msearchTemplate( } /** - * Allows to execute several search template operations in one request. + * Runs multiple templated searches with a single request. * * @see Documentation @@ -1156,13 +1184,14 @@ public MsearchTemplateResponse msearchTemplate(MsearchTem @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchTemplateRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.msearch_template.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.msearch_template.Response.TDocument", + getDeserializer(tDocumentType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Allows to execute several search template operations in one request. + * Runs multiple templated searches with a single request. * * @param fn * a function that initializes a builder to create the @@ -1228,10 +1257,17 @@ public MtermvectorsResponse mtermvectors() throws IOException, ElasticsearchExce // ----- Endpoint: open_point_in_time /** - * Open a point in time that can be used in subsequent searches + * A search request by default executes against the most recent visible data of + * the target indices, which is called point in time. Elasticsearch pit (point + * in time) is a lightweight view into the state of the data as it existed when + * initiated. In some cases, it’s preferred to perform multiple search requests + * using the same point in time. For example, if refreshes happen between + * search_after requests, then the results of those requests might + * not be consistent as changes happening between searches are only visible to + * the more recent point in time. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/point-in-time-api.html">Documentation * on elastic.co */ @@ -1244,13 +1280,20 @@ public OpenPointInTimeResponse openPointInTime(OpenPointInTimeRequest request) } /** - * Open a point in time that can be used in subsequent searches + * A search request by default executes against the most recent visible data of + * the target indices, which is called point in time. Elasticsearch pit (point + * in time) is a lightweight view into the state of the data as it existed when + * initiated. In some cases, it’s preferred to perform multiple search requests + * using the same point in time. For example, if refreshes happen between + * search_after requests, then the results of those requests might + * not be consistent as changes happening between searches are only visible to + * the more recent point in time. * * @param fn * a function that initializes a builder to create the * {@link OpenPointInTimeRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/point-in-time-api.html">Documentation * on elastic.co */ @@ -1276,7 +1319,7 @@ public BooleanResponse ping() throws IOException, ElasticsearchException { // ----- Endpoint: put_script /** - * Creates or updates a script. + * Creates or updates a stored script or search template. * * @see Documentation @@ -1291,7 +1334,7 @@ public PutScriptResponse putScript(PutScriptRequest request) throws IOException, } /** - * Creates or updates a script. + * Creates or updates a stored script or search template. * * @param fn * a function that initializes a builder to create the @@ -1309,8 +1352,8 @@ public final PutScriptResponse putScript(FunctionDocumentation @@ -1325,8 +1368,8 @@ public RankEvalResponse rankEval(RankEvalRequest request) throws IOException, El } /** - * Allows to evaluate the quality of ranked search results over a set of typical - * search queries + * Enables you to evaluate the quality of ranked search results over a set of + * typical search queries. * * @param fn * a function that initializes a builder to create the @@ -1381,7 +1424,7 @@ public final ReindexResponse reindex(FunctionDocumentation @@ -1397,7 +1440,7 @@ public RenderSearchTemplateResponse renderSearchTemplate(RenderSearchTemplateReq } /** - * Allows to use the Mustache language to pre-render a search definition. + * Renders a search template as a search request body. * * @param fn * a function that initializes a builder to create the @@ -1414,7 +1457,7 @@ public final RenderSearchTemplateResponse renderSearchTemplate( } /** - * Allows to use the Mustache language to pre-render a search definition. + * Renders a search template as a search request body. * * @see Documentation @@ -1429,7 +1472,7 @@ public RenderSearchTemplateResponse renderSearchTemplate() throws IOException, E // ----- Endpoint: scripts_painless_execute /** - * Allows an arbitrary script to be executed and a result to be returned + * Runs a script and returns a result. * * @see Documentation @@ -1442,14 +1485,14 @@ public ScriptsPainlessExecuteResponse scriptsPainlessExecute( @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScriptsPainlessExecuteRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scripts_painless_execute.TResult", + "co.elastic.clients:Deserializer:_global.scripts_painless_execute.Response.TResult", getDeserializer(tResultClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Allows an arbitrary script to be executed and a result to be returned + * Runs a script and returns a result. * * @param fn * a function that initializes a builder to create the @@ -1466,7 +1509,7 @@ public final ScriptsPainlessExecuteResponse scriptsPainlessEx } /** - * Allows an arbitrary script to be executed and a result to be returned + * Runs a script and returns a result. * * @see Documentation @@ -1478,14 +1521,14 @@ public ScriptsPainlessExecuteResponse scriptsPainlessExecute( @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScriptsPainlessExecuteRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scripts_painless_execute.TResult", + "co.elastic.clients:Deserializer:_global.scripts_painless_execute.Response.TResult", getDeserializer(tResultType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Allows an arbitrary script to be executed and a result to be returned + * Runs a script and returns a result. * * @param fn * a function that initializes a builder to create the @@ -1516,7 +1559,7 @@ public ScrollResponse scroll(ScrollRequest request, Class @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scroll.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.scroll.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } @@ -1551,7 +1594,7 @@ public ScrollResponse scroll(ScrollRequest request, Type @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.scroll.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.scroll.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } @@ -1576,7 +1619,9 @@ public final ScrollResponse scroll( // ----- Endpoint: search /** - * Returns results matching a query. + * Returns search hits that match the query defined in the request. You can + * provide search queries using the q query string parameter or the + * request body. If both are specified, only the query parameter is used. * * @see Documentation @@ -1588,13 +1633,15 @@ public SearchResponse search(SearchRequest request, Class @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.search.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Returns results matching a query. + * Returns search hits that match the query defined in the request. You can + * provide search queries using the q query string parameter or the + * request body. If both are specified, only the query parameter is used. * * @param fn * a function that initializes a builder to create the @@ -1611,7 +1658,9 @@ public final SearchResponse search( } /** - * Returns results matching a query. + * Returns search hits that match the query defined in the request. You can + * provide search queries using the q query string parameter or the + * request body. If both are specified, only the query parameter is used. * * @see Documentation @@ -1623,13 +1672,15 @@ public SearchResponse search(SearchRequest request, Type @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.search.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Returns results matching a query. + * Returns search hits that match the query defined in the request. You can + * provide search queries using the q query string parameter or the + * request body. If both are specified, only the query parameter is used. * * @param fn * a function that initializes a builder to create the @@ -1683,7 +1734,7 @@ public final BinaryResponse searchMvt(FunctionDocumentation @@ -1695,13 +1746,14 @@ public SearchTemplateResponse searchTemplate(SearchTempla @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchTemplateRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search_template.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.search_template.Response.TDocument", + getDeserializer(tDocumentClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Allows to use the Mustache language to pre-render a search definition. + * Runs a search with a search template. * * @param fn * a function that initializes a builder to create the @@ -1718,7 +1770,7 @@ public final SearchTemplateResponse searchTemplate( } /** - * Allows to use the Mustache language to pre-render a search definition. + * Runs a search with a search template. * * @see Documentation @@ -1730,13 +1782,14 @@ public SearchTemplateResponse searchTemplate(SearchTempla @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchTemplateRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.search_template.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.search_template.Response.TDocument", + getDeserializer(tDocumentType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Allows to use the Mustache language to pre-render a search definition. + * Runs a search with a search template. * * @param fn * a function that initializes a builder to create the @@ -1842,7 +1895,7 @@ public UpdateResponse update( @SuppressWarnings("unchecked") JsonEndpoint, UpdateResponse, ErrorResponse> endpoint = (JsonEndpoint, UpdateResponse, ErrorResponse>) UpdateRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.update.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:_global.update.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } @@ -1878,7 +1931,7 @@ public UpdateResponse update( @SuppressWarnings("unchecked") JsonEndpoint, UpdateResponse, ErrorResponse> endpoint = (JsonEndpoint, UpdateResponse, ErrorResponse>) UpdateRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:_global.update.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:_global.update.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } @@ -1904,8 +1957,8 @@ public final UpdateResponse update( /** * Updates documents that match the specified query. If no query is specified, - * performs an update on every document in the index without changing the - * source, for example to pick up a mapping change. + * performs an update on every document in the data stream or index without + * modifying the source, which is useful for picking up mapping changes. * * @see Documentation @@ -1922,8 +1975,8 @@ public UpdateByQueryResponse updateByQuery(UpdateByQueryRequest request) /** * Updates documents that match the specified query. If no query is specified, - * performs an update on every document in the index without changing the - * source, for example to pick up a mapping change. + * performs an update on every document in the data stream or index without + * modifying the source, which is useful for picking up mapping changes. * * @param fn * a function that initializes a builder to create the diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterSearchStatusEnum.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterSearchStatusEnum.java deleted file mode 100644 index 65b16d906..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterSearchStatusEnum.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonEnum; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public enum ClusterSearchStatusEnum implements JsonEnum { - Running("running"), - - Successful("successful"), - - Partial("partial"), - - Skipped("skipped"), - - Failed("failed"), - - ; - - private final String jsonValue; - - ClusterSearchStatusEnum(String jsonValue) { - this.jsonValue = jsonValue; - } - - public String jsonValue() { - return this.jsonValue; - } - - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( - ClusterSearchStatusEnum.values()); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/CompletionStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/CompletionStats.java deleted file mode 100644 index ea29c548c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/CompletionStats.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: _types.CompletionStats - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class CompletionStats implements JsonpSerializable { - private final long sizeInBytes; - - @Nullable - private final String size; - - private final Map fields; - - // --------------------------------------------------------------------------------------------- - - private CompletionStats(Builder builder) { - - this.sizeInBytes = ApiTypeHelper.requireNonNull(builder.sizeInBytes, this, "sizeInBytes"); - this.size = builder.size; - this.fields = ApiTypeHelper.unmodifiable(builder.fields); - - } - - public static CompletionStats of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Total amount, in bytes, of memory used for completion across all - * shards assigned to selected nodes. - *

- * API name: {@code size_in_bytes} - */ - public final long sizeInBytes() { - return this.sizeInBytes; - } - - /** - * Total amount of memory used for completion across all shards assigned to - * selected nodes. - *

- * API name: {@code size} - */ - @Nullable - public final String size() { - return this.size; - } - - /** - * API name: {@code fields} - */ - public final Map fields() { - return this.fields; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("size_in_bytes"); - generator.write(this.sizeInBytes); - - if (this.size != null) { - generator.writeKey("size"); - generator.write(this.size); - - } - if (ApiTypeHelper.isDefined(this.fields)) { - generator.writeKey("fields"); - generator.writeStartObject(); - for (Map.Entry item0 : this.fields.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link CompletionStats}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Long sizeInBytes; - - @Nullable - private String size; - - @Nullable - private Map fields; - - /** - * Required - Total amount, in bytes, of memory used for completion across all - * shards assigned to selected nodes. - *

- * API name: {@code size_in_bytes} - */ - public final Builder sizeInBytes(long value) { - this.sizeInBytes = value; - return this; - } - - /** - * Total amount of memory used for completion across all shards assigned to - * selected nodes. - *

- * API name: {@code size} - */ - public final Builder size(@Nullable String value) { - this.size = value; - return this; - } - - /** - * API name: {@code fields} - *

- * Adds all entries of map to fields. - */ - public final Builder fields(Map map) { - this.fields = _mapPutAll(this.fields, map); - return this; - } - - /** - * API name: {@code fields} - *

- * Adds an entry to fields. - */ - public final Builder fields(String key, FieldSizeUsage value) { - this.fields = _mapPut(this.fields, key, value); - return this; - } - - /** - * API name: {@code fields} - *

- * Adds an entry to fields using a builder lambda. - */ - public final Builder fields(String key, Function> fn) { - return fields(key, fn.apply(new FieldSizeUsage.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link CompletionStats}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public CompletionStats build() { - _checkSingleUse(); - - return new CompletionStats(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link CompletionStats} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - CompletionStats::setupCompletionStatsDeserializer); - - protected static void setupCompletionStatsDeserializer(ObjectDeserializer op) { - - op.add(Builder::sizeInBytes, JsonpDeserializer.longDeserializer(), "size_in_bytes"); - op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size"); - op.add(Builder::fields, JsonpDeserializer.stringMapDeserializer(FieldSizeUsage._DESERIALIZER), "fields"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DocStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DocStats.java deleted file mode 100644 index c043db567..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DocStats.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: _types.DocStats - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DocStats implements JsonpSerializable { - private final long count; - - @Nullable - private final Long deleted; - - // --------------------------------------------------------------------------------------------- - - private DocStats(Builder builder) { - - this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); - this.deleted = builder.deleted; - - } - - public static DocStats of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Total number of non-deleted documents across all primary shards - * assigned to selected nodes. This number is based on documents in Lucene - * segments and may include documents from nested fields. - *

- * API name: {@code count} - */ - public final long count() { - return this.count; - } - - /** - * Total number of deleted documents across all primary shards assigned to - * selected nodes. This number is based on documents in Lucene segments. - * Elasticsearch reclaims the disk space of deleted Lucene documents when a - * segment is merged. - *

- * API name: {@code deleted} - */ - @Nullable - public final Long deleted() { - return this.deleted; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("count"); - generator.write(this.count); - - if (this.deleted != null) { - generator.writeKey("deleted"); - generator.write(this.deleted); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DocStats}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Long count; - - @Nullable - private Long deleted; - - /** - * Required - Total number of non-deleted documents across all primary shards - * assigned to selected nodes. This number is based on documents in Lucene - * segments and may include documents from nested fields. - *

- * API name: {@code count} - */ - public final Builder count(long value) { - this.count = value; - return this; - } - - /** - * Total number of deleted documents across all primary shards assigned to - * selected nodes. This number is based on documents in Lucene segments. - * Elasticsearch reclaims the disk space of deleted Lucene documents when a - * segment is merged. - *

- * API name: {@code deleted} - */ - public final Builder deleted(@Nullable Long value) { - this.deleted = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DocStats}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DocStats build() { - _checkSingleUse(); - - return new DocStats(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DocStats} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - DocStats::setupDocStatsDeserializer); - - protected static void setupDocStatsDeserializer(ObjectDeserializer op) { - - op.add(Builder::count, JsonpDeserializer.longDeserializer(), "count"); - op.add(Builder::deleted, JsonpDeserializer.longDeserializer(), "deleted"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java index aa350d76b..bad5ca106 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java @@ -38,7 +38,8 @@ public class ElasticsearchException extends RuntimeException { @Nullable private final TransportHttpClient.Response httpResponse; - public ElasticsearchException(String endpointId, ErrorResponse response, @Nullable TransportHttpClient.Response httpResponse) { + public ElasticsearchException(String endpointId, ErrorResponse response, + @Nullable TransportHttpClient.Response httpResponse) { super("[" + endpointId + "] failed: [" + response.error().type() + "] " + response.error().reason()); this.response = response; this.endpointId = endpointId; diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldMemoryUsage.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldMemoryUsage.java deleted file mode 100644 index ae6a22f6f..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldMemoryUsage.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: _types.FieldMemoryUsage - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class FieldMemoryUsage implements JsonpSerializable { - @Nullable - private final String memorySize; - - private final long memorySizeInBytes; - - // --------------------------------------------------------------------------------------------- - - private FieldMemoryUsage(Builder builder) { - - this.memorySize = builder.memorySize; - this.memorySizeInBytes = ApiTypeHelper.requireNonNull(builder.memorySizeInBytes, this, "memorySizeInBytes"); - - } - - public static FieldMemoryUsage of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code memory_size} - */ - @Nullable - public final String memorySize() { - return this.memorySize; - } - - /** - * Required - API name: {@code memory_size_in_bytes} - */ - public final long memorySizeInBytes() { - return this.memorySizeInBytes; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.memorySize != null) { - generator.writeKey("memory_size"); - generator.write(this.memorySize); - - } - generator.writeKey("memory_size_in_bytes"); - generator.write(this.memorySizeInBytes); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link FieldMemoryUsage}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private String memorySize; - - private Long memorySizeInBytes; - - /** - * API name: {@code memory_size} - */ - public final Builder memorySize(@Nullable String value) { - this.memorySize = value; - return this; - } - - /** - * Required - API name: {@code memory_size_in_bytes} - */ - public final Builder memorySizeInBytes(long value) { - this.memorySizeInBytes = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link FieldMemoryUsage}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public FieldMemoryUsage build() { - _checkSingleUse(); - - return new FieldMemoryUsage(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link FieldMemoryUsage} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - FieldMemoryUsage::setupFieldMemoryUsageDeserializer); - - protected static void setupFieldMemoryUsageDeserializer(ObjectDeserializer op) { - - op.add(Builder::memorySize, JsonpDeserializer.stringDeserializer(), "memory_size"); - op.add(Builder::memorySizeInBytes, JsonpDeserializer.longDeserializer(), "memory_size_in_bytes"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSizeUsage.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSizeUsage.java deleted file mode 100644 index 2e34ec3f4..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSizeUsage.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: _types.FieldSizeUsage - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class FieldSizeUsage implements JsonpSerializable { - @Nullable - private final String size; - - private final long sizeInBytes; - - // --------------------------------------------------------------------------------------------- - - private FieldSizeUsage(Builder builder) { - - this.size = builder.size; - this.sizeInBytes = ApiTypeHelper.requireNonNull(builder.sizeInBytes, this, "sizeInBytes"); - - } - - public static FieldSizeUsage of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code size} - */ - @Nullable - public final String size() { - return this.size; - } - - /** - * Required - API name: {@code size_in_bytes} - */ - public final long sizeInBytes() { - return this.sizeInBytes; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.size != null) { - generator.writeKey("size"); - generator.write(this.size); - - } - generator.writeKey("size_in_bytes"); - generator.write(this.sizeInBytes); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link FieldSizeUsage}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private String size; - - private Long sizeInBytes; - - /** - * API name: {@code size} - */ - public final Builder size(@Nullable String value) { - this.size = value; - return this; - } - - /** - * Required - API name: {@code size_in_bytes} - */ - public final Builder sizeInBytes(long value) { - this.sizeInBytes = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link FieldSizeUsage}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public FieldSizeUsage build() { - _checkSingleUse(); - - return new FieldSizeUsage(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link FieldSizeUsage} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - FieldSizeUsage::setupFieldSizeUsageDeserializer); - - protected static void setupFieldSizeUsageDeserializer(ObjectDeserializer op) { - - op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size"); - op.add(Builder::sizeInBytes, JsonpDeserializer.longDeserializer(), "size_in_bytes"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldValue.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldValue.java index e68f12532..289399e10 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldValue.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldValue.java @@ -69,6 +69,10 @@ public static FieldValue of(JsonData value) { return new FieldValue(Kind.Any, value); } + public static FieldValue of(Object value) { + return of(JsonData.of(value)); + } + public static final FieldValue NULL = new FieldValue(Kind.Null, null); public static final FieldValue TRUE = new FieldValue(Kind.Boolean, Boolean.TRUE); public static final FieldValue FALSE = new FieldValue(Kind.Boolean, Boolean.FALSE); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FielddataStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FielddataStats.java deleted file mode 100644 index ecc0c33f5..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FielddataStats.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: _types.FielddataStats - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class FielddataStats implements JsonpSerializable { - @Nullable - private final Long evictions; - - @Nullable - private final String memorySize; - - private final long memorySizeInBytes; - - private final Map fields; - - // --------------------------------------------------------------------------------------------- - - private FielddataStats(Builder builder) { - - this.evictions = builder.evictions; - this.memorySize = builder.memorySize; - this.memorySizeInBytes = ApiTypeHelper.requireNonNull(builder.memorySizeInBytes, this, "memorySizeInBytes"); - this.fields = ApiTypeHelper.unmodifiable(builder.fields); - - } - - public static FielddataStats of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code evictions} - */ - @Nullable - public final Long evictions() { - return this.evictions; - } - - /** - * API name: {@code memory_size} - */ - @Nullable - public final String memorySize() { - return this.memorySize; - } - - /** - * Required - API name: {@code memory_size_in_bytes} - */ - public final long memorySizeInBytes() { - return this.memorySizeInBytes; - } - - /** - * API name: {@code fields} - */ - public final Map fields() { - return this.fields; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.evictions != null) { - generator.writeKey("evictions"); - generator.write(this.evictions); - - } - if (this.memorySize != null) { - generator.writeKey("memory_size"); - generator.write(this.memorySize); - - } - generator.writeKey("memory_size_in_bytes"); - generator.write(this.memorySizeInBytes); - - if (ApiTypeHelper.isDefined(this.fields)) { - generator.writeKey("fields"); - generator.writeStartObject(); - for (Map.Entry item0 : this.fields.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link FielddataStats}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private Long evictions; - - @Nullable - private String memorySize; - - private Long memorySizeInBytes; - - @Nullable - private Map fields; - - /** - * API name: {@code evictions} - */ - public final Builder evictions(@Nullable Long value) { - this.evictions = value; - return this; - } - - /** - * API name: {@code memory_size} - */ - public final Builder memorySize(@Nullable String value) { - this.memorySize = value; - return this; - } - - /** - * Required - API name: {@code memory_size_in_bytes} - */ - public final Builder memorySizeInBytes(long value) { - this.memorySizeInBytes = value; - return this; - } - - /** - * API name: {@code fields} - *

- * Adds all entries of map to fields. - */ - public final Builder fields(Map map) { - this.fields = _mapPutAll(this.fields, map); - return this; - } - - /** - * API name: {@code fields} - *

- * Adds an entry to fields. - */ - public final Builder fields(String key, FieldMemoryUsage value) { - this.fields = _mapPut(this.fields, key, value); - return this; - } - - /** - * API name: {@code fields} - *

- * Adds an entry to fields using a builder lambda. - */ - public final Builder fields(String key, - Function> fn) { - return fields(key, fn.apply(new FieldMemoryUsage.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link FielddataStats}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public FielddataStats build() { - _checkSingleUse(); - - return new FielddataStats(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link FielddataStats} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - FielddataStats::setupFielddataStatsDeserializer); - - protected static void setupFielddataStatsDeserializer(ObjectDeserializer op) { - - op.add(Builder::evictions, JsonpDeserializer.longDeserializer(), "evictions"); - op.add(Builder::memorySize, JsonpDeserializer.stringDeserializer(), "memory_size"); - op.add(Builder::memorySizeInBytes, JsonpDeserializer.longDeserializer(), "memory_size_in_bytes"); - op.add(Builder::fields, JsonpDeserializer.stringMapDeserializer(FieldMemoryUsage._DESERIALIZER), "fields"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineGet.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineGet.java index 61156fda3..85e6f102c 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineGet.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineGet.java @@ -377,7 +377,7 @@ public static JsonpDeserializer> createInlineGe */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createInlineGetDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_types.TDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_types.InlineGet.TDocument"))); protected static void setupInlineGetDeserializer(ObjectDeserializer> op, JsonpDeserializer tDocumentDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java index 604190f16..4c1818f1c 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java @@ -20,21 +20,18 @@ package co.elastic.clients.elasticsearch._types; import co.elastic.clients.elasticsearch._types.query_dsl.Query; +import co.elastic.clients.elasticsearch._types.query_dsl.QueryBase; import co.elastic.clients.elasticsearch._types.query_dsl.QueryVariant; -import co.elastic.clients.elasticsearch.core.search.InnerHits; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; import java.lang.Float; -import java.lang.Long; +import java.lang.Integer; import java.lang.String; import java.util.List; import java.util.Objects; @@ -64,7 +61,7 @@ * specification */ @JsonpDeserializable -public class KnnQuery implements QueryVariant, JsonpSerializable { +public class KnnQuery extends QueryBase implements QueryVariant { private final String field; private final List queryVector; @@ -72,34 +69,25 @@ public class KnnQuery implements QueryVariant, JsonpSerializable { @Nullable private final QueryVectorBuilder queryVectorBuilder; - private final long k; - - private final long numCandidates; - @Nullable - private final Float boost; + private final Integer numCandidates; private final List filter; @Nullable private final Float similarity; - @Nullable - private final InnerHits innerHits; - // --------------------------------------------------------------------------------------------- private KnnQuery(Builder builder) { + super(builder); this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); this.queryVector = ApiTypeHelper.unmodifiable(builder.queryVector); this.queryVectorBuilder = builder.queryVectorBuilder; - this.k = ApiTypeHelper.requireNonNull(builder.k, this, "k"); - this.numCandidates = ApiTypeHelper.requireNonNull(builder.numCandidates, this, "numCandidates"); - this.boost = builder.boost; + this.numCandidates = builder.numCandidates; this.filter = ApiTypeHelper.unmodifiable(builder.filter); this.similarity = builder.similarity; - this.innerHits = builder.innerHits; } @@ -145,31 +133,13 @@ public final QueryVectorBuilder queryVectorBuilder() { } /** - * Required - The final number of nearest neighbors to return as top hits - *

- * API name: {@code k} - */ - public final long k() { - return this.k; - } - - /** - * Required - The number of nearest neighbor candidates to consider per shard + * The number of nearest neighbor candidates to consider per shard *

* API name: {@code num_candidates} */ - public final long numCandidates() { - return this.numCandidates; - } - - /** - * Boost value to apply to kNN scores - *

- * API name: {@code boost} - */ @Nullable - public final Float boost() { - return this.boost; + public final Integer numCandidates() { + return this.numCandidates; } /** @@ -191,27 +161,9 @@ public final Float similarity() { return this.similarity; } - /** - * If defined, each search hit will contain inner hits. - *

- * API name: {@code inner_hits} - */ - @Nullable - public final InnerHits innerHits() { - return this.innerHits; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + super.serializeInternal(generator, mapper); generator.writeKey("field"); generator.write(this.field); @@ -230,15 +182,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { this.queryVectorBuilder.serialize(generator, mapper); } - generator.writeKey("k"); - generator.write(this.k); - - generator.writeKey("num_candidates"); - generator.write(this.numCandidates); - - if (this.boost != null) { - generator.writeKey("boost"); - generator.write(this.boost); + if (this.numCandidates != null) { + generator.writeKey("num_candidates"); + generator.write(this.numCandidates); } if (ApiTypeHelper.isDefined(this.filter)) { @@ -256,26 +202,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.similarity); } - if (this.innerHits != null) { - generator.writeKey("inner_hits"); - this.innerHits.serialize(generator, mapper); - - } } - @Override - public String toString() { - return JsonpUtils.toString(this); - } - // --------------------------------------------------------------------------------------------- /** * Builder for {@link KnnQuery}. */ - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + public static class Builder extends QueryBase.AbstractBuilder implements ObjectBuilder { private String field; @Nullable @@ -284,12 +220,8 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private QueryVectorBuilder queryVectorBuilder; - private Long k; - - private Long numCandidates; - @Nullable - private Float boost; + private Integer numCandidates; @Nullable private List filter; @@ -297,9 +229,6 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private Float similarity; - @Nullable - private InnerHits innerHits; - /** * Required - The name of the vector field to search against *

@@ -357,35 +286,15 @@ public final Builder queryVectorBuilder( } /** - * Required - The final number of nearest neighbors to return as top hits - *

- * API name: {@code k} - */ - public final Builder k(long value) { - this.k = value; - return this; - } - - /** - * Required - The number of nearest neighbor candidates to consider per shard + * The number of nearest neighbor candidates to consider per shard *

* API name: {@code num_candidates} */ - public final Builder numCandidates(long value) { + public final Builder numCandidates(@Nullable Integer value) { this.numCandidates = value; return this; } - /** - * Boost value to apply to kNN scores - *

- * API name: {@code boost} - */ - public final Builder boost(@Nullable Float value) { - this.boost = value; - return this; - } - /** * Filters for the kNN search query *

@@ -431,25 +340,6 @@ public final Builder similarity(@Nullable Float value) { return this; } - /** - * If defined, each search hit will contain inner hits. - *

- * API name: {@code inner_hits} - */ - public final Builder innerHits(@Nullable InnerHits value) { - this.innerHits = value; - return this; - } - - /** - * If defined, each search hit will contain inner hits. - *

- * API name: {@code inner_hits} - */ - public final Builder innerHits(Function> fn) { - return this.innerHits(fn.apply(new InnerHits.Builder()).build()); - } - @Override protected Builder self() { return this; @@ -477,17 +367,14 @@ public KnnQuery build() { KnnQuery::setupKnnQueryDeserializer); protected static void setupKnnQueryDeserializer(ObjectDeserializer op) { - + QueryBase.setupQueryBaseDeserializer(op); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::queryVector, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.floatDeserializer()), "query_vector"); op.add(Builder::queryVectorBuilder, QueryVectorBuilder._DESERIALIZER, "query_vector_builder"); - op.add(Builder::k, JsonpDeserializer.longDeserializer(), "k"); - op.add(Builder::numCandidates, JsonpDeserializer.longDeserializer(), "num_candidates"); - op.add(Builder::boost, JsonpDeserializer.floatDeserializer(), "boost"); + op.add(Builder::numCandidates, JsonpDeserializer.integerDeserializer(), "num_candidates"); op.add(Builder::filter, JsonpDeserializer.arrayDeserializer(Query._DESERIALIZER), "filter"); op.add(Builder::similarity, JsonpDeserializer.floatDeserializer(), "similarity"); - op.add(Builder::innerHits, InnerHits._DESERIALIZER, "inner_hits"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnRetriever.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnRetriever.java new file mode 100644 index 000000000..ab29ddb82 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnRetriever.java @@ -0,0 +1,343 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.Float; +import java.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.KnnRetriever + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class KnnRetriever extends RetrieverBase implements RetrieverVariant { + private final String field; + + private final List queryVector; + + @Nullable + private final QueryVectorBuilder queryVectorBuilder; + + private final int k; + + private final int numCandidates; + + @Nullable + private final Float similarity; + + // --------------------------------------------------------------------------------------------- + + private KnnRetriever(Builder builder) { + super(builder); + + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); + this.queryVector = ApiTypeHelper.unmodifiable(builder.queryVector); + this.queryVectorBuilder = builder.queryVectorBuilder; + this.k = ApiTypeHelper.requireNonNull(builder.k, this, "k"); + this.numCandidates = ApiTypeHelper.requireNonNull(builder.numCandidates, this, "numCandidates"); + this.similarity = builder.similarity; + + } + + public static KnnRetriever of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Retriever variant kind. + */ + @Override + public Retriever.Kind _retrieverKind() { + return Retriever.Kind.Knn; + } + + /** + * Required - The name of the vector field to search against. + *

+ * API name: {@code field} + */ + public final String field() { + return this.field; + } + + /** + * Query vector. Must have the same number of dimensions as the vector field you + * are searching against. You must provide a query_vector_builder or + * query_vector, but not both. + *

+ * API name: {@code query_vector} + */ + public final List queryVector() { + return this.queryVector; + } + + /** + * Defines a model to build a query vector. + *

+ * API name: {@code query_vector_builder} + */ + @Nullable + public final QueryVectorBuilder queryVectorBuilder() { + return this.queryVectorBuilder; + } + + /** + * Required - Number of nearest neighbors to return as top hits. + *

+ * API name: {@code k} + */ + public final int k() { + return this.k; + } + + /** + * Required - Number of nearest neighbor candidates to consider per shard. + *

+ * API name: {@code num_candidates} + */ + public final int numCandidates() { + return this.numCandidates; + } + + /** + * The minimum similarity required for a document to be considered a match. + *

+ * API name: {@code similarity} + */ + @Nullable + public final Float similarity() { + return this.similarity; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + super.serializeInternal(generator, mapper); + generator.writeKey("field"); + generator.write(this.field); + + if (ApiTypeHelper.isDefined(this.queryVector)) { + generator.writeKey("query_vector"); + generator.writeStartArray(); + for (Float item0 : this.queryVector) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.queryVectorBuilder != null) { + generator.writeKey("query_vector_builder"); + this.queryVectorBuilder.serialize(generator, mapper); + + } + generator.writeKey("k"); + generator.write(this.k); + + generator.writeKey("num_candidates"); + generator.write(this.numCandidates); + + if (this.similarity != null) { + generator.writeKey("similarity"); + generator.write(this.similarity); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link KnnRetriever}. + */ + + public static class Builder extends RetrieverBase.AbstractBuilder implements ObjectBuilder { + private String field; + + @Nullable + private List queryVector; + + @Nullable + private QueryVectorBuilder queryVectorBuilder; + + private Integer k; + + private Integer numCandidates; + + @Nullable + private Float similarity; + + /** + * Required - The name of the vector field to search against. + *

+ * API name: {@code field} + */ + public final Builder field(String value) { + this.field = value; + return this; + } + + /** + * Query vector. Must have the same number of dimensions as the vector field you + * are searching against. You must provide a query_vector_builder or + * query_vector, but not both. + *

+ * API name: {@code query_vector} + *

+ * Adds all elements of list to queryVector. + */ + public final Builder queryVector(List list) { + this.queryVector = _listAddAll(this.queryVector, list); + return this; + } + + /** + * Query vector. Must have the same number of dimensions as the vector field you + * are searching against. You must provide a query_vector_builder or + * query_vector, but not both. + *

+ * API name: {@code query_vector} + *

+ * Adds one or more values to queryVector. + */ + public final Builder queryVector(Float value, Float... values) { + this.queryVector = _listAdd(this.queryVector, value, values); + return this; + } + + /** + * Defines a model to build a query vector. + *

+ * API name: {@code query_vector_builder} + */ + public final Builder queryVectorBuilder(@Nullable QueryVectorBuilder value) { + this.queryVectorBuilder = value; + return this; + } + + /** + * Defines a model to build a query vector. + *

+ * API name: {@code query_vector_builder} + */ + public final Builder queryVectorBuilder( + Function> fn) { + return this.queryVectorBuilder(fn.apply(new QueryVectorBuilder.Builder()).build()); + } + + /** + * Required - Number of nearest neighbors to return as top hits. + *

+ * API name: {@code k} + */ + public final Builder k(int value) { + this.k = value; + return this; + } + + /** + * Required - Number of nearest neighbor candidates to consider per shard. + *

+ * API name: {@code num_candidates} + */ + public final Builder numCandidates(int value) { + this.numCandidates = value; + return this; + } + + /** + * The minimum similarity required for a document to be considered a match. + *

+ * API name: {@code similarity} + */ + public final Builder similarity(@Nullable Float value) { + this.similarity = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link KnnRetriever}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public KnnRetriever build() { + _checkSingleUse(); + + return new KnnRetriever(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link KnnRetriever} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + KnnRetriever::setupKnnRetrieverDeserializer); + + protected static void setupKnnRetrieverDeserializer(ObjectDeserializer op) { + RetrieverBase.setupRetrieverBaseDeserializer(op); + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); + op.add(Builder::queryVector, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.floatDeserializer()), + "query_vector"); + op.add(Builder::queryVectorBuilder, QueryVectorBuilder._DESERIALIZER, "query_vector_builder"); + op.add(Builder::k, JsonpDeserializer.integerDeserializer(), "k"); + op.add(Builder::numCandidates, JsonpDeserializer.integerDeserializer(), "num_candidates"); + op.add(Builder::similarity, JsonpDeserializer.floatDeserializer(), "similarity"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnSearch.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnSearch.java new file mode 100644 index 000000000..3a1184c25 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnSearch.java @@ -0,0 +1,495 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +import co.elastic.clients.elasticsearch.core.search.InnerHits; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Float; +import java.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.KnnSearch + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class KnnSearch implements JsonpSerializable { + private final String field; + + private final List queryVector; + + @Nullable + private final QueryVectorBuilder queryVectorBuilder; + + @Nullable + private final Integer k; + + @Nullable + private final Integer numCandidates; + + @Nullable + private final Float boost; + + private final List filter; + + @Nullable + private final Float similarity; + + @Nullable + private final InnerHits innerHits; + + // --------------------------------------------------------------------------------------------- + + private KnnSearch(Builder builder) { + + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); + this.queryVector = ApiTypeHelper.unmodifiable(builder.queryVector); + this.queryVectorBuilder = builder.queryVectorBuilder; + this.k = builder.k; + this.numCandidates = builder.numCandidates; + this.boost = builder.boost; + this.filter = ApiTypeHelper.unmodifiable(builder.filter); + this.similarity = builder.similarity; + this.innerHits = builder.innerHits; + + } + + public static KnnSearch of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - The name of the vector field to search against + *

+ * API name: {@code field} + */ + public final String field() { + return this.field; + } + + /** + * The query vector + *

+ * API name: {@code query_vector} + */ + public final List queryVector() { + return this.queryVector; + } + + /** + * The query vector builder. You must provide a query_vector_builder or + * query_vector, but not both. + *

+ * API name: {@code query_vector_builder} + */ + @Nullable + public final QueryVectorBuilder queryVectorBuilder() { + return this.queryVectorBuilder; + } + + /** + * The final number of nearest neighbors to return as top hits + *

+ * API name: {@code k} + */ + @Nullable + public final Integer k() { + return this.k; + } + + /** + * The number of nearest neighbor candidates to consider per shard + *

+ * API name: {@code num_candidates} + */ + @Nullable + public final Integer numCandidates() { + return this.numCandidates; + } + + /** + * Boost value to apply to kNN scores + *

+ * API name: {@code boost} + */ + @Nullable + public final Float boost() { + return this.boost; + } + + /** + * Filters for the kNN search query + *

+ * API name: {@code filter} + */ + public final List filter() { + return this.filter; + } + + /** + * The minimum similarity for a vector to be considered a match + *

+ * API name: {@code similarity} + */ + @Nullable + public final Float similarity() { + return this.similarity; + } + + /** + * If defined, each search hit will contain inner hits. + *

+ * API name: {@code inner_hits} + */ + @Nullable + public final InnerHits innerHits() { + return this.innerHits; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeKey("field"); + generator.write(this.field); + + if (ApiTypeHelper.isDefined(this.queryVector)) { + generator.writeKey("query_vector"); + generator.writeStartArray(); + for (Float item0 : this.queryVector) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.queryVectorBuilder != null) { + generator.writeKey("query_vector_builder"); + this.queryVectorBuilder.serialize(generator, mapper); + + } + if (this.k != null) { + generator.writeKey("k"); + generator.write(this.k); + + } + if (this.numCandidates != null) { + generator.writeKey("num_candidates"); + generator.write(this.numCandidates); + + } + if (this.boost != null) { + generator.writeKey("boost"); + generator.write(this.boost); + + } + if (ApiTypeHelper.isDefined(this.filter)) { + generator.writeKey("filter"); + generator.writeStartArray(); + for (Query item0 : this.filter) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.similarity != null) { + generator.writeKey("similarity"); + generator.write(this.similarity); + + } + if (this.innerHits != null) { + generator.writeKey("inner_hits"); + this.innerHits.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link KnnSearch}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String field; + + @Nullable + private List queryVector; + + @Nullable + private QueryVectorBuilder queryVectorBuilder; + + @Nullable + private Integer k; + + @Nullable + private Integer numCandidates; + + @Nullable + private Float boost; + + @Nullable + private List filter; + + @Nullable + private Float similarity; + + @Nullable + private InnerHits innerHits; + + /** + * Required - The name of the vector field to search against + *

+ * API name: {@code field} + */ + public final Builder field(String value) { + this.field = value; + return this; + } + + /** + * The query vector + *

+ * API name: {@code query_vector} + *

+ * Adds all elements of list to queryVector. + */ + public final Builder queryVector(List list) { + this.queryVector = _listAddAll(this.queryVector, list); + return this; + } + + /** + * The query vector + *

+ * API name: {@code query_vector} + *

+ * Adds one or more values to queryVector. + */ + public final Builder queryVector(Float value, Float... values) { + this.queryVector = _listAdd(this.queryVector, value, values); + return this; + } + + /** + * The query vector builder. You must provide a query_vector_builder or + * query_vector, but not both. + *

+ * API name: {@code query_vector_builder} + */ + public final Builder queryVectorBuilder(@Nullable QueryVectorBuilder value) { + this.queryVectorBuilder = value; + return this; + } + + /** + * The query vector builder. You must provide a query_vector_builder or + * query_vector, but not both. + *

+ * API name: {@code query_vector_builder} + */ + public final Builder queryVectorBuilder( + Function> fn) { + return this.queryVectorBuilder(fn.apply(new QueryVectorBuilder.Builder()).build()); + } + + /** + * The final number of nearest neighbors to return as top hits + *

+ * API name: {@code k} + */ + public final Builder k(@Nullable Integer value) { + this.k = value; + return this; + } + + /** + * The number of nearest neighbor candidates to consider per shard + *

+ * API name: {@code num_candidates} + */ + public final Builder numCandidates(@Nullable Integer value) { + this.numCandidates = value; + return this; + } + + /** + * Boost value to apply to kNN scores + *

+ * API name: {@code boost} + */ + public final Builder boost(@Nullable Float value) { + this.boost = value; + return this; + } + + /** + * Filters for the kNN search query + *

+ * API name: {@code filter} + *

+ * Adds all elements of list to filter. + */ + public final Builder filter(List list) { + this.filter = _listAddAll(this.filter, list); + return this; + } + + /** + * Filters for the kNN search query + *

+ * API name: {@code filter} + *

+ * Adds one or more values to filter. + */ + public final Builder filter(Query value, Query... values) { + this.filter = _listAdd(this.filter, value, values); + return this; + } + + /** + * Filters for the kNN search query + *

+ * API name: {@code filter} + *

+ * Adds a value to filter using a builder lambda. + */ + public final Builder filter(Function> fn) { + return filter(fn.apply(new Query.Builder()).build()); + } + + /** + * The minimum similarity for a vector to be considered a match + *

+ * API name: {@code similarity} + */ + public final Builder similarity(@Nullable Float value) { + this.similarity = value; + return this; + } + + /** + * If defined, each search hit will contain inner hits. + *

+ * API name: {@code inner_hits} + */ + public final Builder innerHits(@Nullable InnerHits value) { + this.innerHits = value; + return this; + } + + /** + * If defined, each search hit will contain inner hits. + *

+ * API name: {@code inner_hits} + */ + public final Builder innerHits(Function> fn) { + return this.innerHits(fn.apply(new InnerHits.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link KnnSearch}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public KnnSearch build() { + _checkSingleUse(); + + return new KnnSearch(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link KnnSearch} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + KnnSearch::setupKnnSearchDeserializer); + + protected static void setupKnnSearchDeserializer(ObjectDeserializer op) { + + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); + op.add(Builder::queryVector, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.floatDeserializer()), + "query_vector"); + op.add(Builder::queryVectorBuilder, QueryVectorBuilder._DESERIALIZER, "query_vector_builder"); + op.add(Builder::k, JsonpDeserializer.integerDeserializer(), "k"); + op.add(Builder::numCandidates, JsonpDeserializer.integerDeserializer(), "num_candidates"); + op.add(Builder::boost, JsonpDeserializer.floatDeserializer(), "boost"); + op.add(Builder::filter, JsonpDeserializer.arrayDeserializer(Query._DESERIALIZER), "filter"); + op.add(Builder::similarity, JsonpDeserializer.floatDeserializer(), "similarity"); + op.add(Builder::innerHits, InnerHits._DESERIALIZER, "inner_hits"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/NodeStatistics.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/NodeStatistics.java deleted file mode 100644 index 81ddd2a58..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/NodeStatistics.java +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: _types.NodeStatistics - -/** - * Contains statistics about the number of nodes selected by the request. - * - * @see API - * specification - */ -@JsonpDeserializable -public class NodeStatistics implements JsonpSerializable { - private final List failures; - - private final int total; - - private final int successful; - - private final int failed; - - // --------------------------------------------------------------------------------------------- - - private NodeStatistics(Builder builder) { - - this.failures = ApiTypeHelper.unmodifiable(builder.failures); - this.total = ApiTypeHelper.requireNonNull(builder.total, this, "total"); - this.successful = ApiTypeHelper.requireNonNull(builder.successful, this, "successful"); - this.failed = ApiTypeHelper.requireNonNull(builder.failed, this, "failed"); - - } - - public static NodeStatistics of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * API name: {@code failures} - */ - public final List failures() { - return this.failures; - } - - /** - * Required - Total number of nodes selected by the request. - *

- * API name: {@code total} - */ - public final int total() { - return this.total; - } - - /** - * Required - Number of nodes that responded successfully to the request. - *

- * API name: {@code successful} - */ - public final int successful() { - return this.successful; - } - - /** - * Required - Number of nodes that rejected the request or failed to respond. If - * this value is not 0, a reason for the rejection or failure is included in the - * response. - *

- * API name: {@code failed} - */ - public final int failed() { - return this.failed; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.failures)) { - generator.writeKey("failures"); - generator.writeStartArray(); - for (ErrorCause item0 : this.failures) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - generator.writeKey("total"); - generator.write(this.total); - - generator.writeKey("successful"); - generator.write(this.successful); - - generator.writeKey("failed"); - generator.write(this.failed); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link NodeStatistics}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private List failures; - - private Integer total; - - private Integer successful; - - private Integer failed; - - /** - * API name: {@code failures} - *

- * Adds all elements of list to failures. - */ - public final Builder failures(List list) { - this.failures = _listAddAll(this.failures, list); - return this; - } - - /** - * API name: {@code failures} - *

- * Adds one or more values to failures. - */ - public final Builder failures(ErrorCause value, ErrorCause... values) { - this.failures = _listAdd(this.failures, value, values); - return this; - } - - /** - * API name: {@code failures} - *

- * Adds a value to failures using a builder lambda. - */ - public final Builder failures(Function> fn) { - return failures(fn.apply(new ErrorCause.Builder()).build()); - } - - /** - * Required - Total number of nodes selected by the request. - *

- * API name: {@code total} - */ - public final Builder total(int value) { - this.total = value; - return this; - } - - /** - * Required - Number of nodes that responded successfully to the request. - *

- * API name: {@code successful} - */ - public final Builder successful(int value) { - this.successful = value; - return this; - } - - /** - * Required - Number of nodes that rejected the request or failed to respond. If - * this value is not 0, a reason for the rejection or failure is included in the - * response. - *

- * API name: {@code failed} - */ - public final Builder failed(int value) { - this.failed = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link NodeStatistics}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public NodeStatistics build() { - _checkSingleUse(); - - return new NodeStatistics(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link NodeStatistics} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - NodeStatistics::setupNodeStatisticsDeserializer); - - protected static void setupNodeStatisticsDeserializer(ObjectDeserializer op) { - - op.add(Builder::failures, JsonpDeserializer.arrayDeserializer(ErrorCause._DESERIALIZER), "failures"); - op.add(Builder::total, JsonpDeserializer.integerDeserializer(), "total"); - op.add(Builder::successful, JsonpDeserializer.integerDeserializer(), "successful"); - op.add(Builder::failed, JsonpDeserializer.integerDeserializer(), "failed"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/PluginStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/PluginStats.java deleted file mode 100644 index 486ec84b7..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/PluginStats.java +++ /dev/null @@ -1,358 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: _types.PluginStats - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class PluginStats implements JsonpSerializable { - private final String classname; - - private final String description; - - private final String elasticsearchVersion; - - private final List extendedPlugins; - - private final boolean hasNativeController; - - private final String javaVersion; - - private final String name; - - private final String version; - - private final boolean licensed; - - // --------------------------------------------------------------------------------------------- - - private PluginStats(Builder builder) { - - this.classname = ApiTypeHelper.requireNonNull(builder.classname, this, "classname"); - this.description = ApiTypeHelper.requireNonNull(builder.description, this, "description"); - this.elasticsearchVersion = ApiTypeHelper.requireNonNull(builder.elasticsearchVersion, this, - "elasticsearchVersion"); - this.extendedPlugins = ApiTypeHelper.unmodifiableRequired(builder.extendedPlugins, this, "extendedPlugins"); - this.hasNativeController = ApiTypeHelper.requireNonNull(builder.hasNativeController, this, - "hasNativeController"); - this.javaVersion = ApiTypeHelper.requireNonNull(builder.javaVersion, this, "javaVersion"); - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.version = ApiTypeHelper.requireNonNull(builder.version, this, "version"); - this.licensed = ApiTypeHelper.requireNonNull(builder.licensed, this, "licensed"); - - } - - public static PluginStats of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code classname} - */ - public final String classname() { - return this.classname; - } - - /** - * Required - API name: {@code description} - */ - public final String description() { - return this.description; - } - - /** - * Required - API name: {@code elasticsearch_version} - */ - public final String elasticsearchVersion() { - return this.elasticsearchVersion; - } - - /** - * Required - API name: {@code extended_plugins} - */ - public final List extendedPlugins() { - return this.extendedPlugins; - } - - /** - * Required - API name: {@code has_native_controller} - */ - public final boolean hasNativeController() { - return this.hasNativeController; - } - - /** - * Required - API name: {@code java_version} - */ - public final String javaVersion() { - return this.javaVersion; - } - - /** - * Required - API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Required - API name: {@code version} - */ - public final String version() { - return this.version; - } - - /** - * Required - API name: {@code licensed} - */ - public final boolean licensed() { - return this.licensed; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("classname"); - generator.write(this.classname); - - generator.writeKey("description"); - generator.write(this.description); - - generator.writeKey("elasticsearch_version"); - generator.write(this.elasticsearchVersion); - - if (ApiTypeHelper.isDefined(this.extendedPlugins)) { - generator.writeKey("extended_plugins"); - generator.writeStartArray(); - for (String item0 : this.extendedPlugins) { - generator.write(item0); - - } - generator.writeEnd(); - - } - generator.writeKey("has_native_controller"); - generator.write(this.hasNativeController); - - generator.writeKey("java_version"); - generator.write(this.javaVersion); - - generator.writeKey("name"); - generator.write(this.name); - - generator.writeKey("version"); - generator.write(this.version); - - generator.writeKey("licensed"); - generator.write(this.licensed); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PluginStats}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String classname; - - private String description; - - private String elasticsearchVersion; - - private List extendedPlugins; - - private Boolean hasNativeController; - - private String javaVersion; - - private String name; - - private String version; - - private Boolean licensed; - - /** - * Required - API name: {@code classname} - */ - public final Builder classname(String value) { - this.classname = value; - return this; - } - - /** - * Required - API name: {@code description} - */ - public final Builder description(String value) { - this.description = value; - return this; - } - - /** - * Required - API name: {@code elasticsearch_version} - */ - public final Builder elasticsearchVersion(String value) { - this.elasticsearchVersion = value; - return this; - } - - /** - * Required - API name: {@code extended_plugins} - *

- * Adds all elements of list to extendedPlugins. - */ - public final Builder extendedPlugins(List list) { - this.extendedPlugins = _listAddAll(this.extendedPlugins, list); - return this; - } - - /** - * Required - API name: {@code extended_plugins} - *

- * Adds one or more values to extendedPlugins. - */ - public final Builder extendedPlugins(String value, String... values) { - this.extendedPlugins = _listAdd(this.extendedPlugins, value, values); - return this; - } - - /** - * Required - API name: {@code has_native_controller} - */ - public final Builder hasNativeController(boolean value) { - this.hasNativeController = value; - return this; - } - - /** - * Required - API name: {@code java_version} - */ - public final Builder javaVersion(String value) { - this.javaVersion = value; - return this; - } - - /** - * Required - API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Required - API name: {@code version} - */ - public final Builder version(String value) { - this.version = value; - return this; - } - - /** - * Required - API name: {@code licensed} - */ - public final Builder licensed(boolean value) { - this.licensed = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PluginStats}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PluginStats build() { - _checkSingleUse(); - - return new PluginStats(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PluginStats} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - PluginStats::setupPluginStatsDeserializer); - - protected static void setupPluginStatsDeserializer(ObjectDeserializer op) { - - op.add(Builder::classname, JsonpDeserializer.stringDeserializer(), "classname"); - op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description"); - op.add(Builder::elasticsearchVersion, JsonpDeserializer.stringDeserializer(), "elasticsearch_version"); - op.add(Builder::extendedPlugins, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "extended_plugins"); - op.add(Builder::hasNativeController, JsonpDeserializer.booleanDeserializer(), "has_native_controller"); - op.add(Builder::javaVersion, JsonpDeserializer.stringDeserializer(), "java_version"); - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version"); - op.add(Builder::licensed, JsonpDeserializer.booleanDeserializer(), "licensed"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryCacheStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryCacheStats.java deleted file mode 100644 index d7bcb2357..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryCacheStats.java +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: _types.QueryCacheStats - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class QueryCacheStats implements JsonpSerializable { - private final int cacheCount; - - private final int cacheSize; - - private final int evictions; - - private final int hitCount; - - @Nullable - private final String memorySize; - - private final long memorySizeInBytes; - - private final int missCount; - - private final int totalCount; - - // --------------------------------------------------------------------------------------------- - - private QueryCacheStats(Builder builder) { - - this.cacheCount = ApiTypeHelper.requireNonNull(builder.cacheCount, this, "cacheCount"); - this.cacheSize = ApiTypeHelper.requireNonNull(builder.cacheSize, this, "cacheSize"); - this.evictions = ApiTypeHelper.requireNonNull(builder.evictions, this, "evictions"); - this.hitCount = ApiTypeHelper.requireNonNull(builder.hitCount, this, "hitCount"); - this.memorySize = builder.memorySize; - this.memorySizeInBytes = ApiTypeHelper.requireNonNull(builder.memorySizeInBytes, this, "memorySizeInBytes"); - this.missCount = ApiTypeHelper.requireNonNull(builder.missCount, this, "missCount"); - this.totalCount = ApiTypeHelper.requireNonNull(builder.totalCount, this, "totalCount"); - - } - - public static QueryCacheStats of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Total number of entries added to the query cache across all shards - * assigned to selected nodes. This number includes current and evicted entries. - *

- * API name: {@code cache_count} - */ - public final int cacheCount() { - return this.cacheCount; - } - - /** - * Required - Total number of entries currently in the query cache across all - * shards assigned to selected nodes. - *

- * API name: {@code cache_size} - */ - public final int cacheSize() { - return this.cacheSize; - } - - /** - * Required - Total number of query cache evictions across all shards assigned - * to selected nodes. - *

- * API name: {@code evictions} - */ - public final int evictions() { - return this.evictions; - } - - /** - * Required - Total count of query cache hits across all shards assigned to - * selected nodes. - *

- * API name: {@code hit_count} - */ - public final int hitCount() { - return this.hitCount; - } - - /** - * Total amount of memory used for the query cache across all shards assigned to - * selected nodes. - *

- * API name: {@code memory_size} - */ - @Nullable - public final String memorySize() { - return this.memorySize; - } - - /** - * Required - Total amount, in bytes, of memory used for the query cache across - * all shards assigned to selected nodes. - *

- * API name: {@code memory_size_in_bytes} - */ - public final long memorySizeInBytes() { - return this.memorySizeInBytes; - } - - /** - * Required - Total count of query cache misses across all shards assigned to - * selected nodes. - *

- * API name: {@code miss_count} - */ - public final int missCount() { - return this.missCount; - } - - /** - * Required - Total count of hits and misses in the query cache across all - * shards assigned to selected nodes. - *

- * API name: {@code total_count} - */ - public final int totalCount() { - return this.totalCount; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("cache_count"); - generator.write(this.cacheCount); - - generator.writeKey("cache_size"); - generator.write(this.cacheSize); - - generator.writeKey("evictions"); - generator.write(this.evictions); - - generator.writeKey("hit_count"); - generator.write(this.hitCount); - - if (this.memorySize != null) { - generator.writeKey("memory_size"); - generator.write(this.memorySize); - - } - generator.writeKey("memory_size_in_bytes"); - generator.write(this.memorySizeInBytes); - - generator.writeKey("miss_count"); - generator.write(this.missCount); - - generator.writeKey("total_count"); - generator.write(this.totalCount); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link QueryCacheStats}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Integer cacheCount; - - private Integer cacheSize; - - private Integer evictions; - - private Integer hitCount; - - @Nullable - private String memorySize; - - private Long memorySizeInBytes; - - private Integer missCount; - - private Integer totalCount; - - /** - * Required - Total number of entries added to the query cache across all shards - * assigned to selected nodes. This number includes current and evicted entries. - *

- * API name: {@code cache_count} - */ - public final Builder cacheCount(int value) { - this.cacheCount = value; - return this; - } - - /** - * Required - Total number of entries currently in the query cache across all - * shards assigned to selected nodes. - *

- * API name: {@code cache_size} - */ - public final Builder cacheSize(int value) { - this.cacheSize = value; - return this; - } - - /** - * Required - Total number of query cache evictions across all shards assigned - * to selected nodes. - *

- * API name: {@code evictions} - */ - public final Builder evictions(int value) { - this.evictions = value; - return this; - } - - /** - * Required - Total count of query cache hits across all shards assigned to - * selected nodes. - *

- * API name: {@code hit_count} - */ - public final Builder hitCount(int value) { - this.hitCount = value; - return this; - } - - /** - * Total amount of memory used for the query cache across all shards assigned to - * selected nodes. - *

- * API name: {@code memory_size} - */ - public final Builder memorySize(@Nullable String value) { - this.memorySize = value; - return this; - } - - /** - * Required - Total amount, in bytes, of memory used for the query cache across - * all shards assigned to selected nodes. - *

- * API name: {@code memory_size_in_bytes} - */ - public final Builder memorySizeInBytes(long value) { - this.memorySizeInBytes = value; - return this; - } - - /** - * Required - Total count of query cache misses across all shards assigned to - * selected nodes. - *

- * API name: {@code miss_count} - */ - public final Builder missCount(int value) { - this.missCount = value; - return this; - } - - /** - * Required - Total count of hits and misses in the query cache across all - * shards assigned to selected nodes. - *

- * API name: {@code total_count} - */ - public final Builder totalCount(int value) { - this.totalCount = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link QueryCacheStats}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public QueryCacheStats build() { - _checkSingleUse(); - - return new QueryCacheStats(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link QueryCacheStats} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - QueryCacheStats::setupQueryCacheStatsDeserializer); - - protected static void setupQueryCacheStatsDeserializer(ObjectDeserializer op) { - - op.add(Builder::cacheCount, JsonpDeserializer.integerDeserializer(), "cache_count"); - op.add(Builder::cacheSize, JsonpDeserializer.integerDeserializer(), "cache_size"); - op.add(Builder::evictions, JsonpDeserializer.integerDeserializer(), "evictions"); - op.add(Builder::hitCount, JsonpDeserializer.integerDeserializer(), "hit_count"); - op.add(Builder::memorySize, JsonpDeserializer.stringDeserializer(), "memory_size"); - op.add(Builder::memorySizeInBytes, JsonpDeserializer.longDeserializer(), "memory_size_in_bytes"); - op.add(Builder::missCount, JsonpDeserializer.integerDeserializer(), "miss_count"); - op.add(Builder::totalCount, JsonpDeserializer.integerDeserializer(), "total_count"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RRFRetriever.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RRFRetriever.java new file mode 100644 index 000000000..a828554de --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RRFRetriever.java @@ -0,0 +1,256 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.Integer; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.RRFRetriever + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class RRFRetriever extends RetrieverBase implements RetrieverVariant { + private final List retrievers; + + @Nullable + private final Integer rankConstant; + + @Nullable + private final Integer rankWindowSize; + + // --------------------------------------------------------------------------------------------- + + private RRFRetriever(Builder builder) { + super(builder); + + this.retrievers = ApiTypeHelper.unmodifiableRequired(builder.retrievers, this, "retrievers"); + this.rankConstant = builder.rankConstant; + this.rankWindowSize = builder.rankWindowSize; + + } + + public static RRFRetriever of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Retriever variant kind. + */ + @Override + public Retriever.Kind _retrieverKind() { + return Retriever.Kind.Rrf; + } + + /** + * Required - A list of child retrievers to specify which sets of returned top + * documents will have the RRF formula applied to them. + *

+ * API name: {@code retrievers} + */ + public final List retrievers() { + return this.retrievers; + } + + /** + * This value determines how much influence documents in individual result sets + * per query have over the final ranked result set. + *

+ * API name: {@code rank_constant} + */ + @Nullable + public final Integer rankConstant() { + return this.rankConstant; + } + + /** + * This value determines the size of the individual result sets per query. + *

+ * API name: {@code rank_window_size} + */ + @Nullable + public final Integer rankWindowSize() { + return this.rankWindowSize; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + super.serializeInternal(generator, mapper); + if (ApiTypeHelper.isDefined(this.retrievers)) { + generator.writeKey("retrievers"); + generator.writeStartArray(); + for (Retriever item0 : this.retrievers) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.rankConstant != null) { + generator.writeKey("rank_constant"); + generator.write(this.rankConstant); + + } + if (this.rankWindowSize != null) { + generator.writeKey("rank_window_size"); + generator.write(this.rankWindowSize); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link RRFRetriever}. + */ + + public static class Builder extends RetrieverBase.AbstractBuilder implements ObjectBuilder { + private List retrievers; + + @Nullable + private Integer rankConstant; + + @Nullable + private Integer rankWindowSize; + + /** + * Required - A list of child retrievers to specify which sets of returned top + * documents will have the RRF formula applied to them. + *

+ * API name: {@code retrievers} + *

+ * Adds all elements of list to retrievers. + */ + public final Builder retrievers(List list) { + this.retrievers = _listAddAll(this.retrievers, list); + return this; + } + + /** + * Required - A list of child retrievers to specify which sets of returned top + * documents will have the RRF formula applied to them. + *

+ * API name: {@code retrievers} + *

+ * Adds one or more values to retrievers. + */ + public final Builder retrievers(Retriever value, Retriever... values) { + this.retrievers = _listAdd(this.retrievers, value, values); + return this; + } + + /** + * Required - A list of child retrievers to specify which sets of returned top + * documents will have the RRF formula applied to them. + *

+ * API name: {@code retrievers} + *

+ * Adds a value to retrievers using a builder lambda. + */ + public final Builder retrievers(Function> fn) { + return retrievers(fn.apply(new Retriever.Builder()).build()); + } + + /** + * This value determines how much influence documents in individual result sets + * per query have over the final ranked result set. + *

+ * API name: {@code rank_constant} + */ + public final Builder rankConstant(@Nullable Integer value) { + this.rankConstant = value; + return this; + } + + /** + * This value determines the size of the individual result sets per query. + *

+ * API name: {@code rank_window_size} + */ + public final Builder rankWindowSize(@Nullable Integer value) { + this.rankWindowSize = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link RRFRetriever}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public RRFRetriever build() { + _checkSingleUse(); + + return new RRFRetriever(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link RRFRetriever} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + RRFRetriever::setupRRFRetrieverDeserializer); + + protected static void setupRRFRetrieverDeserializer(ObjectDeserializer op) { + RetrieverBase.setupRetrieverBaseDeserializer(op); + op.add(Builder::retrievers, JsonpDeserializer.arrayDeserializer(Retriever._DESERIALIZER), "retrievers"); + op.add(Builder::rankConstant, JsonpDeserializer.integerDeserializer(), "rank_constant"); + op.add(Builder::rankWindowSize, JsonpDeserializer.integerDeserializer(), "rank_window_size"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Retriever.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Retriever.java new file mode 100644 index 000000000..478fdc197 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Retriever.java @@ -0,0 +1,252 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Object; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.RetrieverContainer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Retriever implements TaggedUnion, JsonpSerializable { + + /** + * {@link Retriever} variant kinds. + * + * @see API + * specification + */ + + public enum Kind implements JsonEnum { + Standard("standard"), + + Knn("knn"), + + Rrf("rrf"), + + ; + + private final String jsonValue; + + Kind(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + public Retriever(RetrieverVariant value) { + + this._kind = ApiTypeHelper.requireNonNull(value._retrieverKind(), this, ""); + this._value = ApiTypeHelper.requireNonNull(value, this, ""); + + } + + private Retriever(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + + } + + public static Retriever of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Is this variant instance of kind {@code standard}? + */ + public boolean isStandard() { + return _kind == Kind.Standard; + } + + /** + * Get the {@code standard} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code standard} kind. + */ + public StandardRetriever standard() { + return TaggedUnionUtils.get(this, Kind.Standard); + } + + /** + * Is this variant instance of kind {@code knn}? + */ + public boolean isKnn() { + return _kind == Kind.Knn; + } + + /** + * Get the {@code knn} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code knn} kind. + */ + public KnnRetriever knn() { + return TaggedUnionUtils.get(this, Kind.Knn); + } + + /** + * Is this variant instance of kind {@code rrf}? + */ + public boolean isRrf() { + return _kind == Kind.Rrf; + } + + /** + * Get the {@code rrf} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code rrf} kind. + */ + public RRFRetriever rrf() { + return TaggedUnionUtils.get(this, Kind.Rrf); + } + + @Override + @SuppressWarnings("unchecked") + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeStartObject(); + + generator.writeKey(_kind.jsonValue()); + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } + + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Kind _kind; + private Object _value; + + @Override + protected Builder self() { + return this; + } + public ObjectBuilder standard(StandardRetriever v) { + this._kind = Kind.Standard; + this._value = v; + return this; + } + + public ObjectBuilder standard( + Function> fn) { + return this.standard(fn.apply(new StandardRetriever.Builder()).build()); + } + + public ObjectBuilder knn(KnnRetriever v) { + this._kind = Kind.Knn; + this._value = v; + return this; + } + + public ObjectBuilder knn(Function> fn) { + return this.knn(fn.apply(new KnnRetriever.Builder()).build()); + } + + public ObjectBuilder rrf(RRFRetriever v) { + this._kind = Kind.Rrf; + this._value = v; + return this; + } + + public ObjectBuilder rrf(Function> fn) { + return this.rrf(fn.apply(new RRFRetriever.Builder()).build()); + } + + public Retriever build() { + _checkSingleUse(); + return new Retriever(this); + } + + } + + protected static void setupRetrieverDeserializer(ObjectDeserializer op) { + + op.add(Builder::standard, StandardRetriever._DESERIALIZER, "standard"); + op.add(Builder::knn, KnnRetriever._DESERIALIZER, "knn"); + op.add(Builder::rrf, RRFRetriever._DESERIALIZER, "rrf"); + + } + + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Retriever::setupRetrieverDeserializer, Builder::build); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverBase.java new file mode 100644 index 000000000..6ceefd82f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverBase.java @@ -0,0 +1,164 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.RetrieverBase + +/** + * + * @see API + * specification + */ + +public abstract class RetrieverBase implements JsonpSerializable { + private final List filter; + + // --------------------------------------------------------------------------------------------- + + protected RetrieverBase(AbstractBuilder builder) { + + this.filter = ApiTypeHelper.unmodifiable(builder.filter); + + } + + /** + * Query to filter the documents that can match. + *

+ * API name: {@code filter} + */ + public final List filter() { + return this.filter; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + if (ApiTypeHelper.isDefined(this.filter)) { + generator.writeKey("filter"); + generator.writeStartArray(); + for (Query item0 : this.filter) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public abstract static class AbstractBuilder> + extends + WithJsonObjectBuilderBase { + @Nullable + private List filter; + + /** + * Query to filter the documents that can match. + *

+ * API name: {@code filter} + *

+ * Adds all elements of list to filter. + */ + public final BuilderT filter(List list) { + this.filter = _listAddAll(this.filter, list); + return self(); + } + + /** + * Query to filter the documents that can match. + *

+ * API name: {@code filter} + *

+ * Adds one or more values to filter. + */ + public final BuilderT filter(Query value, Query... values) { + this.filter = _listAdd(this.filter, value, values); + return self(); + } + + /** + * Query to filter the documents that can match. + *

+ * API name: {@code filter} + *

+ * Adds a value to filter using a builder lambda. + */ + public final BuilderT filter(Function> fn) { + return filter(fn.apply(new Query.Builder()).build()); + } + + protected abstract BuilderT self(); + + } + + // --------------------------------------------------------------------------------------------- + protected static > void setupRetrieverBaseDeserializer( + ObjectDeserializer op) { + + op.add(AbstractBuilder::filter, JsonpDeserializer.arrayDeserializer(Query._DESERIALIZER), "filter"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverBuilders.java new file mode 100644 index 000000000..5a3625e40 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverBuilders.java @@ -0,0 +1,99 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Builders for {@link Retriever} variants. + */ +public class RetrieverBuilders { + private RetrieverBuilders() { + } + + /** + * Creates a builder for the {@link StandardRetriever standard} + * {@code Retriever} variant. + */ + public static StandardRetriever.Builder standard() { + return new StandardRetriever.Builder(); + } + + /** + * Creates a Retriever of the {@link StandardRetriever standard} + * {@code Retriever} variant. + */ + public static Retriever standard(Function> fn) { + Retriever.Builder builder = new Retriever.Builder(); + builder.standard(fn.apply(new StandardRetriever.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link KnnRetriever knn} {@code Retriever} variant. + */ + public static KnnRetriever.Builder knn() { + return new KnnRetriever.Builder(); + } + + /** + * Creates a Retriever of the {@link KnnRetriever knn} {@code Retriever} + * variant. + */ + public static Retriever knn(Function> fn) { + Retriever.Builder builder = new Retriever.Builder(); + builder.knn(fn.apply(new KnnRetriever.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link RRFRetriever rrf} {@code Retriever} variant. + */ + public static RRFRetriever.Builder rrf() { + return new RRFRetriever.Builder(); + } + + /** + * Creates a Retriever of the {@link RRFRetriever rrf} {@code Retriever} + * variant. + */ + public static Retriever rrf(Function> fn) { + Retriever.Builder builder = new Retriever.Builder(); + builder.rrf(fn.apply(new RRFRetriever.Builder()).build()); + return builder.build(); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverVariant.java new file mode 100644 index 000000000..d220f68c3 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RetrieverVariant.java @@ -0,0 +1,48 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Base interface for {@link Retriever} variants. + */ +public interface RetrieverVariant { + + Retriever.Kind _retrieverKind(); + + default Retriever _toRetriever() { + return new Retriever(this); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SegmentsStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SegmentsStats.java deleted file mode 100644 index 20be23811..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SegmentsStats.java +++ /dev/null @@ -1,935 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.elasticsearch.indices.stats.ShardFileSizeInfo; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: _types.SegmentsStats - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class SegmentsStats implements JsonpSerializable { - private final int count; - - @Nullable - private final String docValuesMemory; - - private final long docValuesMemoryInBytes; - - private final Map fileSizes; - - @Nullable - private final String fixedBitSet; - - private final long fixedBitSetMemoryInBytes; - - @Nullable - private final String indexWriterMemory; - - @Nullable - private final Long indexWriterMaxMemoryInBytes; - - private final long indexWriterMemoryInBytes; - - private final long maxUnsafeAutoIdTimestamp; - - @Nullable - private final String memory; - - private final long memoryInBytes; - - @Nullable - private final String normsMemory; - - private final long normsMemoryInBytes; - - @Nullable - private final String pointsMemory; - - private final long pointsMemoryInBytes; - - @Nullable - private final String storedMemory; - - private final long storedFieldsMemoryInBytes; - - private final long termsMemoryInBytes; - - @Nullable - private final String termsMemory; - - @Nullable - private final String termVectoryMemory; - - private final long termVectorsMemoryInBytes; - - @Nullable - private final String versionMapMemory; - - private final long versionMapMemoryInBytes; - - // --------------------------------------------------------------------------------------------- - - private SegmentsStats(Builder builder) { - - this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); - this.docValuesMemory = builder.docValuesMemory; - this.docValuesMemoryInBytes = ApiTypeHelper.requireNonNull(builder.docValuesMemoryInBytes, this, - "docValuesMemoryInBytes"); - this.fileSizes = ApiTypeHelper.unmodifiableRequired(builder.fileSizes, this, "fileSizes"); - this.fixedBitSet = builder.fixedBitSet; - this.fixedBitSetMemoryInBytes = ApiTypeHelper.requireNonNull(builder.fixedBitSetMemoryInBytes, this, - "fixedBitSetMemoryInBytes"); - this.indexWriterMemory = builder.indexWriterMemory; - this.indexWriterMaxMemoryInBytes = builder.indexWriterMaxMemoryInBytes; - this.indexWriterMemoryInBytes = ApiTypeHelper.requireNonNull(builder.indexWriterMemoryInBytes, this, - "indexWriterMemoryInBytes"); - this.maxUnsafeAutoIdTimestamp = ApiTypeHelper.requireNonNull(builder.maxUnsafeAutoIdTimestamp, this, - "maxUnsafeAutoIdTimestamp"); - this.memory = builder.memory; - this.memoryInBytes = ApiTypeHelper.requireNonNull(builder.memoryInBytes, this, "memoryInBytes"); - this.normsMemory = builder.normsMemory; - this.normsMemoryInBytes = ApiTypeHelper.requireNonNull(builder.normsMemoryInBytes, this, "normsMemoryInBytes"); - this.pointsMemory = builder.pointsMemory; - this.pointsMemoryInBytes = ApiTypeHelper.requireNonNull(builder.pointsMemoryInBytes, this, - "pointsMemoryInBytes"); - this.storedMemory = builder.storedMemory; - this.storedFieldsMemoryInBytes = ApiTypeHelper.requireNonNull(builder.storedFieldsMemoryInBytes, this, - "storedFieldsMemoryInBytes"); - this.termsMemoryInBytes = ApiTypeHelper.requireNonNull(builder.termsMemoryInBytes, this, "termsMemoryInBytes"); - this.termsMemory = builder.termsMemory; - this.termVectoryMemory = builder.termVectoryMemory; - this.termVectorsMemoryInBytes = ApiTypeHelper.requireNonNull(builder.termVectorsMemoryInBytes, this, - "termVectorsMemoryInBytes"); - this.versionMapMemory = builder.versionMapMemory; - this.versionMapMemoryInBytes = ApiTypeHelper.requireNonNull(builder.versionMapMemoryInBytes, this, - "versionMapMemoryInBytes"); - - } - - public static SegmentsStats of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Total number of segments across all shards assigned to selected - * nodes. - *

- * API name: {@code count} - */ - public final int count() { - return this.count; - } - - /** - * Total amount of memory used for doc values across all shards assigned to - * selected nodes. - *

- * API name: {@code doc_values_memory} - */ - @Nullable - public final String docValuesMemory() { - return this.docValuesMemory; - } - - /** - * Required - Total amount, in bytes, of memory used for doc values across all - * shards assigned to selected nodes. - *

- * API name: {@code doc_values_memory_in_bytes} - */ - public final long docValuesMemoryInBytes() { - return this.docValuesMemoryInBytes; - } - - /** - * Required - This object is not populated by the cluster stats API. To get - * information on segment files, use the node stats API. - *

- * API name: {@code file_sizes} - */ - public final Map fileSizes() { - return this.fileSizes; - } - - /** - * Total amount of memory used by fixed bit sets across all shards assigned to - * selected nodes. Fixed bit sets are used for nested object field types and - * type filters for join fields. - *

- * API name: {@code fixed_bit_set} - */ - @Nullable - public final String fixedBitSet() { - return this.fixedBitSet; - } - - /** - * Required - Total amount of memory, in bytes, used by fixed bit sets across - * all shards assigned to selected nodes. - *

- * API name: {@code fixed_bit_set_memory_in_bytes} - */ - public final long fixedBitSetMemoryInBytes() { - return this.fixedBitSetMemoryInBytes; - } - - /** - * Total amount of memory used by all index writers across all shards assigned - * to selected nodes. - *

- * API name: {@code index_writer_memory} - */ - @Nullable - public final String indexWriterMemory() { - return this.indexWriterMemory; - } - - /** - * API name: {@code index_writer_max_memory_in_bytes} - */ - @Nullable - public final Long indexWriterMaxMemoryInBytes() { - return this.indexWriterMaxMemoryInBytes; - } - - /** - * Required - Total amount, in bytes, of memory used by all index writers across - * all shards assigned to selected nodes. - *

- * API name: {@code index_writer_memory_in_bytes} - */ - public final long indexWriterMemoryInBytes() { - return this.indexWriterMemoryInBytes; - } - - /** - * Required - Unix timestamp, in milliseconds, of the most recently retried - * indexing request. - *

- * API name: {@code max_unsafe_auto_id_timestamp} - */ - public final long maxUnsafeAutoIdTimestamp() { - return this.maxUnsafeAutoIdTimestamp; - } - - /** - * Total amount of memory used for segments across all shards assigned to - * selected nodes. - *

- * API name: {@code memory} - */ - @Nullable - public final String memory() { - return this.memory; - } - - /** - * Required - Total amount, in bytes, of memory used for segments across all - * shards assigned to selected nodes. - *

- * API name: {@code memory_in_bytes} - */ - public final long memoryInBytes() { - return this.memoryInBytes; - } - - /** - * Total amount of memory used for normalization factors across all shards - * assigned to selected nodes. - *

- * API name: {@code norms_memory} - */ - @Nullable - public final String normsMemory() { - return this.normsMemory; - } - - /** - * Required - Total amount, in bytes, of memory used for normalization factors - * across all shards assigned to selected nodes. - *

- * API name: {@code norms_memory_in_bytes} - */ - public final long normsMemoryInBytes() { - return this.normsMemoryInBytes; - } - - /** - * Total amount of memory used for points across all shards assigned to selected - * nodes. - *

- * API name: {@code points_memory} - */ - @Nullable - public final String pointsMemory() { - return this.pointsMemory; - } - - /** - * Required - Total amount, in bytes, of memory used for points across all - * shards assigned to selected nodes. - *

- * API name: {@code points_memory_in_bytes} - */ - public final long pointsMemoryInBytes() { - return this.pointsMemoryInBytes; - } - - /** - * API name: {@code stored_memory} - */ - @Nullable - public final String storedMemory() { - return this.storedMemory; - } - - /** - * Required - Total amount, in bytes, of memory used for stored fields across - * all shards assigned to selected nodes. - *

- * API name: {@code stored_fields_memory_in_bytes} - */ - public final long storedFieldsMemoryInBytes() { - return this.storedFieldsMemoryInBytes; - } - - /** - * Required - Total amount, in bytes, of memory used for terms across all shards - * assigned to selected nodes. - *

- * API name: {@code terms_memory_in_bytes} - */ - public final long termsMemoryInBytes() { - return this.termsMemoryInBytes; - } - - /** - * Total amount of memory used for terms across all shards assigned to selected - * nodes. - *

- * API name: {@code terms_memory} - */ - @Nullable - public final String termsMemory() { - return this.termsMemory; - } - - /** - * Total amount of memory used for term vectors across all shards assigned to - * selected nodes. - *

- * API name: {@code term_vectory_memory} - */ - @Nullable - public final String termVectoryMemory() { - return this.termVectoryMemory; - } - - /** - * Required - Total amount, in bytes, of memory used for term vectors across all - * shards assigned to selected nodes. - *

- * API name: {@code term_vectors_memory_in_bytes} - */ - public final long termVectorsMemoryInBytes() { - return this.termVectorsMemoryInBytes; - } - - /** - * Total amount of memory used by all version maps across all shards assigned to - * selected nodes. - *

- * API name: {@code version_map_memory} - */ - @Nullable - public final String versionMapMemory() { - return this.versionMapMemory; - } - - /** - * Required - Total amount, in bytes, of memory used by all version maps across - * all shards assigned to selected nodes. - *

- * API name: {@code version_map_memory_in_bytes} - */ - public final long versionMapMemoryInBytes() { - return this.versionMapMemoryInBytes; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("count"); - generator.write(this.count); - - if (this.docValuesMemory != null) { - generator.writeKey("doc_values_memory"); - generator.write(this.docValuesMemory); - - } - generator.writeKey("doc_values_memory_in_bytes"); - generator.write(this.docValuesMemoryInBytes); - - if (ApiTypeHelper.isDefined(this.fileSizes)) { - generator.writeKey("file_sizes"); - generator.writeStartObject(); - for (Map.Entry item0 : this.fileSizes.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.fixedBitSet != null) { - generator.writeKey("fixed_bit_set"); - generator.write(this.fixedBitSet); - - } - generator.writeKey("fixed_bit_set_memory_in_bytes"); - generator.write(this.fixedBitSetMemoryInBytes); - - if (this.indexWriterMemory != null) { - generator.writeKey("index_writer_memory"); - generator.write(this.indexWriterMemory); - - } - if (this.indexWriterMaxMemoryInBytes != null) { - generator.writeKey("index_writer_max_memory_in_bytes"); - generator.write(this.indexWriterMaxMemoryInBytes); - - } - generator.writeKey("index_writer_memory_in_bytes"); - generator.write(this.indexWriterMemoryInBytes); - - generator.writeKey("max_unsafe_auto_id_timestamp"); - generator.write(this.maxUnsafeAutoIdTimestamp); - - if (this.memory != null) { - generator.writeKey("memory"); - generator.write(this.memory); - - } - generator.writeKey("memory_in_bytes"); - generator.write(this.memoryInBytes); - - if (this.normsMemory != null) { - generator.writeKey("norms_memory"); - generator.write(this.normsMemory); - - } - generator.writeKey("norms_memory_in_bytes"); - generator.write(this.normsMemoryInBytes); - - if (this.pointsMemory != null) { - generator.writeKey("points_memory"); - generator.write(this.pointsMemory); - - } - generator.writeKey("points_memory_in_bytes"); - generator.write(this.pointsMemoryInBytes); - - if (this.storedMemory != null) { - generator.writeKey("stored_memory"); - generator.write(this.storedMemory); - - } - generator.writeKey("stored_fields_memory_in_bytes"); - generator.write(this.storedFieldsMemoryInBytes); - - generator.writeKey("terms_memory_in_bytes"); - generator.write(this.termsMemoryInBytes); - - if (this.termsMemory != null) { - generator.writeKey("terms_memory"); - generator.write(this.termsMemory); - - } - if (this.termVectoryMemory != null) { - generator.writeKey("term_vectory_memory"); - generator.write(this.termVectoryMemory); - - } - generator.writeKey("term_vectors_memory_in_bytes"); - generator.write(this.termVectorsMemoryInBytes); - - if (this.versionMapMemory != null) { - generator.writeKey("version_map_memory"); - generator.write(this.versionMapMemory); - - } - generator.writeKey("version_map_memory_in_bytes"); - generator.write(this.versionMapMemoryInBytes); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SegmentsStats}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Integer count; - - @Nullable - private String docValuesMemory; - - private Long docValuesMemoryInBytes; - - private Map fileSizes; - - @Nullable - private String fixedBitSet; - - private Long fixedBitSetMemoryInBytes; - - @Nullable - private String indexWriterMemory; - - @Nullable - private Long indexWriterMaxMemoryInBytes; - - private Long indexWriterMemoryInBytes; - - private Long maxUnsafeAutoIdTimestamp; - - @Nullable - private String memory; - - private Long memoryInBytes; - - @Nullable - private String normsMemory; - - private Long normsMemoryInBytes; - - @Nullable - private String pointsMemory; - - private Long pointsMemoryInBytes; - - @Nullable - private String storedMemory; - - private Long storedFieldsMemoryInBytes; - - private Long termsMemoryInBytes; - - @Nullable - private String termsMemory; - - @Nullable - private String termVectoryMemory; - - private Long termVectorsMemoryInBytes; - - @Nullable - private String versionMapMemory; - - private Long versionMapMemoryInBytes; - - /** - * Required - Total number of segments across all shards assigned to selected - * nodes. - *

- * API name: {@code count} - */ - public final Builder count(int value) { - this.count = value; - return this; - } - - /** - * Total amount of memory used for doc values across all shards assigned to - * selected nodes. - *

- * API name: {@code doc_values_memory} - */ - public final Builder docValuesMemory(@Nullable String value) { - this.docValuesMemory = value; - return this; - } - - /** - * Required - Total amount, in bytes, of memory used for doc values across all - * shards assigned to selected nodes. - *

- * API name: {@code doc_values_memory_in_bytes} - */ - public final Builder docValuesMemoryInBytes(long value) { - this.docValuesMemoryInBytes = value; - return this; - } - - /** - * Required - This object is not populated by the cluster stats API. To get - * information on segment files, use the node stats API. - *

- * API name: {@code file_sizes} - *

- * Adds all entries of map to fileSizes. - */ - public final Builder fileSizes(Map map) { - this.fileSizes = _mapPutAll(this.fileSizes, map); - return this; - } - - /** - * Required - This object is not populated by the cluster stats API. To get - * information on segment files, use the node stats API. - *

- * API name: {@code file_sizes} - *

- * Adds an entry to fileSizes. - */ - public final Builder fileSizes(String key, ShardFileSizeInfo value) { - this.fileSizes = _mapPut(this.fileSizes, key, value); - return this; - } - - /** - * Required - This object is not populated by the cluster stats API. To get - * information on segment files, use the node stats API. - *

- * API name: {@code file_sizes} - *

- * Adds an entry to fileSizes using a builder lambda. - */ - public final Builder fileSizes(String key, - Function> fn) { - return fileSizes(key, fn.apply(new ShardFileSizeInfo.Builder()).build()); - } - - /** - * Total amount of memory used by fixed bit sets across all shards assigned to - * selected nodes. Fixed bit sets are used for nested object field types and - * type filters for join fields. - *

- * API name: {@code fixed_bit_set} - */ - public final Builder fixedBitSet(@Nullable String value) { - this.fixedBitSet = value; - return this; - } - - /** - * Required - Total amount of memory, in bytes, used by fixed bit sets across - * all shards assigned to selected nodes. - *

- * API name: {@code fixed_bit_set_memory_in_bytes} - */ - public final Builder fixedBitSetMemoryInBytes(long value) { - this.fixedBitSetMemoryInBytes = value; - return this; - } - - /** - * Total amount of memory used by all index writers across all shards assigned - * to selected nodes. - *

- * API name: {@code index_writer_memory} - */ - public final Builder indexWriterMemory(@Nullable String value) { - this.indexWriterMemory = value; - return this; - } - - /** - * API name: {@code index_writer_max_memory_in_bytes} - */ - public final Builder indexWriterMaxMemoryInBytes(@Nullable Long value) { - this.indexWriterMaxMemoryInBytes = value; - return this; - } - - /** - * Required - Total amount, in bytes, of memory used by all index writers across - * all shards assigned to selected nodes. - *

- * API name: {@code index_writer_memory_in_bytes} - */ - public final Builder indexWriterMemoryInBytes(long value) { - this.indexWriterMemoryInBytes = value; - return this; - } - - /** - * Required - Unix timestamp, in milliseconds, of the most recently retried - * indexing request. - *

- * API name: {@code max_unsafe_auto_id_timestamp} - */ - public final Builder maxUnsafeAutoIdTimestamp(long value) { - this.maxUnsafeAutoIdTimestamp = value; - return this; - } - - /** - * Total amount of memory used for segments across all shards assigned to - * selected nodes. - *

- * API name: {@code memory} - */ - public final Builder memory(@Nullable String value) { - this.memory = value; - return this; - } - - /** - * Required - Total amount, in bytes, of memory used for segments across all - * shards assigned to selected nodes. - *

- * API name: {@code memory_in_bytes} - */ - public final Builder memoryInBytes(long value) { - this.memoryInBytes = value; - return this; - } - - /** - * Total amount of memory used for normalization factors across all shards - * assigned to selected nodes. - *

- * API name: {@code norms_memory} - */ - public final Builder normsMemory(@Nullable String value) { - this.normsMemory = value; - return this; - } - - /** - * Required - Total amount, in bytes, of memory used for normalization factors - * across all shards assigned to selected nodes. - *

- * API name: {@code norms_memory_in_bytes} - */ - public final Builder normsMemoryInBytes(long value) { - this.normsMemoryInBytes = value; - return this; - } - - /** - * Total amount of memory used for points across all shards assigned to selected - * nodes. - *

- * API name: {@code points_memory} - */ - public final Builder pointsMemory(@Nullable String value) { - this.pointsMemory = value; - return this; - } - - /** - * Required - Total amount, in bytes, of memory used for points across all - * shards assigned to selected nodes. - *

- * API name: {@code points_memory_in_bytes} - */ - public final Builder pointsMemoryInBytes(long value) { - this.pointsMemoryInBytes = value; - return this; - } - - /** - * API name: {@code stored_memory} - */ - public final Builder storedMemory(@Nullable String value) { - this.storedMemory = value; - return this; - } - - /** - * Required - Total amount, in bytes, of memory used for stored fields across - * all shards assigned to selected nodes. - *

- * API name: {@code stored_fields_memory_in_bytes} - */ - public final Builder storedFieldsMemoryInBytes(long value) { - this.storedFieldsMemoryInBytes = value; - return this; - } - - /** - * Required - Total amount, in bytes, of memory used for terms across all shards - * assigned to selected nodes. - *

- * API name: {@code terms_memory_in_bytes} - */ - public final Builder termsMemoryInBytes(long value) { - this.termsMemoryInBytes = value; - return this; - } - - /** - * Total amount of memory used for terms across all shards assigned to selected - * nodes. - *

- * API name: {@code terms_memory} - */ - public final Builder termsMemory(@Nullable String value) { - this.termsMemory = value; - return this; - } - - /** - * Total amount of memory used for term vectors across all shards assigned to - * selected nodes. - *

- * API name: {@code term_vectory_memory} - */ - public final Builder termVectoryMemory(@Nullable String value) { - this.termVectoryMemory = value; - return this; - } - - /** - * Required - Total amount, in bytes, of memory used for term vectors across all - * shards assigned to selected nodes. - *

- * API name: {@code term_vectors_memory_in_bytes} - */ - public final Builder termVectorsMemoryInBytes(long value) { - this.termVectorsMemoryInBytes = value; - return this; - } - - /** - * Total amount of memory used by all version maps across all shards assigned to - * selected nodes. - *

- * API name: {@code version_map_memory} - */ - public final Builder versionMapMemory(@Nullable String value) { - this.versionMapMemory = value; - return this; - } - - /** - * Required - Total amount, in bytes, of memory used by all version maps across - * all shards assigned to selected nodes. - *

- * API name: {@code version_map_memory_in_bytes} - */ - public final Builder versionMapMemoryInBytes(long value) { - this.versionMapMemoryInBytes = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link SegmentsStats}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SegmentsStats build() { - _checkSingleUse(); - - return new SegmentsStats(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SegmentsStats} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - SegmentsStats::setupSegmentsStatsDeserializer); - - protected static void setupSegmentsStatsDeserializer(ObjectDeserializer op) { - - op.add(Builder::count, JsonpDeserializer.integerDeserializer(), "count"); - op.add(Builder::docValuesMemory, JsonpDeserializer.stringDeserializer(), "doc_values_memory"); - op.add(Builder::docValuesMemoryInBytes, JsonpDeserializer.longDeserializer(), "doc_values_memory_in_bytes"); - op.add(Builder::fileSizes, JsonpDeserializer.stringMapDeserializer(ShardFileSizeInfo._DESERIALIZER), - "file_sizes"); - op.add(Builder::fixedBitSet, JsonpDeserializer.stringDeserializer(), "fixed_bit_set"); - op.add(Builder::fixedBitSetMemoryInBytes, JsonpDeserializer.longDeserializer(), - "fixed_bit_set_memory_in_bytes"); - op.add(Builder::indexWriterMemory, JsonpDeserializer.stringDeserializer(), "index_writer_memory"); - op.add(Builder::indexWriterMaxMemoryInBytes, JsonpDeserializer.longDeserializer(), - "index_writer_max_memory_in_bytes"); - op.add(Builder::indexWriterMemoryInBytes, JsonpDeserializer.longDeserializer(), "index_writer_memory_in_bytes"); - op.add(Builder::maxUnsafeAutoIdTimestamp, JsonpDeserializer.longDeserializer(), "max_unsafe_auto_id_timestamp"); - op.add(Builder::memory, JsonpDeserializer.stringDeserializer(), "memory"); - op.add(Builder::memoryInBytes, JsonpDeserializer.longDeserializer(), "memory_in_bytes"); - op.add(Builder::normsMemory, JsonpDeserializer.stringDeserializer(), "norms_memory"); - op.add(Builder::normsMemoryInBytes, JsonpDeserializer.longDeserializer(), "norms_memory_in_bytes"); - op.add(Builder::pointsMemory, JsonpDeserializer.stringDeserializer(), "points_memory"); - op.add(Builder::pointsMemoryInBytes, JsonpDeserializer.longDeserializer(), "points_memory_in_bytes"); - op.add(Builder::storedMemory, JsonpDeserializer.stringDeserializer(), "stored_memory"); - op.add(Builder::storedFieldsMemoryInBytes, JsonpDeserializer.longDeserializer(), - "stored_fields_memory_in_bytes"); - op.add(Builder::termsMemoryInBytes, JsonpDeserializer.longDeserializer(), "terms_memory_in_bytes"); - op.add(Builder::termsMemory, JsonpDeserializer.stringDeserializer(), "terms_memory"); - op.add(Builder::termVectoryMemory, JsonpDeserializer.stringDeserializer(), "term_vectory_memory"); - op.add(Builder::termVectorsMemoryInBytes, JsonpDeserializer.longDeserializer(), "term_vectors_memory_in_bytes"); - op.add(Builder::versionMapMemory, JsonpDeserializer.stringDeserializer(), "version_map_memory"); - op.add(Builder::versionMapMemoryInBytes, JsonpDeserializer.longDeserializer(), "version_map_memory_in_bytes"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SortOptions.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SortOptions.java index 73ae819e6..dfbe04525 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SortOptions.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SortOptions.java @@ -59,7 +59,7 @@ /** * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/sort-search-results.html">Documentation * on elastic.co * @see API * specification diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/StandardRetriever.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/StandardRetriever.java new file mode 100644 index 000000000..58dc3347e --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/StandardRetriever.java @@ -0,0 +1,475 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +import co.elastic.clients.elasticsearch.core.search.FieldCollapse; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.Float; +import java.lang.Integer; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.StandardRetriever + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class StandardRetriever extends RetrieverBase implements RetrieverVariant { + @Nullable + private final Query query; + + private final List searchAfter; + + @Nullable + private final Integer terminateAfter; + + private final List sort; + + @Nullable + private final Float minScore; + + @Nullable + private final FieldCollapse collapse; + + // --------------------------------------------------------------------------------------------- + + private StandardRetriever(Builder builder) { + super(builder); + + this.query = builder.query; + this.searchAfter = ApiTypeHelper.unmodifiable(builder.searchAfter); + this.terminateAfter = builder.terminateAfter; + this.sort = ApiTypeHelper.unmodifiable(builder.sort); + this.minScore = builder.minScore; + this.collapse = builder.collapse; + + } + + public static StandardRetriever of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Retriever variant kind. + */ + @Override + public Retriever.Kind _retrieverKind() { + return Retriever.Kind.Standard; + } + + /** + * Defines a query to retrieve a set of top documents. + *

+ * API name: {@code query} + */ + @Nullable + public final Query query() { + return this.query; + } + + /** + * Defines a search after object parameter used for pagination. + *

+ * API name: {@code search_after} + */ + public final List searchAfter() { + return this.searchAfter; + } + + /** + * Maximum number of documents to collect for each shard. + *

+ * API name: {@code terminate_after} + */ + @Nullable + public final Integer terminateAfter() { + return this.terminateAfter; + } + + /** + * A sort object that that specifies the order of matching documents. + *

+ * API name: {@code sort} + */ + public final List sort() { + return this.sort; + } + + /** + * Minimum _score for matching documents. Documents with a lower _score are not + * included in the top documents. + *

+ * API name: {@code min_score} + */ + @Nullable + public final Float minScore() { + return this.minScore; + } + + /** + * Collapses the top documents by a specified key into a single top document per + * key. + *

+ * API name: {@code collapse} + */ + @Nullable + public final FieldCollapse collapse() { + return this.collapse; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + super.serializeInternal(generator, mapper); + if (this.query != null) { + generator.writeKey("query"); + this.query.serialize(generator, mapper); + + } + if (ApiTypeHelper.isDefined(this.searchAfter)) { + generator.writeKey("search_after"); + generator.writeStartArray(); + for (FieldValue item0 : this.searchAfter) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.terminateAfter != null) { + generator.writeKey("terminate_after"); + generator.write(this.terminateAfter); + + } + if (ApiTypeHelper.isDefined(this.sort)) { + generator.writeKey("sort"); + generator.writeStartArray(); + for (SortOptions item0 : this.sort) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.minScore != null) { + generator.writeKey("min_score"); + generator.write(this.minScore); + + } + if (this.collapse != null) { + generator.writeKey("collapse"); + this.collapse.serialize(generator, mapper); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link StandardRetriever}. + */ + + public static class Builder extends RetrieverBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Query query; + + @Nullable + private List searchAfter; + + @Nullable + private Integer terminateAfter; + + @Nullable + private List sort; + + @Nullable + private Float minScore; + + @Nullable + private FieldCollapse collapse; + + /** + * Defines a query to retrieve a set of top documents. + *

+ * API name: {@code query} + */ + public final Builder query(@Nullable Query value) { + this.query = value; + return this; + } + + /** + * Defines a query to retrieve a set of top documents. + *

+ * API name: {@code query} + */ + public final Builder query(Function> fn) { + return this.query(fn.apply(new Query.Builder()).build()); + } + + /** + * Defines a search after object parameter used for pagination. + *

+ * API name: {@code search_after} + *

+ * Adds all elements of list to searchAfter. + */ + public final Builder searchAfter(List list) { + this.searchAfter = _listAddAll(this.searchAfter, list); + return this; + } + + /** + * Defines a search after object parameter used for pagination. + *

+ * API name: {@code search_after} + *

+ * Adds one or more values to searchAfter. + */ + public final Builder searchAfter(FieldValue value, FieldValue... values) { + this.searchAfter = _listAdd(this.searchAfter, value, values); + return this; + } + + /** + * Defines a search after object parameter used for pagination. + *

+ * API name: {@code search_after} + *

+ * Adds all passed values to searchAfter. + */ + public final Builder searchAfter(String value, String... values) { + this.searchAfter = _listAdd(this.searchAfter, FieldValue.of(value)); + List fieldValues = new ArrayList<>(); + for (String v : values) { + fieldValues.add(FieldValue.of(v)); + } + this.searchAfter = _listAddAll(this.searchAfter, fieldValues); + return this; + } + + /** + * Defines a search after object parameter used for pagination. + *

+ * API name: {@code search_after} + *

+ * Adds all passed values to searchAfter. + */ + public final Builder searchAfter(long value, long... values) { + this.searchAfter = _listAdd(this.searchAfter, FieldValue.of(value)); + List fieldValues = new ArrayList<>(); + for (long v : values) { + fieldValues.add(FieldValue.of(v)); + } + this.searchAfter = _listAddAll(this.searchAfter, fieldValues); + return this; + } + + /** + * Defines a search after object parameter used for pagination. + *

+ * API name: {@code search_after} + *

+ * Adds all passed values to searchAfter. + */ + public final Builder searchAfter(double value, double... values) { + this.searchAfter = _listAdd(this.searchAfter, FieldValue.of(value)); + List fieldValues = new ArrayList<>(); + for (double v : values) { + fieldValues.add(FieldValue.of(v)); + } + this.searchAfter = _listAddAll(this.searchAfter, fieldValues); + return this; + } + + /** + * Defines a search after object parameter used for pagination. + *

+ * API name: {@code search_after} + *

+ * Adds all passed values to searchAfter. + */ + public final Builder searchAfter(boolean value, boolean... values) { + this.searchAfter = _listAdd(this.searchAfter, FieldValue.of(value)); + List fieldValues = new ArrayList<>(); + for (boolean v : values) { + fieldValues.add(FieldValue.of(v)); + } + this.searchAfter = _listAddAll(this.searchAfter, fieldValues); + return this; + } + + /** + * Defines a search after object parameter used for pagination. + *

+ * API name: {@code search_after} + *

+ * Adds a value to searchAfter using a builder lambda. + */ + public final Builder searchAfter(Function> fn) { + return searchAfter(fn.apply(new FieldValue.Builder()).build()); + } + + /** + * Maximum number of documents to collect for each shard. + *

+ * API name: {@code terminate_after} + */ + public final Builder terminateAfter(@Nullable Integer value) { + this.terminateAfter = value; + return this; + } + + /** + * A sort object that that specifies the order of matching documents. + *

+ * API name: {@code sort} + *

+ * Adds all elements of list to sort. + */ + public final Builder sort(List list) { + this.sort = _listAddAll(this.sort, list); + return this; + } + + /** + * A sort object that that specifies the order of matching documents. + *

+ * API name: {@code sort} + *

+ * Adds one or more values to sort. + */ + public final Builder sort(SortOptions value, SortOptions... values) { + this.sort = _listAdd(this.sort, value, values); + return this; + } + + /** + * A sort object that that specifies the order of matching documents. + *

+ * API name: {@code sort} + *

+ * Adds a value to sort using a builder lambda. + */ + public final Builder sort(Function> fn) { + return sort(fn.apply(new SortOptions.Builder()).build()); + } + + /** + * Minimum _score for matching documents. Documents with a lower _score are not + * included in the top documents. + *

+ * API name: {@code min_score} + */ + public final Builder minScore(@Nullable Float value) { + this.minScore = value; + return this; + } + + /** + * Collapses the top documents by a specified key into a single top document per + * key. + *

+ * API name: {@code collapse} + */ + public final Builder collapse(@Nullable FieldCollapse value) { + this.collapse = value; + return this; + } + + /** + * Collapses the top documents by a specified key into a single top document per + * key. + *

+ * API name: {@code collapse} + */ + public final Builder collapse(Function> fn) { + return this.collapse(fn.apply(new FieldCollapse.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link StandardRetriever}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public StandardRetriever build() { + _checkSingleUse(); + + return new StandardRetriever(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link StandardRetriever} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, StandardRetriever::setupStandardRetrieverDeserializer); + + protected static void setupStandardRetrieverDeserializer(ObjectDeserializer op) { + RetrieverBase.setupRetrieverBaseDeserializer(op); + op.add(Builder::query, Query._DESERIALIZER, "query"); + op.add(Builder::searchAfter, JsonpDeserializer.arrayDeserializer(FieldValue._DESERIALIZER), "search_after"); + op.add(Builder::terminateAfter, JsonpDeserializer.integerDeserializer(), "terminate_after"); + op.add(Builder::sort, JsonpDeserializer.arrayDeserializer(SortOptions._DESERIALIZER), "sort"); + op.add(Builder::minScore, JsonpDeserializer.floatDeserializer(), "min_score"); + op.add(Builder::collapse, FieldCollapse._DESERIALIZER, "collapse"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/StoreStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/StoreStats.java deleted file mode 100644 index 305b4323e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/StoreStats.java +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch._types; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: _types.StoreStats - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class StoreStats implements JsonpSerializable { - @Nullable - private final String size; - - private final long sizeInBytes; - - @Nullable - private final String reserved; - - private final long reservedInBytes; - - @Nullable - private final String totalDataSetSize; - - @Nullable - private final Long totalDataSetSizeInBytes; - - // --------------------------------------------------------------------------------------------- - - private StoreStats(Builder builder) { - - this.size = builder.size; - this.sizeInBytes = ApiTypeHelper.requireNonNull(builder.sizeInBytes, this, "sizeInBytes"); - this.reserved = builder.reserved; - this.reservedInBytes = ApiTypeHelper.requireNonNull(builder.reservedInBytes, this, "reservedInBytes"); - this.totalDataSetSize = builder.totalDataSetSize; - this.totalDataSetSizeInBytes = builder.totalDataSetSizeInBytes; - - } - - public static StoreStats of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Total size of all shards assigned to selected nodes. - *

- * API name: {@code size} - */ - @Nullable - public final String size() { - return this.size; - } - - /** - * Required - Total size, in bytes, of all shards assigned to selected nodes. - *

- * API name: {@code size_in_bytes} - */ - public final long sizeInBytes() { - return this.sizeInBytes; - } - - /** - * A prediction of how much larger the shard stores will eventually grow due to - * ongoing peer recoveries, restoring snapshots, and similar activities. - *

- * API name: {@code reserved} - */ - @Nullable - public final String reserved() { - return this.reserved; - } - - /** - * Required - A prediction, in bytes, of how much larger the shard stores will - * eventually grow due to ongoing peer recoveries, restoring snapshots, and - * similar activities. - *

- * API name: {@code reserved_in_bytes} - */ - public final long reservedInBytes() { - return this.reservedInBytes; - } - - /** - * Total data set size of all shards assigned to selected nodes. This includes - * the size of shards not stored fully on the nodes, such as the cache for - * partially mounted indices. - *

- * API name: {@code total_data_set_size} - */ - @Nullable - public final String totalDataSetSize() { - return this.totalDataSetSize; - } - - /** - * Total data set size, in bytes, of all shards assigned to selected nodes. This - * includes the size of shards not stored fully on the nodes, such as the cache - * for partially mounted indices. - *

- * API name: {@code total_data_set_size_in_bytes} - */ - @Nullable - public final Long totalDataSetSizeInBytes() { - return this.totalDataSetSizeInBytes; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.size != null) { - generator.writeKey("size"); - generator.write(this.size); - - } - generator.writeKey("size_in_bytes"); - generator.write(this.sizeInBytes); - - if (this.reserved != null) { - generator.writeKey("reserved"); - generator.write(this.reserved); - - } - generator.writeKey("reserved_in_bytes"); - generator.write(this.reservedInBytes); - - if (this.totalDataSetSize != null) { - generator.writeKey("total_data_set_size"); - generator.write(this.totalDataSetSize); - - } - if (this.totalDataSetSizeInBytes != null) { - generator.writeKey("total_data_set_size_in_bytes"); - generator.write(this.totalDataSetSizeInBytes); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link StoreStats}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - @Nullable - private String size; - - private Long sizeInBytes; - - @Nullable - private String reserved; - - private Long reservedInBytes; - - @Nullable - private String totalDataSetSize; - - @Nullable - private Long totalDataSetSizeInBytes; - - /** - * Total size of all shards assigned to selected nodes. - *

- * API name: {@code size} - */ - public final Builder size(@Nullable String value) { - this.size = value; - return this; - } - - /** - * Required - Total size, in bytes, of all shards assigned to selected nodes. - *

- * API name: {@code size_in_bytes} - */ - public final Builder sizeInBytes(long value) { - this.sizeInBytes = value; - return this; - } - - /** - * A prediction of how much larger the shard stores will eventually grow due to - * ongoing peer recoveries, restoring snapshots, and similar activities. - *

- * API name: {@code reserved} - */ - public final Builder reserved(@Nullable String value) { - this.reserved = value; - return this; - } - - /** - * Required - A prediction, in bytes, of how much larger the shard stores will - * eventually grow due to ongoing peer recoveries, restoring snapshots, and - * similar activities. - *

- * API name: {@code reserved_in_bytes} - */ - public final Builder reservedInBytes(long value) { - this.reservedInBytes = value; - return this; - } - - /** - * Total data set size of all shards assigned to selected nodes. This includes - * the size of shards not stored fully on the nodes, such as the cache for - * partially mounted indices. - *

- * API name: {@code total_data_set_size} - */ - public final Builder totalDataSetSize(@Nullable String value) { - this.totalDataSetSize = value; - return this; - } - - /** - * Total data set size, in bytes, of all shards assigned to selected nodes. This - * includes the size of shards not stored fully on the nodes, such as the cache - * for partially mounted indices. - *

- * API name: {@code total_data_set_size_in_bytes} - */ - public final Builder totalDataSetSizeInBytes(@Nullable Long value) { - this.totalDataSetSizeInBytes = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link StoreStats}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public StoreStats build() { - _checkSingleUse(); - - return new StoreStats(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link StoreStats} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - StoreStats::setupStoreStatsDeserializer); - - protected static void setupStoreStatsDeserializer(ObjectDeserializer op) { - - op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size"); - op.add(Builder::sizeInBytes, JsonpDeserializer.longDeserializer(), "size_in_bytes"); - op.add(Builder::reserved, JsonpDeserializer.stringDeserializer(), "reserved"); - op.add(Builder::reservedInBytes, JsonpDeserializer.longDeserializer(), "reserved_in_bytes"); - op.add(Builder::totalDataSetSize, JsonpDeserializer.stringDeserializer(), "total_data_set_size"); - op.add(Builder::totalDataSetSizeInBytes, JsonpDeserializer.longDeserializer(), "total_data_set_size_in_bytes"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/WriteResponseBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/WriteResponseBase.java index c179f9dc1..4cbff9266 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/WriteResponseBase.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/WriteResponseBase.java @@ -65,11 +65,13 @@ public abstract class WriteResponseBase implements JsonpSerializable { private final String index; - private final long primaryTerm; + @Nullable + private final Long primaryTerm; private final Result result; - private final long seqNo; + @Nullable + private final Long seqNo; private final ShardStatistics shards; @@ -84,9 +86,9 @@ protected WriteResponseBase(AbstractBuilder builder) { this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - this.primaryTerm = ApiTypeHelper.requireNonNull(builder.primaryTerm, this, "primaryTerm"); + this.primaryTerm = builder.primaryTerm; this.result = ApiTypeHelper.requireNonNull(builder.result, this, "result"); - this.seqNo = ApiTypeHelper.requireNonNull(builder.seqNo, this, "seqNo"); + this.seqNo = builder.seqNo; this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards"); this.version = ApiTypeHelper.requireNonNull(builder.version, this, "version"); this.forcedRefresh = builder.forcedRefresh; @@ -108,9 +110,10 @@ public final String index() { } /** - * Required - API name: {@code _primary_term} + * API name: {@code _primary_term} */ - public final long primaryTerm() { + @Nullable + public final Long primaryTerm() { return this.primaryTerm; } @@ -122,9 +125,10 @@ public final Result result() { } /** - * Required - API name: {@code _seq_no} + * API name: {@code _seq_no} */ - public final long seqNo() { + @Nullable + public final Long seqNo() { return this.seqNo; } @@ -167,14 +171,18 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("_index"); generator.write(this.index); - generator.writeKey("_primary_term"); - generator.write(this.primaryTerm); + if (this.primaryTerm != null) { + generator.writeKey("_primary_term"); + generator.write(this.primaryTerm); + } generator.writeKey("result"); this.result.serialize(generator, mapper); - generator.writeKey("_seq_no"); - generator.write(this.seqNo); + if (this.seqNo != null) { + generator.writeKey("_seq_no"); + generator.write(this.seqNo); + } generator.writeKey("_shards"); this.shards.serialize(generator, mapper); @@ -201,10 +209,12 @@ public abstract static class AbstractBuilder */ @JsonpDeserializable -public class AdjacencyMatrixAggregation extends BucketAggregationBase implements AggregationVariant { +public class AdjacencyMatrixAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { private final Map filters; + @Nullable + private final String separator; + // --------------------------------------------------------------------------------------------- private AdjacencyMatrixAggregation(Builder builder) { - super(builder); this.filters = ApiTypeHelper.unmodifiable(builder.filters); + this.separator = builder.separator; } @@ -91,9 +96,27 @@ public final Map filters() { return this.filters; } + /** + * Separator used to concatenate filter names. Defaults to &. + *

+ * API name: {@code separator} + */ + @Nullable + public final String separator() { + return this.separator; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (ApiTypeHelper.isDefined(this.filters)) { generator.writeKey("filters"); generator.writeStartObject(); @@ -105,9 +128,19 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } + if (this.separator != null) { + generator.writeKey("separator"); + generator.write(this.separator); + + } } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -120,6 +153,9 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder filters; + @Nullable + private String separator; + /** * Filters used to create buckets. At least one filter is required. *

@@ -155,6 +191,16 @@ public final Builder filters(String key, Function + * API name: {@code separator} + */ + public final Builder separator(@Nullable String value) { + this.separator = value; + return this; + } + @Override protected Builder self() { return this; @@ -183,8 +229,9 @@ public AdjacencyMatrixAggregation build() { protected static void setupAdjacencyMatrixAggregationDeserializer( ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::filters, JsonpDeserializer.stringMapDeserializer(Query._DESERIALIZER), "filters"); + op.add(Builder::separator, JsonpDeserializer.stringDeserializer(), "separator"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/Aggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/Aggregate.java index f2bf9ae81..c4a9b340c 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/Aggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/Aggregate.java @@ -82,7 +82,7 @@ public enum Kind implements JsonEnum { Avg("avg"), - BoxPlot("box_plot"), + Boxplot("boxplot"), BucketMetricValue("bucket_metric_value"), @@ -328,20 +328,20 @@ public AvgAggregate avg() { } /** - * Is this variant instance of kind {@code box_plot}? + * Is this variant instance of kind {@code boxplot}? */ - public boolean isBoxPlot() { - return _kind == Kind.BoxPlot; + public boolean isBoxplot() { + return _kind == Kind.Boxplot; } /** - * Get the {@code box_plot} variant value. + * Get the {@code boxplot} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code box_plot} kind. + * if the current variant is not of the {@code boxplot} kind. */ - public BoxPlotAggregate boxPlot() { - return TaggedUnionUtils.get(this, Kind.BoxPlot); + public BoxPlotAggregate boxplot() { + return TaggedUnionUtils.get(this, Kind.Boxplot); } /** @@ -1540,15 +1540,15 @@ public ObjectBuilder avg(Function boxPlot(BoxPlotAggregate v) { - this._kind = Kind.BoxPlot; + public ObjectBuilder boxplot(BoxPlotAggregate v) { + this._kind = Kind.Boxplot; this._value = v; return this; } - public ObjectBuilder boxPlot( + public ObjectBuilder boxplot( Function> fn) { - return this.boxPlot(fn.apply(new BoxPlotAggregate.Builder()).build()); + return this.boxplot(fn.apply(new BoxPlotAggregate.Builder()).build()); } public ObjectBuilder bucketMetricValue(BucketMetricValueAggregate v) { @@ -2285,7 +2285,7 @@ public Aggregate build() { deserializers.put("adjacency_matrix", AdjacencyMatrixAggregate._DESERIALIZER); deserializers.put("auto_date_histogram", AutoDateHistogramAggregate._DESERIALIZER); deserializers.put("avg", AvgAggregate._DESERIALIZER); - deserializers.put("box_plot", BoxPlotAggregate._DESERIALIZER); + deserializers.put("boxplot", BoxPlotAggregate._DESERIALIZER); deserializers.put("bucket_metric_value", BucketMetricValueAggregate._DESERIALIZER); deserializers.put("cardinality", CardinalityAggregate._DESERIALIZER); deserializers.put("children", ChildrenAggregate._DESERIALIZER); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregateBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregateBuilders.java index a0aa76d87..ea8787496 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregateBuilders.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregateBuilders.java @@ -100,20 +100,20 @@ public static Aggregate avg(Function> fn) { + public static Aggregate boxplot(Function> fn) { Aggregate.Builder builder = new Aggregate.Builder(); - builder.boxPlot(fn.apply(new BoxPlotAggregate.Builder()).build()); + builder.boxplot(fn.apply(new BoxPlotAggregate.Builder()).build()); return builder.build(); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/Aggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/Aggregation.java index 7a52d03b1..6562f5312 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/Aggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/Aggregation.java @@ -1668,7 +1668,7 @@ public String toString() { return JsonpUtils.toString(this); } - public static class Builder extends WithJsonObjectBuilderBase { + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { private Kind _kind; private Object _value; private String _customKind; @@ -2557,7 +2557,7 @@ public ContainerBuilder _custom(String name, Object data) { return new ContainerBuilder(); } - protected Aggregation build() { + public Aggregation build() { _checkSingleUse(); return new Aggregation(this); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregationBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregationBase.java index 5320a33e0..ec723205c 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregationBase.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregationBase.java @@ -19,22 +19,14 @@ package co.elastic.clients.elasticsearch._types.aggregations; -import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Map; import java.util.Objects; -import javax.annotation.Nullable; //---------------------------------------------------------------- // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. @@ -60,119 +52,15 @@ * specification */ -public abstract class AggregationBase implements JsonpSerializable { - private final Map meta; - - @Nullable - private final String name; - - // --------------------------------------------------------------------------------------------- - - protected AggregationBase(AbstractBuilder builder) { - - this.meta = ApiTypeHelper.unmodifiable(builder.meta); - this.name = builder.name; - - } - - /** - * API name: {@code meta} - */ - public final Map meta() { - return this.meta; - } - - /** - * API name: {@code name} - */ - @Nullable - public final String name() { - return this.name; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.meta)) { - generator.writeKey("meta"); - generator.writeStartObject(); - for (Map.Entry item0 : this.meta.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.name != null) { - generator.writeKey("name"); - generator.write(this.name); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); +public abstract class AggregationBase { + public AggregationBase() { } public abstract static class AbstractBuilder> extends WithJsonObjectBuilderBase { - @Nullable - private Map meta; - - @Nullable - private String name; - - /** - * API name: {@code meta} - *

- * Adds all entries of map to meta. - */ - public final BuilderT meta(Map map) { - this.meta = _mapPutAll(this.meta, map); - return self(); - } - - /** - * API name: {@code meta} - *

- * Adds an entry to meta. - */ - public final BuilderT meta(String key, JsonData value) { - this.meta = _mapPut(this.meta, key, value); - return self(); - } - - /** - * API name: {@code name} - */ - public final BuilderT name(@Nullable String value) { - this.name = value; - return self(); - } - protected abstract BuilderT self(); } - // --------------------------------------------------------------------------------------------- - protected static > void setupAggregationBaseDeserializer( - ObjectDeserializer op) { - - op.add(AbstractBuilder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); - op.add(AbstractBuilder::name, JsonpDeserializer.stringDeserializer(), "name"); - - } - } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregationRange.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregationRange.java index d7826ed49..0a1ff795e 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregationRange.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregationRange.java @@ -29,6 +29,7 @@ import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; +import java.lang.Double; import java.lang.String; import java.util.Objects; import java.util.function.Function; @@ -60,13 +61,13 @@ @JsonpDeserializable public class AggregationRange implements JsonpSerializable { @Nullable - private final String from; + private final Double from; @Nullable private final String key; @Nullable - private final String to; + private final Double to; // --------------------------------------------------------------------------------------------- @@ -88,7 +89,7 @@ public static AggregationRange of(Function implements ObjectBuilder { @Nullable - private String from; + private Double from; @Nullable private String key; @Nullable - private String to; + private Double to; /** * Start of the range (inclusive). *

* API name: {@code from} */ - public final Builder from(@Nullable String value) { + public final Builder from(@Nullable Double value) { this.from = value; return this; } @@ -187,7 +188,7 @@ public final Builder key(@Nullable String value) { *

* API name: {@code to} */ - public final Builder to(@Nullable String value) { + public final Builder to(@Nullable Double value) { this.to = value; return this; } @@ -220,9 +221,9 @@ public AggregationRange build() { protected static void setupAggregationRangeDeserializer(ObjectDeserializer op) { - op.add(Builder::from, JsonpDeserializer.stringDeserializer(), "from"); + op.add(Builder::from, JsonpDeserializer.doubleDeserializer(), "from"); op.add(Builder::key, JsonpDeserializer.stringDeserializer(), "key"); - op.add(Builder::to, JsonpDeserializer.stringDeserializer(), "to"); + op.add(Builder::to, JsonpDeserializer.doubleDeserializer(), "to"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AutoDateHistogramAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AutoDateHistogramAggregation.java index 0c35472c1..dee2d20f1 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AutoDateHistogramAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AutoDateHistogramAggregation.java @@ -24,6 +24,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -61,7 +63,10 @@ * specification */ @JsonpDeserializable -public class AutoDateHistogramAggregation extends BucketAggregationBase implements AggregationVariant { +public class AutoDateHistogramAggregation extends BucketAggregationBase + implements + AggregationVariant, + JsonpSerializable { @Nullable private final Integer buckets; @@ -91,7 +96,6 @@ public class AutoDateHistogramAggregation extends BucketAggregationBase implemen // --------------------------------------------------------------------------------------------- private AutoDateHistogramAggregation(Builder builder) { - super(builder); this.buckets = builder.buckets; this.field = builder.field; @@ -207,9 +211,17 @@ public final String timeZone() { return this.timeZone; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.buckets != null) { generator.writeKey("buckets"); generator.write(this.buckets); @@ -262,6 +274,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -436,7 +453,7 @@ public AutoDateHistogramAggregation build() { protected static void setupAutoDateHistogramAggregationDeserializer( ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::buckets, JsonpDeserializer.integerDeserializer(), "buckets"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BoxPlotAggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BoxPlotAggregate.java index d4959d043..4c43febcf 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BoxPlotAggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BoxPlotAggregate.java @@ -124,7 +124,7 @@ public static BoxPlotAggregate of(Function builder) { - super(builder); - + public BucketAggregationBase() { } public abstract static class AbstractBuilder> extends AggregationBase.AbstractBuilder { - } - - // --------------------------------------------------------------------------------------------- - protected static > void setupBucketAggregationBaseDeserializer( - ObjectDeserializer op) { - AggregationBase.setupAggregationBaseDeserializer(op); + protected abstract BuilderT self(); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketPathAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketPathAggregation.java index db624a98d..2b9ef26c9 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketPathAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketPathAggregation.java @@ -22,6 +22,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -55,14 +57,13 @@ * specification */ -public abstract class BucketPathAggregation extends AggregationBase { +public abstract class BucketPathAggregation extends AggregationBase implements JsonpSerializable { @Nullable private final BucketsPath bucketsPath; // --------------------------------------------------------------------------------------------- protected BucketPathAggregation(AbstractBuilder builder) { - super(builder); this.bucketsPath = builder.bucketsPath; @@ -78,9 +79,17 @@ public final BucketsPath bucketsPath() { return this.bucketsPath; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.bucketsPath != null) { generator.writeKey("buckets_path"); this.bucketsPath.serialize(generator, mapper); @@ -89,6 +98,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + public abstract static class AbstractBuilder> extends AggregationBase.AbstractBuilder { @@ -114,12 +128,14 @@ public final BuilderT bucketsPath(Function> void setupBucketPathAggregationDeserializer( ObjectDeserializer op) { - AggregationBase.setupAggregationBaseDeserializer(op); + op.add(AbstractBuilder::bucketsPath, BucketsPath._DESERIALIZER, "buckets_path"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketSortAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketSortAggregation.java index 7e39b692a..b8d1d7bff 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketSortAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketSortAggregation.java @@ -23,6 +23,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -58,7 +60,7 @@ * specification */ @JsonpDeserializable -public class BucketSortAggregation extends AggregationBase implements AggregationVariant { +public class BucketSortAggregation extends AggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final Integer from; @@ -73,7 +75,6 @@ public class BucketSortAggregation extends AggregationBase implements Aggregatio // --------------------------------------------------------------------------------------------- private BucketSortAggregation(Builder builder) { - super(builder); this.from = builder.from; this.gapPolicy = builder.gapPolicy; @@ -134,9 +135,17 @@ public final List sort() { return this.sort; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.from != null) { generator.writeKey("from"); generator.write(this.from); @@ -164,6 +173,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -278,7 +292,7 @@ public BucketSortAggregation build() { .lazy(Builder::new, BucketSortAggregation::setupBucketSortAggregationDeserializer); protected static void setupBucketSortAggregationDeserializer(ObjectDeserializer op) { - AggregationBase.setupAggregationBaseDeserializer(op); + op.add(Builder::from, JsonpDeserializer.integerDeserializer(), "from"); op.add(Builder::gapPolicy, GapPolicy._DESERIALIZER, "gap_policy"); op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CalendarInterval.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CalendarInterval.java index 199d6ccd5..c091fe964 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CalendarInterval.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CalendarInterval.java @@ -60,7 +60,7 @@ public enum CalendarInterval implements JsonEnum { Quarter("quarter", "1q"), - Year("year", "1Y"), + Year("year", "1y"), ; diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CardinalityAggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CardinalityAggregate.java index 6c49f3d3a..05ff6d5a1 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CardinalityAggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CardinalityAggregate.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregate; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregateVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -55,7 +57,7 @@ * specification */ @JsonpDeserializable -public class CardinalityAggregate extends AggregateBase implements AggregateVariant { +public class CardinalityAggregate extends AggregateBase implements AggregateVariant, ApiKeyAggregateVariant { private final long value; // --------------------------------------------------------------------------------------------- @@ -79,6 +81,14 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Cardinality; } + /** + * ApiKeyAggregate variant kind. + */ + @Override + public ApiKeyAggregate.Kind _apiKeyAggregateKind() { + return ApiKeyAggregate.Kind.Cardinality; + } + /** * Required - API name: {@code value} */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CardinalityAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CardinalityAggregation.java index c3e2abb40..93dbffd56 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CardinalityAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CardinalityAggregation.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregation; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregationVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -56,7 +58,10 @@ * specification */ @JsonpDeserializable -public class CardinalityAggregation extends MetricAggregationBase implements AggregationVariant { +public class CardinalityAggregation extends MetricAggregationBase + implements + AggregationVariant, + ApiKeyAggregationVariant { @Nullable private final Integer precisionThreshold; @@ -89,6 +94,14 @@ public Aggregation.Kind _aggregationKind() { return Aggregation.Kind.Cardinality; } + /** + * ApiKeyAggregation variant kind. + */ + @Override + public ApiKeyAggregation.Kind _apiKeyAggregationKind() { + return ApiKeyAggregation.Kind.Cardinality; + } + /** * A unique count below which counts are expected to be close to accurate. This * allows to trade memory for accuracy. diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CategorizeTextAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CategorizeTextAggregation.java index 4ed93073b..00dc3ffb4 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CategorizeTextAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CategorizeTextAggregation.java @@ -22,6 +22,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -63,7 +65,7 @@ * specification */ @JsonpDeserializable -public class CategorizeTextAggregation extends AggregationBase implements AggregationVariant { +public class CategorizeTextAggregation extends AggregationBase implements AggregationVariant, JsonpSerializable { private final String field; @Nullable @@ -95,7 +97,6 @@ public class CategorizeTextAggregation extends AggregationBase implements Aggreg // --------------------------------------------------------------------------------------------- private CategorizeTextAggregation(Builder builder) { - super(builder); this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); this.maxUniqueTokens = builder.maxUniqueTokens; @@ -245,9 +246,17 @@ public final Integer shardMinDocCount() { return this.shardMinDocCount; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); generator.writeKey("field"); generator.write(this.field); @@ -304,6 +313,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -534,7 +548,7 @@ public CategorizeTextAggregation build() { protected static void setupCategorizeTextAggregationDeserializer( ObjectDeserializer op) { - AggregationBase.setupAggregationBaseDeserializer(op); + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::maxUniqueTokens, JsonpDeserializer.integerDeserializer(), "max_unique_tokens"); op.add(Builder::maxMatchedTokens, JsonpDeserializer.integerDeserializer(), "max_matched_tokens"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ChildrenAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ChildrenAggregation.java index 9c7fd0152..c15142d05 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ChildrenAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ChildrenAggregation.java @@ -22,6 +22,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -55,14 +57,13 @@ * specification */ @JsonpDeserializable -public class ChildrenAggregation extends BucketAggregationBase implements AggregationVariant { +public class ChildrenAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final String type; // --------------------------------------------------------------------------------------------- private ChildrenAggregation(Builder builder) { - super(builder); this.type = builder.type; @@ -90,9 +91,17 @@ public final String type() { return this.type; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.type != null) { generator.writeKey("type"); generator.write(this.type); @@ -101,6 +110,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -150,7 +164,7 @@ public ChildrenAggregation build() { .lazy(Builder::new, ChildrenAggregation::setupChildrenAggregationDeserializer); protected static void setupChildrenAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregate.java index c7bff08d6..96d0c0340 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregate.java @@ -20,6 +20,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; import co.elastic.clients.elasticsearch._types.FieldValue; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregate; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregateVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -58,7 +60,10 @@ * specification */ @JsonpDeserializable -public class CompositeAggregate extends MultiBucketAggregateBase implements AggregateVariant { +public class CompositeAggregate extends MultiBucketAggregateBase + implements + AggregateVariant, + ApiKeyAggregateVariant { private final Map afterKey; // --------------------------------------------------------------------------------------------- @@ -82,6 +87,14 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Composite; } + /** + * ApiKeyAggregate variant kind. + */ + @Override + public ApiKeyAggregate.Kind _apiKeyAggregateKind() { + return ApiKeyAggregate.Kind.Composite; + } + /** * API name: {@code after_key} */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregation.java index 6d37f9eb8..e634962b0 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregation.java @@ -20,9 +20,13 @@ package co.elastic.clients.elasticsearch._types.aggregations; import co.elastic.clients.elasticsearch._types.FieldValue; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregation; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregationVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -60,7 +64,11 @@ * specification */ @JsonpDeserializable -public class CompositeAggregation extends BucketAggregationBase implements AggregationVariant { +public class CompositeAggregation extends BucketAggregationBase + implements + AggregationVariant, + ApiKeyAggregationVariant, + JsonpSerializable { private final Map after; @Nullable @@ -71,7 +79,6 @@ public class CompositeAggregation extends BucketAggregationBase implements Aggre // --------------------------------------------------------------------------------------------- private CompositeAggregation(Builder builder) { - super(builder); this.after = ApiTypeHelper.unmodifiable(builder.after); this.size = builder.size; @@ -91,6 +98,14 @@ public Aggregation.Kind _aggregationKind() { return Aggregation.Kind.Composite; } + /** + * ApiKeyAggregation variant kind. + */ + @Override + public ApiKeyAggregation.Kind _apiKeyAggregationKind() { + return ApiKeyAggregation.Kind.Composite; + } + /** * When paginating, use the after_key value returned in the * previous response to retrieve the next page. @@ -121,9 +136,17 @@ public final List> sources() { return this.sources; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (ApiTypeHelper.isDefined(this.after)) { generator.writeKey("after"); generator.writeStartObject(); @@ -161,6 +184,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -281,7 +309,7 @@ public CompositeAggregation build() { .lazy(Builder::new, CompositeAggregation::setupCompositeAggregationDeserializer); protected static void setupCompositeAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::after, JsonpDeserializer.stringMapDeserializer(FieldValue._DESERIALIZER), "after"); op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); op.add(Builder::sources, JsonpDeserializer.arrayDeserializer( diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateHistogramAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateHistogramAggregation.java index dcc79c260..5a3ad063b 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateHistogramAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateHistogramAggregation.java @@ -28,6 +28,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -68,7 +70,11 @@ * specification */ @JsonpDeserializable -public class DateHistogramAggregation extends BucketAggregationBase implements AggregationVariant, PivotGroupByVariant { +public class DateHistogramAggregation extends BucketAggregationBase + implements + AggregationVariant, + PivotGroupByVariant, + JsonpSerializable { @Nullable private final CalendarInterval calendarInterval; @@ -115,7 +121,6 @@ public class DateHistogramAggregation extends BucketAggregationBase implements A // --------------------------------------------------------------------------------------------- private DateHistogramAggregation(Builder builder) { - super(builder); this.calendarInterval = builder.calendarInterval; this.extendedBounds = builder.extendedBounds; @@ -311,9 +316,17 @@ public final Boolean keyed() { return this.keyed; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.calendarInterval != null) { generator.writeKey("calendar_interval"); this.calendarInterval.serialize(generator, mapper); @@ -404,6 +417,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -728,7 +746,7 @@ public DateHistogramAggregation build() { protected static void setupDateHistogramAggregationDeserializer( ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::calendarInterval, CalendarInterval._DESERIALIZER, "calendar_interval"); op.add(Builder::extendedBounds, ExtendedBounds.createExtendedBoundsDeserializer(FieldDateMath._DESERIALIZER), "extended_bounds"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateRangeAggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateRangeAggregate.java index 539c1e932..6e059c5ff 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateRangeAggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateRangeAggregate.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregate; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregateVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -56,7 +58,7 @@ * specification */ @JsonpDeserializable -public class DateRangeAggregate extends RangeAggregate implements AggregateVariant { +public class DateRangeAggregate extends RangeAggregate implements AggregateVariant, ApiKeyAggregateVariant { // --------------------------------------------------------------------------------------------- private DateRangeAggregate(Builder builder) { @@ -76,6 +78,14 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.DateRange; } + /** + * ApiKeyAggregate variant kind. + */ + @Override + public ApiKeyAggregate.Kind _apiKeyAggregateKind() { + return ApiKeyAggregate.Kind.DateRange; + } + // --------------------------------------------------------------------------------------------- /** diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateRangeAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateRangeAggregation.java index 3eeeee615..479b649ff 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateRangeAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateRangeAggregation.java @@ -20,9 +20,13 @@ package co.elastic.clients.elasticsearch._types.aggregations; import co.elastic.clients.elasticsearch._types.FieldValue; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregation; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregationVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -59,7 +63,11 @@ * specification */ @JsonpDeserializable -public class DateRangeAggregation extends BucketAggregationBase implements AggregationVariant { +public class DateRangeAggregation extends BucketAggregationBase + implements + AggregationVariant, + ApiKeyAggregationVariant, + JsonpSerializable { @Nullable private final String field; @@ -80,7 +88,6 @@ public class DateRangeAggregation extends BucketAggregationBase implements Aggre // --------------------------------------------------------------------------------------------- private DateRangeAggregation(Builder builder) { - super(builder); this.field = builder.field; this.format = builder.format; @@ -103,6 +110,14 @@ public Aggregation.Kind _aggregationKind() { return Aggregation.Kind.DateRange; } + /** + * ApiKeyAggregation variant kind. + */ + @Override + public ApiKeyAggregation.Kind _apiKeyAggregationKind() { + return ApiKeyAggregation.Kind.DateRange; + } + /** * The date field whose values are use to build ranges. *

@@ -165,9 +180,17 @@ public final Boolean keyed() { return this.keyed; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.field != null) { generator.writeKey("field"); generator.write(this.field); @@ -206,6 +229,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -402,7 +430,7 @@ public DateRangeAggregation build() { .lazy(Builder::new, DateRangeAggregation::setupDateRangeAggregationDeserializer); protected static void setupDateRangeAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); op.add(Builder::missing, FieldValue._DESERIALIZER, "missing"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DiversifiedSamplerAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DiversifiedSamplerAggregation.java index 21d3957e5..bb25276cd 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DiversifiedSamplerAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DiversifiedSamplerAggregation.java @@ -23,6 +23,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -57,7 +59,10 @@ * specification */ @JsonpDeserializable -public class DiversifiedSamplerAggregation extends BucketAggregationBase implements AggregationVariant { +public class DiversifiedSamplerAggregation extends BucketAggregationBase + implements + AggregationVariant, + JsonpSerializable { @Nullable private final SamplerAggregationExecutionHint executionHint; @@ -76,7 +81,6 @@ public class DiversifiedSamplerAggregation extends BucketAggregationBase impleme // --------------------------------------------------------------------------------------------- private DiversifiedSamplerAggregation(Builder builder) { - super(builder); this.executionHint = builder.executionHint; this.maxDocsPerValue = builder.maxDocsPerValue; @@ -147,9 +151,17 @@ public final String field() { return this.field; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.executionHint != null) { generator.writeKey("execution_hint"); this.executionHint.serialize(generator, mapper); @@ -177,6 +189,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -285,7 +302,7 @@ public DiversifiedSamplerAggregation build() { protected static void setupDiversifiedSamplerAggregationDeserializer( ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::executionHint, SamplerAggregationExecutionHint._DESERIALIZER, "execution_hint"); op.add(Builder::maxDocsPerValue, JsonpDeserializer.integerDeserializer(), "max_docs_per_value"); op.add(Builder::script, Script._DESERIALIZER, "script"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DoubleTermsAggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DoubleTermsAggregate.java index ad5ed709e..a63a9778f 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DoubleTermsAggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DoubleTermsAggregate.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregate; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregateVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -54,7 +56,10 @@ * specification */ @JsonpDeserializable -public class DoubleTermsAggregate extends TermsAggregateBase implements AggregateVariant { +public class DoubleTermsAggregate extends TermsAggregateBase + implements + AggregateVariant, + ApiKeyAggregateVariant { // --------------------------------------------------------------------------------------------- private DoubleTermsAggregate(Builder builder) { @@ -74,6 +79,14 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Dterms; } + /** + * ApiKeyAggregate variant kind. + */ + @Override + public ApiKeyAggregate.Kind _apiKeyAggregateKind() { + return ApiKeyAggregate.Kind.Dterms; + } + // --------------------------------------------------------------------------------------------- /** diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ExtendedBounds.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ExtendedBounds.java index d008aacd8..37c04be85 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ExtendedBounds.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ExtendedBounds.java @@ -28,7 +28,6 @@ import co.elastic.clients.json.NamedDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; @@ -62,8 +61,10 @@ */ @JsonpDeserializable public class ExtendedBounds implements JsonpSerializable { + @Nullable private final T max; + @Nullable private final T min; @Nullable @@ -73,8 +74,8 @@ public class ExtendedBounds implements JsonpSerializable { private ExtendedBounds(Builder builder) { - this.max = ApiTypeHelper.requireNonNull(builder.max, this, "max"); - this.min = ApiTypeHelper.requireNonNull(builder.min, this, "min"); + this.max = builder.max; + this.min = builder.min; this.tSerializer = builder.tSerializer; } @@ -84,19 +85,21 @@ public static ExtendedBounds of(Function, ObjectBuilder * API name: {@code max} */ + @Nullable public final T max() { return this.max; } /** - * Required - Minimum value for the bound. + * Minimum value for the bound. *

* API name: {@code min} */ + @Nullable public final T min() { return this.min; } @@ -112,11 +115,16 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey("max"); - JsonpUtils.serialize(this.max, generator, tSerializer, mapper); + if (this.max != null) { + generator.writeKey("max"); + JsonpUtils.serialize(this.max, generator, tSerializer, mapper); - generator.writeKey("min"); - JsonpUtils.serialize(this.min, generator, tSerializer, mapper); + } + if (this.min != null) { + generator.writeKey("min"); + JsonpUtils.serialize(this.min, generator, tSerializer, mapper); + + } } @@ -134,29 +142,31 @@ public String toString() { public static class Builder extends WithJsonObjectBuilderBase> implements ObjectBuilder> { + @Nullable private T max; + @Nullable private T min; @Nullable private JsonpSerializer tSerializer; /** - * Required - Maximum value for the bound. + * Maximum value for the bound. *

* API name: {@code max} */ - public final Builder max(T value) { + public final Builder max(@Nullable T value) { this.max = value; return this; } /** - * Required - Minimum value for the bound. + * Minimum value for the bound. *

* API name: {@code min} */ - public final Builder min(T value) { + public final Builder min(@Nullable T value) { this.min = value; return this; } @@ -205,7 +215,7 @@ public static JsonpDeserializer> createExtendedBoundsDeser */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createExtendedBoundsDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_types.aggregations.T"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_types.aggregations.ExtendedBounds.T"))); protected static void setupExtendedBoundsDeserializer(ObjectDeserializer> op, JsonpDeserializer tDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FilterAggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FilterAggregate.java index 9b8e65a29..981e04d97 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FilterAggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FilterAggregate.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregate; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregateVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -52,7 +54,7 @@ * specification */ @JsonpDeserializable -public class FilterAggregate extends SingleBucketAggregateBase implements AggregateVariant { +public class FilterAggregate extends SingleBucketAggregateBase implements AggregateVariant, ApiKeyAggregateVariant { // --------------------------------------------------------------------------------------------- private FilterAggregate(Builder builder) { @@ -72,6 +74,14 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Filter; } + /** + * ApiKeyAggregate variant kind. + */ + @Override + public ApiKeyAggregate.Kind _apiKeyAggregateKind() { + return ApiKeyAggregate.Kind.Filter; + } + // --------------------------------------------------------------------------------------------- /** diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FiltersAggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FiltersAggregate.java index b5cd960c1..7e91f9e37 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FiltersAggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FiltersAggregate.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregate; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregateVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -52,7 +54,10 @@ * specification */ @JsonpDeserializable -public class FiltersAggregate extends MultiBucketAggregateBase implements AggregateVariant { +public class FiltersAggregate extends MultiBucketAggregateBase + implements + AggregateVariant, + ApiKeyAggregateVariant { // --------------------------------------------------------------------------------------------- private FiltersAggregate(Builder builder) { @@ -72,6 +77,14 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Filters; } + /** + * ApiKeyAggregate variant kind. + */ + @Override + public ApiKeyAggregate.Kind _apiKeyAggregateKind() { + return ApiKeyAggregate.Kind.Filters; + } + // --------------------------------------------------------------------------------------------- /** diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FiltersAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FiltersAggregation.java index 72b0cd4a3..4dca403e0 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FiltersAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FiltersAggregation.java @@ -23,6 +23,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -57,7 +59,7 @@ * specification */ @JsonpDeserializable -public class FiltersAggregation extends BucketAggregationBase implements AggregationVariant { +public class FiltersAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final Buckets filters; @@ -73,7 +75,6 @@ public class FiltersAggregation extends BucketAggregationBase implements Aggrega // --------------------------------------------------------------------------------------------- private FiltersAggregation(Builder builder) { - super(builder); this.filters = builder.filters; this.otherBucket = builder.otherBucket; @@ -136,9 +137,17 @@ public final Boolean keyed() { return this.keyed; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.filters != null) { generator.writeKey("filters"); this.filters.serialize(generator, mapper); @@ -162,6 +171,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -261,7 +275,7 @@ public FiltersAggregation build() { .lazy(Builder::new, FiltersAggregation::setupFiltersAggregationDeserializer); protected static void setupFiltersAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::filters, Buckets.createBucketsDeserializer(Query._DESERIALIZER), "filters"); op.add(Builder::otherBucket, JsonpDeserializer.booleanDeserializer(), "other_bucket"); op.add(Builder::otherBucketKey, JsonpDeserializer.stringDeserializer(), "other_bucket_key"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoDistanceAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoDistanceAggregation.java index 40c397b5d..e736db73a 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoDistanceAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoDistanceAggregation.java @@ -25,6 +25,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -60,7 +62,7 @@ * specification */ @JsonpDeserializable -public class GeoDistanceAggregation extends BucketAggregationBase implements AggregationVariant { +public class GeoDistanceAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final GeoDistanceType distanceType; @@ -78,7 +80,6 @@ public class GeoDistanceAggregation extends BucketAggregationBase implements Agg // --------------------------------------------------------------------------------------------- private GeoDistanceAggregation(Builder builder) { - super(builder); this.distanceType = builder.distanceType; this.field = builder.field; @@ -149,9 +150,17 @@ public final DistanceUnit unit() { return this.unit; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.distanceType != null) { generator.writeKey("distance_type"); this.distanceType.serialize(generator, mapper); @@ -183,6 +192,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -319,7 +333,7 @@ public GeoDistanceAggregation build() { protected static void setupGeoDistanceAggregationDeserializer( ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::distanceType, GeoDistanceType._DESERIALIZER, "distance_type"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::origin, GeoLocation._DESERIALIZER, "origin"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoHashGridAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoHashGridAggregation.java index 6dddd8612..41a1b6d32 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoHashGridAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoHashGridAggregation.java @@ -24,6 +24,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -58,7 +60,7 @@ * specification */ @JsonpDeserializable -public class GeoHashGridAggregation extends BucketAggregationBase implements AggregationVariant { +public class GeoHashGridAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final GeoBounds bounds; @@ -77,7 +79,6 @@ public class GeoHashGridAggregation extends BucketAggregationBase implements Agg // --------------------------------------------------------------------------------------------- private GeoHashGridAggregation(Builder builder) { - super(builder); this.bounds = builder.bounds; this.field = builder.field; @@ -154,9 +155,17 @@ public final Integer size() { return this.size; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.bounds != null) { generator.writeKey("bounds"); this.bounds.serialize(generator, mapper); @@ -185,6 +194,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -311,7 +325,7 @@ public GeoHashGridAggregation build() { protected static void setupGeoHashGridAggregationDeserializer( ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::bounds, GeoBounds._DESERIALIZER, "bounds"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::precision, GeoHashPrecision._DESERIALIZER, "precision"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoTileGridAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoTileGridAggregation.java index 946e79d2c..7928c6445 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoTileGridAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoTileGridAggregation.java @@ -25,6 +25,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -60,7 +62,11 @@ * specification */ @JsonpDeserializable -public class GeoTileGridAggregation extends BucketAggregationBase implements AggregationVariant, PivotGroupByVariant { +public class GeoTileGridAggregation extends BucketAggregationBase + implements + AggregationVariant, + PivotGroupByVariant, + JsonpSerializable { @Nullable private final String field; @@ -79,7 +85,6 @@ public class GeoTileGridAggregation extends BucketAggregationBase implements Agg // --------------------------------------------------------------------------------------------- private GeoTileGridAggregation(Builder builder) { - super(builder); this.field = builder.field; this.precision = builder.precision; @@ -164,9 +169,17 @@ public final GeoBounds bounds() { return this.bounds; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.field != null) { generator.writeKey("field"); generator.write(this.field); @@ -195,6 +208,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -311,7 +329,7 @@ public GeoTileGridAggregation build() { protected static void setupGeoTileGridAggregationDeserializer( ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::precision, JsonpDeserializer.numberDeserializer(), "precision"); op.add(Builder::shardSize, JsonpDeserializer.integerDeserializer(), "shard_size"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeohexGridAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeohexGridAggregation.java index d974afaee..6b03f013a 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeohexGridAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeohexGridAggregation.java @@ -23,6 +23,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -58,7 +60,7 @@ * specification */ @JsonpDeserializable -public class GeohexGridAggregation extends BucketAggregationBase implements AggregationVariant { +public class GeohexGridAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { private final String field; @Nullable @@ -76,7 +78,6 @@ public class GeohexGridAggregation extends BucketAggregationBase implements Aggr // --------------------------------------------------------------------------------------------- private GeohexGridAggregation(Builder builder) { - super(builder); this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); this.precision = builder.precision; @@ -150,9 +151,17 @@ public final Integer shardSize() { return this.shardSize; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); generator.writeKey("field"); generator.write(this.field); @@ -179,6 +188,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -291,7 +305,7 @@ public GeohexGridAggregation build() { .lazy(Builder::new, GeohexGridAggregation::setupGeohexGridAggregationDeserializer); protected static void setupGeohexGridAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::precision, JsonpDeserializer.integerDeserializer(), "precision"); op.add(Builder::bounds, GeoBounds._DESERIALIZER, "bounds"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GlobalAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GlobalAggregation.java index 3a86a8879..386e392d9 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GlobalAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GlobalAggregation.java @@ -21,12 +21,10 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; //---------------------------------------------------------------- // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. @@ -43,8 +41,6 @@ // //---------------------------------------------------------------- -// typedef: _types.aggregations.GlobalAggregation - /** * * @see */ @JsonpDeserializable -public class GlobalAggregation extends BucketAggregationBase implements AggregationVariant { - // --------------------------------------------------------------------------------------------- - - private GlobalAggregation(Builder builder) { - super(builder); - - } - - public static GlobalAggregation of(Function> fn) { - return fn.apply(new Builder()).build(); - } +public class GlobalAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { /** * Aggregation variant kind. @@ -72,44 +58,27 @@ public Aggregation.Kind _aggregationKind() { return Aggregation.Kind.Global; } - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GlobalAggregation}. - */ - - public static class Builder extends BucketAggregationBase.AbstractBuilder - implements - ObjectBuilder { + public static final class Builder implements ObjectBuilder { @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GlobalAggregation}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ public GlobalAggregation build() { - _checkSingleUse(); - - return new GlobalAggregation(this); + return GlobalAggregation._INSTANCE; } } - // --------------------------------------------------------------------------------------------- - /** - * Json deserializer for {@link GlobalAggregation} + * Serialize this object to JSON. */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, GlobalAggregation::setupGlobalAggregationDeserializer); + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + generator.writeEnd(); + } - protected static void setupGlobalAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + /** + * Singleton instance for empty class {@link GlobalAggregation}. + */ + public static final GlobalAggregation _INSTANCE = new GlobalAggregation(); - } + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer + .emptyObject(GlobalAggregation._INSTANCE); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HistogramAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HistogramAggregation.java index 90c8cec85..9fefe77b0 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HistogramAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HistogramAggregation.java @@ -26,6 +26,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -65,7 +67,11 @@ * specification */ @JsonpDeserializable -public class HistogramAggregation extends BucketAggregationBase implements AggregationVariant, PivotGroupByVariant { +public class HistogramAggregation extends BucketAggregationBase + implements + AggregationVariant, + PivotGroupByVariant, + JsonpSerializable { @Nullable private final ExtendedBounds extendedBounds; @@ -101,7 +107,6 @@ public class HistogramAggregation extends BucketAggregationBase implements Aggre // --------------------------------------------------------------------------------------------- private HistogramAggregation(Builder builder) { - super(builder); this.extendedBounds = builder.extendedBounds; this.hardBounds = builder.hardBounds; @@ -251,9 +256,17 @@ public final Boolean keyed() { return this.keyed; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.extendedBounds != null) { generator.writeKey("extended_bounds"); this.extendedBounds.serialize(generator, mapper); @@ -320,6 +333,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -548,7 +566,7 @@ public HistogramAggregation build() { .lazy(Builder::new, HistogramAggregation::setupHistogramAggregationDeserializer); protected static void setupHistogramAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::extendedBounds, ExtendedBounds.createExtendedBoundsDeserializer(JsonpDeserializer.doubleDeserializer()), "extended_bounds"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpPrefixAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpPrefixAggregation.java index bed745b2c..ebc5ca6e2 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpPrefixAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpPrefixAggregation.java @@ -22,6 +22,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -59,7 +61,7 @@ * specification */ @JsonpDeserializable -public class IpPrefixAggregation extends BucketAggregationBase implements AggregationVariant { +public class IpPrefixAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { private final String field; private final int prefixLength; @@ -79,7 +81,6 @@ public class IpPrefixAggregation extends BucketAggregationBase implements Aggreg // --------------------------------------------------------------------------------------------- private IpPrefixAggregation(Builder builder) { - super(builder); this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); this.prefixLength = ApiTypeHelper.requireNonNull(builder.prefixLength, this, "prefixLength"); @@ -165,9 +166,17 @@ public final Long minDocCount() { return this.minDocCount; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); generator.writeKey("field"); generator.write(this.field); @@ -197,6 +206,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -314,7 +328,7 @@ public IpPrefixAggregation build() { .lazy(Builder::new, IpPrefixAggregation::setupIpPrefixAggregationDeserializer); protected static void setupIpPrefixAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::prefixLength, JsonpDeserializer.integerDeserializer(), "prefix_length"); op.add(Builder::isIpv6, JsonpDeserializer.booleanDeserializer(), "is_ipv6"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpRangeAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpRangeAggregation.java index 20748091d..71fbcf0d5 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpRangeAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpRangeAggregation.java @@ -22,6 +22,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -57,7 +59,7 @@ * specification */ @JsonpDeserializable -public class IpRangeAggregation extends BucketAggregationBase implements AggregationVariant { +public class IpRangeAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final String field; @@ -66,7 +68,6 @@ public class IpRangeAggregation extends BucketAggregationBase implements Aggrega // --------------------------------------------------------------------------------------------- private IpRangeAggregation(Builder builder) { - super(builder); this.field = builder.field; this.ranges = ApiTypeHelper.unmodifiable(builder.ranges); @@ -104,9 +105,17 @@ public final List ranges() { return this.ranges; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.field != null) { generator.writeKey("field"); generator.write(this.field); @@ -125,6 +134,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -213,7 +227,7 @@ public IpRangeAggregation build() { .lazy(Builder::new, IpRangeAggregation::setupIpRangeAggregationDeserializer); protected static void setupIpRangeAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::ranges, JsonpDeserializer.arrayDeserializer(IpRangeAggregationRange._DESERIALIZER), "ranges"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/LongTermsAggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/LongTermsAggregate.java index b767542c5..2c23f2e9a 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/LongTermsAggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/LongTermsAggregate.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregate; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregateVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -54,7 +56,10 @@ * specification */ @JsonpDeserializable -public class LongTermsAggregate extends TermsAggregateBase implements AggregateVariant { +public class LongTermsAggregate extends TermsAggregateBase + implements + AggregateVariant, + ApiKeyAggregateVariant { // --------------------------------------------------------------------------------------------- private LongTermsAggregate(Builder builder) { @@ -74,6 +79,14 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Lterms; } + /** + * ApiKeyAggregate variant kind. + */ + @Override + public ApiKeyAggregate.Kind _apiKeyAggregateKind() { + return ApiKeyAggregate.Kind.Lterms; + } + // --------------------------------------------------------------------------------------------- /** diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MatrixAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MatrixAggregation.java index 518893ed2..e04941c24 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MatrixAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MatrixAggregation.java @@ -22,6 +22,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -59,7 +61,7 @@ * specification */ -public abstract class MatrixAggregation extends AggregationBase { +public abstract class MatrixAggregation extends AggregationBase implements JsonpSerializable { private final List fields; private final Map missing; @@ -67,7 +69,6 @@ public abstract class MatrixAggregation extends AggregationBase { // --------------------------------------------------------------------------------------------- protected MatrixAggregation(AbstractBuilder builder) { - super(builder); this.fields = ApiTypeHelper.unmodifiable(builder.fields); this.missing = ApiTypeHelper.unmodifiable(builder.missing); @@ -93,9 +94,17 @@ public final Map missing() { return this.missing; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (ApiTypeHelper.isDefined(this.fields)) { generator.writeKey("fields"); generator.writeStartArray(); @@ -120,6 +129,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + public abstract static class AbstractBuilder> extends AggregationBase.AbstractBuilder { @@ -179,12 +193,14 @@ public final BuilderT missing(String key, Double value) { return self(); } + protected abstract BuilderT self(); + } // --------------------------------------------------------------------------------------------- protected static > void setupMatrixAggregationDeserializer( ObjectDeserializer op) { - AggregationBase.setupAggregationBaseDeserializer(op); + op.add(AbstractBuilder::fields, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "fields"); op.add(AbstractBuilder::missing, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MissingAggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MissingAggregate.java index 1b37d9867..5843bfd58 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MissingAggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MissingAggregate.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregate; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregateVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -52,7 +54,7 @@ * specification */ @JsonpDeserializable -public class MissingAggregate extends SingleBucketAggregateBase implements AggregateVariant { +public class MissingAggregate extends SingleBucketAggregateBase implements AggregateVariant, ApiKeyAggregateVariant { // --------------------------------------------------------------------------------------------- private MissingAggregate(Builder builder) { @@ -72,6 +74,14 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Missing; } + /** + * ApiKeyAggregate variant kind. + */ + @Override + public ApiKeyAggregate.Kind _apiKeyAggregateKind() { + return ApiKeyAggregate.Kind.Missing; + } + // --------------------------------------------------------------------------------------------- /** diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MissingAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MissingAggregation.java index 425e69521..ded342969 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MissingAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MissingAggregation.java @@ -20,9 +20,13 @@ package co.elastic.clients.elasticsearch._types.aggregations; import co.elastic.clients.elasticsearch._types.FieldValue; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregation; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregationVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -56,7 +60,11 @@ * specification */ @JsonpDeserializable -public class MissingAggregation extends BucketAggregationBase implements AggregationVariant { +public class MissingAggregation extends BucketAggregationBase + implements + AggregationVariant, + ApiKeyAggregationVariant, + JsonpSerializable { @Nullable private final String field; @@ -66,7 +74,6 @@ public class MissingAggregation extends BucketAggregationBase implements Aggrega // --------------------------------------------------------------------------------------------- private MissingAggregation(Builder builder) { - super(builder); this.field = builder.field; this.missing = builder.missing; @@ -85,6 +92,14 @@ public Aggregation.Kind _aggregationKind() { return Aggregation.Kind.Missing; } + /** + * ApiKeyAggregation variant kind. + */ + @Override + public ApiKeyAggregation.Kind _apiKeyAggregationKind() { + return ApiKeyAggregation.Kind.Missing; + } + /** * The name of the field. *

@@ -103,9 +118,17 @@ public final FieldValue missing() { return this.missing; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.field != null) { generator.writeKey("field"); generator.write(this.field); @@ -119,6 +142,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -218,7 +246,7 @@ public MissingAggregation build() { .lazy(Builder::new, MissingAggregation::setupMissingAggregationDeserializer); protected static void setupMissingAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::missing, FieldValue._DESERIALIZER, "missing"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregate.java index d28228969..195a8a189 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregate.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregate; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregateVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -52,7 +54,10 @@ * specification */ @JsonpDeserializable -public class MultiTermsAggregate extends TermsAggregateBase implements AggregateVariant { +public class MultiTermsAggregate extends TermsAggregateBase + implements + AggregateVariant, + ApiKeyAggregateVariant { // --------------------------------------------------------------------------------------------- private MultiTermsAggregate(Builder builder) { @@ -72,6 +77,14 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.MultiTerms; } + /** + * ApiKeyAggregate variant kind. + */ + @Override + public ApiKeyAggregate.Kind _apiKeyAggregateKind() { + return ApiKeyAggregate.Kind.MultiTerms; + } + // --------------------------------------------------------------------------------------------- /** diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregation.java index 77651d9c6..78409eeb5 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregation.java @@ -23,6 +23,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -61,7 +63,7 @@ * specification */ @JsonpDeserializable -public class MultiTermsAggregation extends BucketAggregationBase implements AggregationVariant { +public class MultiTermsAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final TermsAggregationCollectMode collectMode; @@ -87,7 +89,6 @@ public class MultiTermsAggregation extends BucketAggregationBase implements Aggr // --------------------------------------------------------------------------------------------- private MultiTermsAggregation(Builder builder) { - super(builder); this.collectMode = builder.collectMode; this.order = ApiTypeHelper.unmodifiable(builder.order); @@ -194,9 +195,17 @@ public final List terms() { return this.terms; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.collectMode != null) { generator.writeKey("collect_mode"); this.collectMode.serialize(generator, mapper); @@ -252,6 +261,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -435,7 +449,7 @@ public MultiTermsAggregation build() { .lazy(Builder::new, MultiTermsAggregation::setupMultiTermsAggregationDeserializer); protected static void setupMultiTermsAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::collectMode, TermsAggregationCollectMode._DESERIALIZER, "collect_mode"); op.add(Builder::order, JsonpDeserializer.arrayDeserializer(NamedValue.deserializer(() -> SortOrder._DESERIALIZER)), "order"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/NestedAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/NestedAggregation.java index a42eef7d7..1a9044d68 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/NestedAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/NestedAggregation.java @@ -22,6 +22,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -55,14 +57,13 @@ * specification */ @JsonpDeserializable -public class NestedAggregation extends BucketAggregationBase implements AggregationVariant { +public class NestedAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final String path; // --------------------------------------------------------------------------------------------- private NestedAggregation(Builder builder) { - super(builder); this.path = builder.path; @@ -90,9 +91,17 @@ public final String path() { return this.path; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.path != null) { generator.writeKey("path"); generator.write(this.path); @@ -101,6 +110,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -150,7 +164,7 @@ public NestedAggregation build() { .lazy(Builder::new, NestedAggregation::setupNestedAggregationDeserializer); protected static void setupNestedAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::path, JsonpDeserializer.stringDeserializer(), "path"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ParentAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ParentAggregation.java index 55171ca96..7ab7d4e8d 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ParentAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ParentAggregation.java @@ -22,6 +22,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -55,14 +57,13 @@ * specification */ @JsonpDeserializable -public class ParentAggregation extends BucketAggregationBase implements AggregationVariant { +public class ParentAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final String type; // --------------------------------------------------------------------------------------------- private ParentAggregation(Builder builder) { - super(builder); this.type = builder.type; @@ -90,9 +91,17 @@ public final String type() { return this.type; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.type != null) { generator.writeKey("type"); generator.write(this.type); @@ -101,6 +110,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -150,7 +164,7 @@ public ParentAggregation build() { .lazy(Builder::new, ParentAggregation::setupParentAggregationDeserializer); protected static void setupParentAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RangeAggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RangeAggregate.java index 72ee7748c..d61c0ad3c 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RangeAggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RangeAggregate.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregate; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregateVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -53,7 +55,10 @@ * specification */ @JsonpDeserializable -public class RangeAggregate extends MultiBucketAggregateBase implements AggregateVariant { +public class RangeAggregate extends MultiBucketAggregateBase + implements + AggregateVariant, + ApiKeyAggregateVariant { // --------------------------------------------------------------------------------------------- protected RangeAggregate(AbstractBuilder builder) { @@ -73,6 +78,14 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Range; } + /** + * ApiKeyAggregate variant kind. + */ + @Override + public ApiKeyAggregate.Kind _apiKeyAggregateKind() { + return ApiKeyAggregate.Kind.Range; + } + // --------------------------------------------------------------------------------------------- /** diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RangeAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RangeAggregation.java index ae98f4715..1e566f409 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RangeAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RangeAggregation.java @@ -20,9 +20,13 @@ package co.elastic.clients.elasticsearch._types.aggregations; import co.elastic.clients.elasticsearch._types.Script; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregation; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregationVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -60,7 +64,11 @@ * specification */ @JsonpDeserializable -public class RangeAggregation extends BucketAggregationBase implements AggregationVariant { +public class RangeAggregation extends BucketAggregationBase + implements + AggregationVariant, + ApiKeyAggregationVariant, + JsonpSerializable { @Nullable private final String field; @@ -81,7 +89,6 @@ public class RangeAggregation extends BucketAggregationBase implements Aggregati // --------------------------------------------------------------------------------------------- private RangeAggregation(Builder builder) { - super(builder); this.field = builder.field; this.missing = builder.missing; @@ -104,6 +111,14 @@ public Aggregation.Kind _aggregationKind() { return Aggregation.Kind.Range; } + /** + * ApiKeyAggregation variant kind. + */ + @Override + public ApiKeyAggregation.Kind _apiKeyAggregationKind() { + return ApiKeyAggregation.Kind.Range; + } + /** * The date field whose values are use to build ranges. *

@@ -161,9 +176,17 @@ public final String format() { return this.format; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.field != null) { generator.writeKey("field"); generator.write(this.field); @@ -202,6 +225,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -346,7 +374,7 @@ public RangeAggregation build() { RangeAggregation::setupRangeAggregationDeserializer); protected static void setupRangeAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::missing, JsonpDeserializer.integerDeserializer(), "missing"); op.add(Builder::ranges, JsonpDeserializer.arrayDeserializer(AggregationRange._DESERIALIZER), "ranges"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RareTermsAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RareTermsAggregation.java index 6aa5dea0b..02fd0d770 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RareTermsAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RareTermsAggregation.java @@ -23,6 +23,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -58,7 +60,7 @@ * specification */ @JsonpDeserializable -public class RareTermsAggregation extends BucketAggregationBase implements AggregationVariant { +public class RareTermsAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final TermsExclude exclude; @@ -83,7 +85,6 @@ public class RareTermsAggregation extends BucketAggregationBase implements Aggre // --------------------------------------------------------------------------------------------- private RareTermsAggregation(Builder builder) { - super(builder); this.exclude = builder.exclude; this.field = builder.field; @@ -177,9 +178,17 @@ public final String valueType() { return this.valueType; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.exclude != null) { generator.writeKey("exclude"); this.exclude.serialize(generator, mapper); @@ -218,6 +227,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -417,7 +431,7 @@ public RareTermsAggregation build() { .lazy(Builder::new, RareTermsAggregation::setupRareTermsAggregationDeserializer); protected static void setupRareTermsAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::exclude, TermsExclude._DESERIALIZER, "exclude"); op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); op.add(Builder::include, TermsInclude._DESERIALIZER, "include"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ReverseNestedAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ReverseNestedAggregation.java index 30399376d..c4de764ce 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ReverseNestedAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ReverseNestedAggregation.java @@ -22,6 +22,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -55,14 +57,13 @@ * specification */ @JsonpDeserializable -public class ReverseNestedAggregation extends BucketAggregationBase implements AggregationVariant { +public class ReverseNestedAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final String path; // --------------------------------------------------------------------------------------------- private ReverseNestedAggregation(Builder builder) { - super(builder); this.path = builder.path; @@ -91,9 +92,17 @@ public final String path() { return this.path; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.path != null) { generator.writeKey("path"); generator.write(this.path); @@ -102,6 +111,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -153,7 +167,7 @@ public ReverseNestedAggregation build() { protected static void setupReverseNestedAggregationDeserializer( ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::path, JsonpDeserializer.stringDeserializer(), "path"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SamplerAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SamplerAggregation.java index f93a9b838..4c730a6c2 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SamplerAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SamplerAggregation.java @@ -22,6 +22,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -55,14 +57,13 @@ * specification */ @JsonpDeserializable -public class SamplerAggregation extends BucketAggregationBase implements AggregationVariant { +public class SamplerAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final Integer shardSize; // --------------------------------------------------------------------------------------------- private SamplerAggregation(Builder builder) { - super(builder); this.shardSize = builder.shardSize; @@ -91,9 +92,17 @@ public final Integer shardSize() { return this.shardSize; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.shardSize != null) { generator.writeKey("shard_size"); generator.write(this.shardSize); @@ -102,6 +111,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -152,7 +166,7 @@ public SamplerAggregation build() { .lazy(Builder::new, SamplerAggregation::setupSamplerAggregationDeserializer); protected static void setupSamplerAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::shardSize, JsonpDeserializer.integerDeserializer(), "shard_size"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantTermsAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantTermsAggregation.java index e4dc96ea5..712b8f059 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantTermsAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantTermsAggregation.java @@ -24,6 +24,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -59,7 +61,10 @@ * specification */ @JsonpDeserializable -public class SignificantTermsAggregation extends BucketAggregationBase implements AggregationVariant { +public class SignificantTermsAggregation extends BucketAggregationBase + implements + AggregationVariant, + JsonpSerializable { @Nullable private final Query backgroundFilter; @@ -108,7 +113,6 @@ public class SignificantTermsAggregation extends BucketAggregationBase implement // --------------------------------------------------------------------------------------------- private SignificantTermsAggregation(Builder builder) { - super(builder); this.backgroundFilter = builder.backgroundFilter; this.chiSquare = builder.chiSquare; @@ -302,9 +306,17 @@ public final Integer size() { return this.size; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.backgroundFilter != null) { generator.writeKey("background_filter"); this.backgroundFilter.serialize(generator, mapper); @@ -382,6 +394,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -715,7 +732,7 @@ public SignificantTermsAggregation build() { protected static void setupSignificantTermsAggregationDeserializer( ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::backgroundFilter, Query._DESERIALIZER, "background_filter"); op.add(Builder::chiSquare, ChiSquareHeuristic._DESERIALIZER, "chi_square"); op.add(Builder::exclude, TermsExclude._DESERIALIZER, "exclude"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantTextAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantTextAggregation.java index aee184b30..2c6cc95c6 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantTextAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantTextAggregation.java @@ -24,6 +24,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -62,7 +64,7 @@ * specification */ @JsonpDeserializable -public class SignificantTextAggregation extends BucketAggregationBase implements AggregationVariant { +public class SignificantTextAggregation extends BucketAggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final Query backgroundFilter; @@ -116,7 +118,6 @@ public class SignificantTextAggregation extends BucketAggregationBase implements // --------------------------------------------------------------------------------------------- private SignificantTextAggregation(Builder builder) { - super(builder); this.backgroundFilter = builder.backgroundFilter; this.chiSquare = builder.chiSquare; @@ -332,9 +333,17 @@ public final List sourceFields() { return this.sourceFields; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.backgroundFilter != null) { generator.writeKey("background_filter"); this.backgroundFilter.serialize(generator, mapper); @@ -427,6 +436,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -802,7 +816,7 @@ public SignificantTextAggregation build() { protected static void setupSignificantTextAggregationDeserializer( ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::backgroundFilter, Query._DESERIALIZER, "background_filter"); op.add(Builder::chiSquare, ChiSquareHeuristic._DESERIALIZER, "chi_square"); op.add(Builder::exclude, TermsExclude._DESERIALIZER, "exclude"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StringTermsAggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StringTermsAggregate.java index 2bccc1369..09df0144f 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StringTermsAggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StringTermsAggregate.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregate; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregateVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -53,7 +55,10 @@ * specification */ @JsonpDeserializable -public class StringTermsAggregate extends TermsAggregateBase implements AggregateVariant { +public class StringTermsAggregate extends TermsAggregateBase + implements + AggregateVariant, + ApiKeyAggregateVariant { // --------------------------------------------------------------------------------------------- private StringTermsAggregate(Builder builder) { @@ -73,6 +78,14 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Sterms; } + /** + * ApiKeyAggregate variant kind. + */ + @Override + public ApiKeyAggregate.Kind _apiKeyAggregateKind() { + return ApiKeyAggregate.Kind.Sterms; + } + // --------------------------------------------------------------------------------------------- /** diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TTestAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TTestAggregation.java index 57ffa3df2..3a2e2dbad 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TTestAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TTestAggregation.java @@ -22,6 +22,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -54,7 +56,7 @@ * specification */ @JsonpDeserializable -public class TTestAggregation extends AggregationBase implements AggregationVariant { +public class TTestAggregation extends AggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final TestPopulation a; @@ -67,7 +69,6 @@ public class TTestAggregation extends AggregationBase implements AggregationVari // --------------------------------------------------------------------------------------------- private TTestAggregation(Builder builder) { - super(builder); this.a = builder.a; this.b = builder.b; @@ -117,9 +118,17 @@ public final TTestType type() { return this.type; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.a != null) { generator.writeKey("a"); this.a.serialize(generator, mapper); @@ -137,6 +146,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -230,7 +244,7 @@ public TTestAggregation build() { TTestAggregation::setupTTestAggregationDeserializer); protected static void setupTTestAggregationDeserializer(ObjectDeserializer op) { - AggregationBase.setupAggregationBaseDeserializer(op); + op.add(Builder::a, TestPopulation._DESERIALIZER, "a"); op.add(Builder::b, TestPopulation._DESERIALIZER, "b"); op.add(Builder::type, TTestType._DESERIALIZER, "type"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsAggregation.java index f6be9fdf1..ff8002baf 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsAggregation.java @@ -22,11 +22,15 @@ import co.elastic.clients.elasticsearch._types.FieldValue; import co.elastic.clients.elasticsearch._types.Script; import co.elastic.clients.elasticsearch._types.SortOrder; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregation; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregationVariant; import co.elastic.clients.elasticsearch.transform.PivotGroupBy; import co.elastic.clients.elasticsearch.transform.PivotGroupByVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; @@ -35,6 +39,7 @@ import jakarta.json.stream.JsonGenerator; import java.lang.Boolean; import java.lang.Integer; +import java.lang.Long; import java.lang.String; import java.util.List; import java.util.Objects; @@ -65,7 +70,12 @@ * specification */ @JsonpDeserializable -public class TermsAggregation extends BucketAggregationBase implements AggregationVariant, PivotGroupByVariant { +public class TermsAggregation extends BucketAggregationBase + implements + AggregationVariant, + PivotGroupByVariant, + ApiKeyAggregationVariant, + JsonpSerializable { @Nullable private final TermsAggregationCollectMode collectMode; @@ -101,6 +111,9 @@ public class TermsAggregation extends BucketAggregationBase implements Aggregati @Nullable private final Script script; + @Nullable + private final Long shardMinDocCount; + @Nullable private final Integer shardSize; @@ -116,7 +129,6 @@ public class TermsAggregation extends BucketAggregationBase implements Aggregati // --------------------------------------------------------------------------------------------- private TermsAggregation(Builder builder) { - super(builder); this.collectMode = builder.collectMode; this.exclude = builder.exclude; @@ -130,6 +142,7 @@ private TermsAggregation(Builder builder) { this.valueType = builder.valueType; this.order = ApiTypeHelper.unmodifiable(builder.order); this.script = builder.script; + this.shardMinDocCount = builder.shardMinDocCount; this.shardSize = builder.shardSize; this.showTermDocCountError = builder.showTermDocCountError; this.size = builder.size; @@ -157,6 +170,14 @@ public PivotGroupBy.Kind _pivotGroupByKind() { return PivotGroupBy.Kind.Terms; } + /** + * ApiKeyAggregation variant kind. + */ + @Override + public ApiKeyAggregation.Kind _apiKeyAggregationKind() { + return ApiKeyAggregation.Kind.Terms; + } + /** * Determines how child aggregations should be calculated: breadth-first or * depth-first. @@ -275,6 +296,19 @@ public final Script script() { return this.script; } + /** + * Regulates the certainty a shard has if the term should actually be added to + * the candidate list or not with respect to the min_doc_count. + * Terms will only be considered if their local shard frequency within the set + * is higher than the shard_min_doc_count. + *

+ * API name: {@code shard_min_doc_count} + */ + @Nullable + public final Long shardMinDocCount() { + return this.shardMinDocCount; + } + /** * The number of candidate terms produced by each shard. By default, * shard_size will be automatically estimated based on the number @@ -317,9 +351,17 @@ public final String format() { return this.format; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.collectMode != null) { generator.writeKey("collect_mode"); this.collectMode.serialize(generator, mapper); @@ -384,6 +426,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("script"); this.script.serialize(generator, mapper); + } + if (this.shardMinDocCount != null) { + generator.writeKey("shard_min_doc_count"); + generator.write(this.shardMinDocCount); + } if (this.shardSize != null) { generator.writeKey("shard_size"); @@ -408,6 +455,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -453,6 +505,9 @@ public static class Builder extends BucketAggregationBase.AbstractBuilder> fn) return this.script(fn.apply(new Script.Builder()).build()); } + /** + * Regulates the certainty a shard has if the term should actually be added to + * the candidate list or not with respect to the min_doc_count. + * Terms will only be considered if their local shard frequency within the set + * is higher than the shard_min_doc_count. + *

+ * API name: {@code shard_min_doc_count} + */ + public final Builder shardMinDocCount(@Nullable Long value) { + this.shardMinDocCount = value; + return this; + } + /** * The number of candidate terms produced by each shard. By default, * shard_size will be automatically estimated based on the number @@ -747,7 +815,7 @@ public TermsAggregation build() { TermsAggregation::setupTermsAggregationDeserializer); protected static void setupTermsAggregationDeserializer(ObjectDeserializer op) { - BucketAggregationBase.setupBucketAggregationBaseDeserializer(op); + op.add(Builder::collectMode, TermsAggregationCollectMode._DESERIALIZER, "collect_mode"); op.add(Builder::exclude, TermsExclude._DESERIALIZER, "exclude"); op.add(Builder::executionHint, TermsAggregationExecutionHint._DESERIALIZER, "execution_hint"); @@ -761,6 +829,7 @@ protected static void setupTermsAggregationDeserializer(ObjectDeserializer SortOrder._DESERIALIZER)), "order"); op.add(Builder::script, Script._DESERIALIZER, "script"); + op.add(Builder::shardMinDocCount, JsonpDeserializer.longDeserializer(), "shard_min_doc_count"); op.add(Builder::shardSize, JsonpDeserializer.integerDeserializer(), "shard_size"); op.add(Builder::showTermDocCountError, JsonpDeserializer.booleanDeserializer(), "show_term_doc_count_error"); op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsBucketBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsBucketBase.java index f5cb39e0b..eba72c57d 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsBucketBase.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsBucketBase.java @@ -57,31 +57,31 @@ public abstract class TermsBucketBase extends MultiBucketBase { @Nullable - private final Long docCountError; + private final Long docCountErrorUpperBound; // --------------------------------------------------------------------------------------------- protected TermsBucketBase(AbstractBuilder builder) { super(builder); - this.docCountError = builder.docCountError; + this.docCountErrorUpperBound = builder.docCountErrorUpperBound; } /** - * API name: {@code doc_count_error} + * API name: {@code doc_count_error_upper_bound} */ @Nullable - public final Long docCountError() { - return this.docCountError; + public final Long docCountErrorUpperBound() { + return this.docCountErrorUpperBound; } protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { super.serializeInternal(generator, mapper); - if (this.docCountError != null) { - generator.writeKey("doc_count_error"); - generator.write(this.docCountError); + if (this.docCountErrorUpperBound != null) { + generator.writeKey("doc_count_error_upper_bound"); + generator.write(this.docCountErrorUpperBound); } @@ -91,13 +91,13 @@ public abstract static class AbstractBuilder { @Nullable - private Long docCountError; + private Long docCountErrorUpperBound; /** - * API name: {@code doc_count_error} + * API name: {@code doc_count_error_upper_bound} */ - public final BuilderT docCountError(@Nullable Long value) { - this.docCountError = value; + public final BuilderT docCountErrorUpperBound(@Nullable Long value) { + this.docCountErrorUpperBound = value; return self(); } @@ -107,7 +107,8 @@ public final BuilderT docCountError(@Nullable Long value) { protected static > void setupTermsBucketBaseDeserializer( ObjectDeserializer op) { MultiBucketBase.setupMultiBucketBaseDeserializer(op); - op.add(AbstractBuilder::docCountError, JsonpDeserializer.longDeserializer(), "doc_count_error"); + op.add(AbstractBuilder::docCountErrorUpperBound, JsonpDeserializer.longDeserializer(), + "doc_count_error_upper_bound"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TopHitsAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TopHitsAggregation.java index f07d1ae5d..e839a45a6 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TopHitsAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TopHitsAggregation.java @@ -21,6 +21,7 @@ import co.elastic.clients.elasticsearch._types.ScriptField; import co.elastic.clients.elasticsearch._types.SortOptions; +import co.elastic.clients.elasticsearch._types.query_dsl.FieldAndFormat; import co.elastic.clients.elasticsearch.core.search.Highlight; import co.elastic.clients.elasticsearch.core.search.SourceConfig; import co.elastic.clients.json.JsonpDeserializable; @@ -65,11 +66,13 @@ */ @JsonpDeserializable public class TopHitsAggregation extends MetricAggregationBase implements AggregationVariant { - private final List docvalueFields; + private final List docvalueFields; @Nullable private final Boolean explain; + private final List fields; + @Nullable private final Integer from; @@ -104,6 +107,7 @@ private TopHitsAggregation(Builder builder) { this.docvalueFields = ApiTypeHelper.unmodifiable(builder.docvalueFields); this.explain = builder.explain; + this.fields = ApiTypeHelper.unmodifiable(builder.fields); this.from = builder.from; this.highlight = builder.highlight; this.scriptFields = ApiTypeHelper.unmodifiable(builder.scriptFields); @@ -134,7 +138,7 @@ public Aggregation.Kind _aggregationKind() { *

* API name: {@code docvalue_fields} */ - public final List docvalueFields() { + public final List docvalueFields() { return this.docvalueFields; } @@ -149,6 +153,16 @@ public final Boolean explain() { return this.explain; } + /** + * Array of wildcard (*) patterns. The request returns values for field names + * matching these patterns in the hits.fields property of the response. + *

+ * API name: {@code fields} + */ + public final List fields() { + return this.fields; + } + /** * Starting document offset. *

@@ -257,8 +271,8 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (ApiTypeHelper.isDefined(this.docvalueFields)) { generator.writeKey("docvalue_fields"); generator.writeStartArray(); - for (String item0 : this.docvalueFields) { - generator.write(item0); + for (FieldAndFormat item0 : this.docvalueFields) { + item0.serialize(generator, mapper); } generator.writeEnd(); @@ -268,6 +282,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("explain"); generator.write(this.explain); + } + if (ApiTypeHelper.isDefined(this.fields)) { + generator.writeKey("fields"); + generator.writeStartArray(); + for (FieldAndFormat item0 : this.fields) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + } if (this.from != null) { generator.writeKey("from"); @@ -348,11 +372,14 @@ public static class Builder extends MetricAggregationBase.AbstractBuilder { @Nullable - private List docvalueFields; + private List docvalueFields; @Nullable private Boolean explain; + @Nullable + private List fields; + @Nullable private Integer from; @@ -390,7 +417,7 @@ public static class Builder extends MetricAggregationBase.AbstractBuilder * Adds all elements of list to docvalueFields. */ - public final Builder docvalueFields(List list) { + public final Builder docvalueFields(List list) { this.docvalueFields = _listAddAll(this.docvalueFields, list); return this; } @@ -402,11 +429,22 @@ public final Builder docvalueFields(List list) { *

* Adds one or more values to docvalueFields. */ - public final Builder docvalueFields(String value, String... values) { + public final Builder docvalueFields(FieldAndFormat value, FieldAndFormat... values) { this.docvalueFields = _listAdd(this.docvalueFields, value, values); return this; } + /** + * Fields for which to return doc values. + *

+ * API name: {@code docvalue_fields} + *

+ * Adds a value to docvalueFields using a builder lambda. + */ + public final Builder docvalueFields(Function> fn) { + return docvalueFields(fn.apply(new FieldAndFormat.Builder()).build()); + } + /** * If true, returns detailed information about score computation as * part of a hit. @@ -418,6 +456,44 @@ public final Builder explain(@Nullable Boolean value) { return this; } + /** + * Array of wildcard (*) patterns. The request returns values for field names + * matching these patterns in the hits.fields property of the response. + *

+ * API name: {@code fields} + *

+ * Adds all elements of list to fields. + */ + public final Builder fields(List list) { + this.fields = _listAddAll(this.fields, list); + return this; + } + + /** + * Array of wildcard (*) patterns. The request returns values for field names + * matching these patterns in the hits.fields property of the response. + *

+ * API name: {@code fields} + *

+ * Adds one or more values to fields. + */ + public final Builder fields(FieldAndFormat value, FieldAndFormat... values) { + this.fields = _listAdd(this.fields, value, values); + return this; + } + + /** + * Array of wildcard (*) patterns. The request returns values for field names + * matching these patterns in the hits.fields property of the response. + *

+ * API name: {@code fields} + *

+ * Adds a value to fields using a builder lambda. + */ + public final Builder fields(Function> fn) { + return fields(fn.apply(new FieldAndFormat.Builder()).build()); + } + /** * Starting document offset. *

@@ -637,9 +713,10 @@ public TopHitsAggregation build() { protected static void setupTopHitsAggregationDeserializer(ObjectDeserializer op) { MetricAggregationBase.setupMetricAggregationBaseDeserializer(op); - op.add(Builder::docvalueFields, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + op.add(Builder::docvalueFields, JsonpDeserializer.arrayDeserializer(FieldAndFormat._DESERIALIZER), "docvalue_fields"); op.add(Builder::explain, JsonpDeserializer.booleanDeserializer(), "explain"); + op.add(Builder::fields, JsonpDeserializer.arrayDeserializer(FieldAndFormat._DESERIALIZER), "fields"); op.add(Builder::from, JsonpDeserializer.integerDeserializer(), "from"); op.add(Builder::highlight, Highlight._DESERIALIZER, "highlight"); op.add(Builder::scriptFields, JsonpDeserializer.stringMapDeserializer(ScriptField._DESERIALIZER), diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/UnmappedTermsAggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/UnmappedTermsAggregate.java index 005f3ebec..e7f95a30d 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/UnmappedTermsAggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/UnmappedTermsAggregate.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregate; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregateVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -55,7 +57,10 @@ * specification */ @JsonpDeserializable -public class UnmappedTermsAggregate extends TermsAggregateBase implements AggregateVariant { +public class UnmappedTermsAggregate extends TermsAggregateBase + implements + AggregateVariant, + ApiKeyAggregateVariant { // --------------------------------------------------------------------------------------------- private UnmappedTermsAggregate(Builder builder) { @@ -75,6 +80,14 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.Umterms; } + /** + * ApiKeyAggregate variant kind. + */ + @Override + public ApiKeyAggregate.Kind _apiKeyAggregateKind() { + return ApiKeyAggregate.Kind.Umterms; + } + // --------------------------------------------------------------------------------------------- /** diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ValueCountAggregate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ValueCountAggregate.java index dfc389349..c7bed70e6 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ValueCountAggregate.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ValueCountAggregate.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregate; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregateVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -53,7 +55,7 @@ * specification */ @JsonpDeserializable -public class ValueCountAggregate extends SingleMetricAggregateBase implements AggregateVariant { +public class ValueCountAggregate extends SingleMetricAggregateBase implements AggregateVariant, ApiKeyAggregateVariant { // --------------------------------------------------------------------------------------------- private ValueCountAggregate(Builder builder) { @@ -73,6 +75,14 @@ public Aggregate.Kind _aggregateKind() { return Aggregate.Kind.ValueCount; } + /** + * ApiKeyAggregate variant kind. + */ + @Override + public ApiKeyAggregate.Kind _apiKeyAggregateKind() { + return ApiKeyAggregate.Kind.ValueCount; + } + // --------------------------------------------------------------------------------------------- /** diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ValueCountAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ValueCountAggregation.java index dc95726b5..79c67d0dd 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ValueCountAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ValueCountAggregation.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregation; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregationVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -52,7 +54,10 @@ * specification */ @JsonpDeserializable -public class ValueCountAggregation extends FormattableMetricAggregation implements AggregationVariant { +public class ValueCountAggregation extends FormattableMetricAggregation + implements + AggregationVariant, + ApiKeyAggregationVariant { // --------------------------------------------------------------------------------------------- private ValueCountAggregation(Builder builder) { @@ -72,6 +77,14 @@ public Aggregation.Kind _aggregationKind() { return Aggregation.Kind.ValueCount; } + /** + * ApiKeyAggregation variant kind. + */ + @Override + public ApiKeyAggregation.Kind _apiKeyAggregationKind() { + return ApiKeyAggregation.Kind.ValueCount; + } + // --------------------------------------------------------------------------------------------- /** diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/VariableWidthHistogramAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/VariableWidthHistogramAggregation.java index c3629ad4f..09341d539 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/VariableWidthHistogramAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/VariableWidthHistogramAggregation.java @@ -19,6 +19,7 @@ package co.elastic.clients.elasticsearch._types.aggregations; +import co.elastic.clients.elasticsearch._types.Script; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -72,6 +73,9 @@ public class VariableWidthHistogramAggregation implements AggregationVariant, Js @Nullable private final Integer initialBuffer; + @Nullable + private final Script script; + // --------------------------------------------------------------------------------------------- private VariableWidthHistogramAggregation(Builder builder) { @@ -80,6 +84,7 @@ private VariableWidthHistogramAggregation(Builder builder) { this.buckets = builder.buckets; this.shardSize = builder.shardSize; this.initialBuffer = builder.initialBuffer; + this.script = builder.script; } @@ -139,6 +144,14 @@ public final Integer initialBuffer() { return this.initialBuffer; } + /** + * API name: {@code script} + */ + @Nullable + public final Script script() { + return this.script; + } + /** * Serialize this object to JSON. */ @@ -170,6 +183,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.initialBuffer); } + if (this.script != null) { + generator.writeKey("script"); + this.script.serialize(generator, mapper); + + } } @@ -199,6 +217,9 @@ public static class Builder extends WithJsonObjectBuilderBase @Nullable private Integer initialBuffer; + @Nullable + private Script script; + /** * The name of the field. *

@@ -242,6 +263,21 @@ public final Builder initialBuffer(@Nullable Integer value) { return this; } + /** + * API name: {@code script} + */ + public final Builder script(@Nullable Script value) { + this.script = value; + return this; + } + + /** + * API name: {@code script} + */ + public final Builder script(Function> fn) { + return this.script(fn.apply(new Script.Builder()).build()); + } + @Override protected Builder self() { return this; @@ -275,6 +311,7 @@ protected static void setupVariableWidthHistogramAggregationDeserializer( op.add(Builder::buckets, JsonpDeserializer.integerDeserializer(), "buckets"); op.add(Builder::shardSize, JsonpDeserializer.integerDeserializer(), "shard_size"); op.add(Builder::initialBuffer, JsonpDeserializer.integerDeserializer(), "initial_buffer"); + op.add(Builder::script, Script._DESERIALIZER, "script"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/WeightedAverageAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/WeightedAverageAggregation.java index 5153590a5..e61ef1625 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/WeightedAverageAggregation.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/WeightedAverageAggregation.java @@ -22,6 +22,8 @@ import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ObjectBuilder; @@ -55,7 +57,7 @@ * specification */ @JsonpDeserializable -public class WeightedAverageAggregation extends AggregationBase implements AggregationVariant { +public class WeightedAverageAggregation extends AggregationBase implements AggregationVariant, JsonpSerializable { @Nullable private final String format; @@ -71,7 +73,6 @@ public class WeightedAverageAggregation extends AggregationBase implements Aggre // --------------------------------------------------------------------------------------------- private WeightedAverageAggregation(Builder builder) { - super(builder); this.format = builder.format; this.value = builder.value; @@ -130,9 +131,17 @@ public final WeightedAverageValue weight() { return this.weight; } + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - super.serializeInternal(generator, mapper); if (this.format != null) { generator.writeKey("format"); generator.write(this.format); @@ -155,6 +164,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + @Override + public String toString() { + return JsonpUtils.toString(this); + } + // --------------------------------------------------------------------------------------------- /** @@ -260,7 +274,7 @@ public WeightedAverageAggregation build() { protected static void setupWeightedAverageAggregationDeserializer( ObjectDeserializer op) { - AggregationBase.setupAggregationBaseDeserializer(op); + op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); op.add(Builder::value, WeightedAverageValue._DESERIALIZER, "value"); op.add(Builder::valueType, ValueType._DESERIALIZER, "value_type"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/HtmlStripCharFilter.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/HtmlStripCharFilter.java index 3f0bbbd31..d8a97a5a3 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/HtmlStripCharFilter.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/HtmlStripCharFilter.java @@ -24,10 +24,14 @@ import co.elastic.clients.json.JsonpMapper; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; import java.util.Objects; import java.util.function.Function; +import javax.annotation.Nullable; //---------------------------------------------------------------- // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. @@ -54,11 +58,15 @@ */ @JsonpDeserializable public class HtmlStripCharFilter extends CharFilterBase implements CharFilterDefinitionVariant { + private final List escapedTags; + // --------------------------------------------------------------------------------------------- private HtmlStripCharFilter(Builder builder) { super(builder); + this.escapedTags = ApiTypeHelper.unmodifiable(builder.escapedTags); + } public static HtmlStripCharFilter of(Function> fn) { @@ -73,10 +81,27 @@ public CharFilterDefinition.Kind _charFilterDefinitionKind() { return CharFilterDefinition.Kind.HtmlStrip; } + /** + * API name: {@code escaped_tags} + */ + public final List escapedTags() { + return this.escapedTags; + } + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write("type", "html_strip"); super.serializeInternal(generator, mapper); + if (ApiTypeHelper.isDefined(this.escapedTags)) { + generator.writeKey("escaped_tags"); + generator.writeStartArray(); + for (String item0 : this.escapedTags) { + generator.write(item0); + + } + generator.writeEnd(); + + } } @@ -89,6 +114,29 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { public static class Builder extends CharFilterBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private List escapedTags; + + /** + * API name: {@code escaped_tags} + *

+ * Adds all elements of list to escapedTags. + */ + public final Builder escapedTags(List list) { + this.escapedTags = _listAddAll(this.escapedTags, list); + return this; + } + + /** + * API name: {@code escaped_tags} + *

+ * Adds one or more values to escapedTags. + */ + public final Builder escapedTags(String value, String... values) { + this.escapedTags = _listAdd(this.escapedTags, value, values); + return this; + } + @Override protected Builder self() { return this; @@ -117,6 +165,8 @@ public HtmlStripCharFilter build() { protected static void setupHtmlStripCharFilterDeserializer(ObjectDeserializer op) { CharFilterBase.setupCharFilterBaseDeserializer(op); + op.add(Builder::escapedTags, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "escaped_tags"); op.ignore("type"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuCollationTokenFilter.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuCollationTokenFilter.java index 36f9aabca..84d9fcea3 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuCollationTokenFilter.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuCollationTokenFilter.java @@ -61,10 +61,10 @@ public class IcuCollationTokenFilter extends TokenFilterBase implements TokenFil private final IcuCollationAlternate alternate; @Nullable - private final IcuCollationCaseFirst casefirst; + private final IcuCollationCaseFirst caseFirst; @Nullable - private final Boolean caselevel; + private final Boolean caseLevel; @Nullable private final String country; @@ -73,7 +73,7 @@ public class IcuCollationTokenFilter extends TokenFilterBase implements TokenFil private final IcuCollationDecomposition decomposition; @Nullable - private final Boolean hiraganaquaternarymode; + private final Boolean hiraganaQuaternaryMode; @Nullable private final String language; @@ -88,7 +88,7 @@ public class IcuCollationTokenFilter extends TokenFilterBase implements TokenFil private final IcuCollationStrength strength; @Nullable - private final String variabletop; + private final String variableTop; @Nullable private final String variant; @@ -99,16 +99,16 @@ private IcuCollationTokenFilter(Builder builder) { super(builder); this.alternate = builder.alternate; - this.casefirst = builder.casefirst; - this.caselevel = builder.caselevel; + this.caseFirst = builder.caseFirst; + this.caseLevel = builder.caseLevel; this.country = builder.country; this.decomposition = builder.decomposition; - this.hiraganaquaternarymode = builder.hiraganaquaternarymode; + this.hiraganaQuaternaryMode = builder.hiraganaQuaternaryMode; this.language = builder.language; this.numeric = builder.numeric; this.rules = builder.rules; this.strength = builder.strength; - this.variabletop = builder.variabletop; + this.variableTop = builder.variableTop; this.variant = builder.variant; } @@ -134,19 +134,19 @@ public final IcuCollationAlternate alternate() { } /** - * API name: {@code caseFirst} + * API name: {@code case_first} */ @Nullable - public final IcuCollationCaseFirst casefirst() { - return this.casefirst; + public final IcuCollationCaseFirst caseFirst() { + return this.caseFirst; } /** - * API name: {@code caseLevel} + * API name: {@code case_level} */ @Nullable - public final Boolean caselevel() { - return this.caselevel; + public final Boolean caseLevel() { + return this.caseLevel; } /** @@ -166,11 +166,11 @@ public final IcuCollationDecomposition decomposition() { } /** - * API name: {@code hiraganaQuaternaryMode} + * API name: {@code hiragana_quaternary_mode} */ @Nullable - public final Boolean hiraganaquaternarymode() { - return this.hiraganaquaternarymode; + public final Boolean hiraganaQuaternaryMode() { + return this.hiraganaQuaternaryMode; } /** @@ -206,11 +206,11 @@ public final IcuCollationStrength strength() { } /** - * API name: {@code variableTop} + * API name: {@code variable_top} */ @Nullable - public final String variabletop() { - return this.variabletop; + public final String variableTop() { + return this.variableTop; } /** @@ -229,13 +229,13 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("alternate"); this.alternate.serialize(generator, mapper); } - if (this.casefirst != null) { - generator.writeKey("caseFirst"); - this.casefirst.serialize(generator, mapper); + if (this.caseFirst != null) { + generator.writeKey("case_first"); + this.caseFirst.serialize(generator, mapper); } - if (this.caselevel != null) { - generator.writeKey("caseLevel"); - generator.write(this.caselevel); + if (this.caseLevel != null) { + generator.writeKey("case_level"); + generator.write(this.caseLevel); } if (this.country != null) { @@ -247,9 +247,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("decomposition"); this.decomposition.serialize(generator, mapper); } - if (this.hiraganaquaternarymode != null) { - generator.writeKey("hiraganaQuaternaryMode"); - generator.write(this.hiraganaquaternarymode); + if (this.hiraganaQuaternaryMode != null) { + generator.writeKey("hiragana_quaternary_mode"); + generator.write(this.hiraganaQuaternaryMode); } if (this.language != null) { @@ -271,9 +271,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("strength"); this.strength.serialize(generator, mapper); } - if (this.variabletop != null) { - generator.writeKey("variableTop"); - generator.write(this.variabletop); + if (this.variableTop != null) { + generator.writeKey("variable_top"); + generator.write(this.variableTop); } if (this.variant != null) { @@ -297,10 +297,10 @@ public static class Builder extends TokenFilterBase.AbstractBuilder private IcuCollationAlternate alternate; @Nullable - private IcuCollationCaseFirst casefirst; + private IcuCollationCaseFirst caseFirst; @Nullable - private Boolean caselevel; + private Boolean caseLevel; @Nullable private String country; @@ -309,7 +309,7 @@ public static class Builder extends TokenFilterBase.AbstractBuilder private IcuCollationDecomposition decomposition; @Nullable - private Boolean hiraganaquaternarymode; + private Boolean hiraganaQuaternaryMode; @Nullable private String language; @@ -324,7 +324,7 @@ public static class Builder extends TokenFilterBase.AbstractBuilder private IcuCollationStrength strength; @Nullable - private String variabletop; + private String variableTop; @Nullable private String variant; @@ -338,18 +338,18 @@ public final Builder alternate(@Nullable IcuCollationAlternate value) { } /** - * API name: {@code caseFirst} + * API name: {@code case_first} */ - public final Builder casefirst(@Nullable IcuCollationCaseFirst value) { - this.casefirst = value; + public final Builder caseFirst(@Nullable IcuCollationCaseFirst value) { + this.caseFirst = value; return this; } /** - * API name: {@code caseLevel} + * API name: {@code case_level} */ - public final Builder caselevel(@Nullable Boolean value) { - this.caselevel = value; + public final Builder caseLevel(@Nullable Boolean value) { + this.caseLevel = value; return this; } @@ -370,10 +370,10 @@ public final Builder decomposition(@Nullable IcuCollationDecomposition value) { } /** - * API name: {@code hiraganaQuaternaryMode} + * API name: {@code hiragana_quaternary_mode} */ - public final Builder hiraganaquaternarymode(@Nullable Boolean value) { - this.hiraganaquaternarymode = value; + public final Builder hiraganaQuaternaryMode(@Nullable Boolean value) { + this.hiraganaQuaternaryMode = value; return this; } @@ -410,10 +410,10 @@ public final Builder strength(@Nullable IcuCollationStrength value) { } /** - * API name: {@code variableTop} + * API name: {@code variable_top} */ - public final Builder variabletop(@Nullable String value) { - this.variabletop = value; + public final Builder variableTop(@Nullable String value) { + this.variableTop = value; return this; } @@ -455,16 +455,16 @@ protected static void setupIcuCollationTokenFilterDeserializer( ObjectDeserializer op) { TokenFilterBase.setupTokenFilterBaseDeserializer(op); op.add(Builder::alternate, IcuCollationAlternate._DESERIALIZER, "alternate"); - op.add(Builder::casefirst, IcuCollationCaseFirst._DESERIALIZER, "caseFirst"); - op.add(Builder::caselevel, JsonpDeserializer.booleanDeserializer(), "caseLevel"); + op.add(Builder::caseFirst, IcuCollationCaseFirst._DESERIALIZER, "case_first"); + op.add(Builder::caseLevel, JsonpDeserializer.booleanDeserializer(), "case_level"); op.add(Builder::country, JsonpDeserializer.stringDeserializer(), "country"); op.add(Builder::decomposition, IcuCollationDecomposition._DESERIALIZER, "decomposition"); - op.add(Builder::hiraganaquaternarymode, JsonpDeserializer.booleanDeserializer(), "hiraganaQuaternaryMode"); + op.add(Builder::hiraganaQuaternaryMode, JsonpDeserializer.booleanDeserializer(), "hiragana_quaternary_mode"); op.add(Builder::language, JsonpDeserializer.stringDeserializer(), "language"); op.add(Builder::numeric, JsonpDeserializer.booleanDeserializer(), "numeric"); op.add(Builder::rules, JsonpDeserializer.stringDeserializer(), "rules"); op.add(Builder::strength, IcuCollationStrength._DESERIALIZER, "strength"); - op.add(Builder::variabletop, JsonpDeserializer.stringDeserializer(), "variableTop"); + op.add(Builder::variableTop, JsonpDeserializer.stringDeserializer(), "variable_top"); op.add(Builder::variant, JsonpDeserializer.stringDeserializer(), "variant"); op.ignore("type"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/Normalizer.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/Normalizer.java index 337fca15b..cae974aa2 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/Normalizer.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/Normalizer.java @@ -57,7 +57,7 @@ /** * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/analysis-normalizers.html">Documentation * on elastic.co * @see API * specification @@ -210,7 +210,7 @@ protected static void setupNormalizerDeserializer(ObjectDeserializer op op.add(Builder::custom, CustomNormalizer._DESERIALIZER, "custom"); op.add(Builder::lowercase, LowercaseNormalizer._DESERIALIZER, "lowercase"); - op.setTypeProperty("type", null); + op.setTypeProperty("type", "custom"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SynonymGraphTokenFilter.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SynonymGraphTokenFilter.java index 18cb089e1..8ceeef281 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SynonymGraphTokenFilter.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SynonymGraphTokenFilter.java @@ -73,6 +73,9 @@ public class SynonymGraphTokenFilter extends TokenFilterBase implements TokenFil @Nullable private final String synonymsPath; + @Nullable + private final String synonymsSet; + @Nullable private final String tokenizer; @@ -89,6 +92,7 @@ private SynonymGraphTokenFilter(Builder builder) { this.lenient = builder.lenient; this.synonyms = ApiTypeHelper.unmodifiable(builder.synonyms); this.synonymsPath = builder.synonymsPath; + this.synonymsSet = builder.synonymsSet; this.tokenizer = builder.tokenizer; this.updateable = builder.updateable; @@ -145,6 +149,14 @@ public final String synonymsPath() { return this.synonymsPath; } + /** + * API name: {@code synonyms_set} + */ + @Nullable + public final String synonymsSet() { + return this.synonymsSet; + } + /** * API name: {@code tokenizer} */ @@ -193,6 +205,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("synonyms_path"); generator.write(this.synonymsPath); + } + if (this.synonymsSet != null) { + generator.writeKey("synonyms_set"); + generator.write(this.synonymsSet); + } if (this.tokenizer != null) { generator.writeKey("tokenizer"); @@ -231,6 +248,9 @@ public static class Builder extends TokenFilterBase.AbstractBuilder @Nullable private String synonymsPath; + @Nullable + private String synonymsSet; + @Nullable private String tokenizer; @@ -289,6 +309,14 @@ public final Builder synonymsPath(@Nullable String value) { return this; } + /** + * API name: {@code synonyms_set} + */ + public final Builder synonymsSet(@Nullable String value) { + this.synonymsSet = value; + return this; + } + /** * API name: {@code tokenizer} */ @@ -340,6 +368,7 @@ protected static void setupSynonymGraphTokenFilterDeserializer( op.add(Builder::synonyms, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "synonyms"); op.add(Builder::synonymsPath, JsonpDeserializer.stringDeserializer(), "synonyms_path"); + op.add(Builder::synonymsSet, JsonpDeserializer.stringDeserializer(), "synonyms_set"); op.add(Builder::tokenizer, JsonpDeserializer.stringDeserializer(), "tokenizer"); op.add(Builder::updateable, JsonpDeserializer.booleanDeserializer(), "updateable"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SynonymTokenFilter.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SynonymTokenFilter.java index 96e1aea78..f702b5cdb 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SynonymTokenFilter.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SynonymTokenFilter.java @@ -73,6 +73,9 @@ public class SynonymTokenFilter extends TokenFilterBase implements TokenFilterDe @Nullable private final String synonymsPath; + @Nullable + private final String synonymsSet; + @Nullable private final String tokenizer; @@ -89,6 +92,7 @@ private SynonymTokenFilter(Builder builder) { this.lenient = builder.lenient; this.synonyms = ApiTypeHelper.unmodifiable(builder.synonyms); this.synonymsPath = builder.synonymsPath; + this.synonymsSet = builder.synonymsSet; this.tokenizer = builder.tokenizer; this.updateable = builder.updateable; @@ -145,6 +149,14 @@ public final String synonymsPath() { return this.synonymsPath; } + /** + * API name: {@code synonyms_set} + */ + @Nullable + public final String synonymsSet() { + return this.synonymsSet; + } + /** * API name: {@code tokenizer} */ @@ -193,6 +205,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("synonyms_path"); generator.write(this.synonymsPath); + } + if (this.synonymsSet != null) { + generator.writeKey("synonyms_set"); + generator.write(this.synonymsSet); + } if (this.tokenizer != null) { generator.writeKey("tokenizer"); @@ -231,6 +248,9 @@ public static class Builder extends TokenFilterBase.AbstractBuilder @Nullable private String synonymsPath; + @Nullable + private String synonymsSet; + @Nullable private String tokenizer; @@ -289,6 +309,14 @@ public final Builder synonymsPath(@Nullable String value) { return this; } + /** + * API name: {@code synonyms_set} + */ + public final Builder synonymsSet(@Nullable String value) { + this.synonymsSet = value; + return this; + } + /** * API name: {@code tokenizer} */ @@ -339,6 +367,7 @@ protected static void setupSynonymTokenFilterDeserializer(ObjectDeserializer implements ObjectBuilder { + @Nullable + private String elementType; + @Nullable private Integer dims; @@ -174,6 +194,14 @@ public static class Builder extends PropertyBase.AbstractBuilder @Nullable private DenseVectorIndexOptions indexOptions; + /** + * API name: {@code element_type} + */ + public final Builder elementType(@Nullable String value) { + this.elementType = value; + return this; + } + /** * API name: {@code dims} */ @@ -242,6 +270,7 @@ public DenseVectorProperty build() { protected static void setupDenseVectorPropertyDeserializer(ObjectDeserializer op) { PropertyBase.setupPropertyBaseDeserializer(op); + op.add(Builder::elementType, JsonpDeserializer.stringDeserializer(), "element_type"); op.add(Builder::dims, JsonpDeserializer.integerDeserializer(), "dims"); op.add(Builder::similarity, JsonpDeserializer.stringDeserializer(), "similarity"); op.add(Builder::index, JsonpDeserializer.booleanDeserializer(), "index"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicProperty.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicProperty.java index a50c79389..e2a0b406e 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicProperty.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicProperty.java @@ -166,7 +166,7 @@ public static DynamicProperty of(Function */ @JsonpDeserializable -public class DynamicTemplate implements JsonpSerializable { - @Nullable - private final Property mapping; +public class DynamicTemplate implements TaggedUnion, JsonpSerializable { - @Nullable - private final String match; + /** + * {@link DynamicTemplate} variant kinds. + * + * @see API + * specification + */ - @Nullable - private final String matchMappingType; + public enum Kind implements JsonEnum { + Mapping("mapping"), + + Runtime("runtime"), + + ; + + private final String jsonValue; + + Kind(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + private final List match; + + private final List pathMatch; + + private final List unmatch; + + private final List pathUnmatch; + + private final List matchMappingType; + + private final List unmatchMappingType; @Nullable private final MatchType matchPattern; - @Nullable - private final String pathMatch; + public DynamicTemplate(DynamicTemplateVariant value) { - @Nullable - private final String pathUnmatch; + this._kind = ApiTypeHelper.requireNonNull(value._dynamicTemplateKind(), this, ""); + this._value = ApiTypeHelper.requireNonNull(value, this, ""); - @Nullable - private final String unmatch; + this.match = null; + this.pathMatch = null; + this.unmatch = null; + this.pathUnmatch = null; + this.matchMappingType = null; + this.unmatchMappingType = null; + this.matchPattern = null; - // --------------------------------------------------------------------------------------------- + } private DynamicTemplate(Builder builder) { - this.mapping = builder.mapping; - this.match = builder.match; - this.matchMappingType = builder.matchMappingType; + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + + this.match = ApiTypeHelper.unmodifiable(builder.match); + this.pathMatch = ApiTypeHelper.unmodifiable(builder.pathMatch); + this.unmatch = ApiTypeHelper.unmodifiable(builder.unmatch); + this.pathUnmatch = ApiTypeHelper.unmodifiable(builder.pathUnmatch); + this.matchMappingType = ApiTypeHelper.unmodifiable(builder.matchMappingType); + this.unmatchMappingType = ApiTypeHelper.unmodifiable(builder.unmatchMappingType); this.matchPattern = builder.matchPattern; - this.pathMatch = builder.pathMatch; - this.pathUnmatch = builder.pathUnmatch; - this.unmatch = builder.unmatch; } @@ -99,29 +156,47 @@ public static DynamicTemplate of(Function match() { + return this.match; } /** - * API name: {@code match} + * API name: {@code path_match} */ - @Nullable - public final String match() { - return this.match; + public final List pathMatch() { + return this.pathMatch; + } + + /** + * API name: {@code unmatch} + */ + public final List unmatch() { + return this.unmatch; + } + + /** + * API name: {@code path_unmatch} + */ + public final List pathUnmatch() { + return this.pathUnmatch; } /** * API name: {@code match_mapping_type} */ - @Nullable - public final String matchMappingType() { + public final List matchMappingType() { return this.matchMappingType; } + /** + * API name: {@code unmatch_mapping_type} + */ + public final List unmatchMappingType() { + return this.unmatchMappingType; + } + /** * API name: {@code match_pattern} */ @@ -131,74 +206,116 @@ public final MatchType matchPattern() { } /** - * API name: {@code path_match} + * Is this variant instance of kind {@code mapping}? */ - @Nullable - public final String pathMatch() { - return this.pathMatch; + public boolean isMapping() { + return _kind == Kind.Mapping; } /** - * API name: {@code path_unmatch} + * Get the {@code mapping} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code mapping} kind. */ - @Nullable - public final String pathUnmatch() { - return this.pathUnmatch; + public Property mapping() { + return TaggedUnionUtils.get(this, Kind.Mapping); } /** - * API name: {@code unmatch} + * Is this variant instance of kind {@code runtime}? */ - @Nullable - public final String unmatch() { - return this.unmatch; + public boolean isRuntime() { + return _kind == Kind.Runtime; } /** - * Serialize this object to JSON. + * Get the {@code runtime} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code runtime} kind. */ + public Property runtime() { + return TaggedUnionUtils.get(this, Kind.Runtime); + } + + @Override + @SuppressWarnings("unchecked") public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (ApiTypeHelper.isDefined(this.match)) { + generator.writeKey("match"); + generator.writeStartArray(); + for (String item0 : this.match) { + generator.write(item0); - if (this.mapping != null) { - generator.writeKey("mapping"); - this.mapping.serialize(generator, mapper); + } + generator.writeEnd(); } - if (this.match != null) { - generator.writeKey("match"); - generator.write(this.match); + if (ApiTypeHelper.isDefined(this.pathMatch)) { + generator.writeKey("path_match"); + generator.writeStartArray(); + for (String item0 : this.pathMatch) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.unmatch)) { + generator.writeKey("unmatch"); + generator.writeStartArray(); + for (String item0 : this.unmatch) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.pathUnmatch)) { + generator.writeKey("path_unmatch"); + generator.writeStartArray(); + for (String item0 : this.pathUnmatch) { + generator.write(item0); + + } + generator.writeEnd(); } - if (this.matchMappingType != null) { + if (ApiTypeHelper.isDefined(this.matchMappingType)) { generator.writeKey("match_mapping_type"); - generator.write(this.matchMappingType); + generator.writeStartArray(); + for (String item0 : this.matchMappingType) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.unmatchMappingType)) { + generator.writeKey("unmatch_mapping_type"); + generator.writeStartArray(); + for (String item0 : this.unmatchMappingType) { + generator.write(item0); + + } + generator.writeEnd(); } if (this.matchPattern != null) { generator.writeKey("match_pattern"); this.matchPattern.serialize(generator, mapper); } - if (this.pathMatch != null) { - generator.writeKey("path_match"); - generator.write(this.pathMatch); + generator.writeKey(_kind.jsonValue()); + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); } - if (this.pathUnmatch != null) { - generator.writeKey("path_unmatch"); - generator.write(this.pathUnmatch); - } - if (this.unmatch != null) { - generator.writeKey("unmatch"); - generator.write(this.unmatch); - - } + generator.writeEnd(); } @@ -207,133 +324,343 @@ public String toString() { return JsonpUtils.toString(this); } - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DynamicTemplate}. - */ - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Kind _kind; + private Object _value; + @Nullable - private Property mapping; + private List match; @Nullable - private String match; + private List pathMatch; @Nullable - private String matchMappingType; + private List unmatch; @Nullable - private MatchType matchPattern; + private List pathUnmatch; @Nullable - private String pathMatch; + private List matchMappingType; @Nullable - private String pathUnmatch; + private List unmatchMappingType; @Nullable - private String unmatch; + private MatchType matchPattern; /** - * API name: {@code mapping} + * API name: {@code match} + *

+ * Adds all elements of list to match. */ - public final Builder mapping(@Nullable Property value) { - this.mapping = value; + public final Builder match(List list) { + this.match = _listAddAll(this.match, list); return this; } /** - * API name: {@code mapping} + * API name: {@code match} + *

+ * Adds one or more values to match. */ - public final Builder mapping(Function> fn) { - return this.mapping(fn.apply(new Property.Builder()).build()); + public final Builder match(String value, String... values) { + this.match = _listAdd(this.match, value, values); + return this; } /** - * API name: {@code match} + * API name: {@code path_match} + *

+ * Adds all elements of list to pathMatch. */ - public final Builder match(@Nullable String value) { - this.match = value; + public final Builder pathMatch(List list) { + this.pathMatch = _listAddAll(this.pathMatch, list); return this; } /** - * API name: {@code match_mapping_type} + * API name: {@code path_match} + *

+ * Adds one or more values to pathMatch. */ - public final Builder matchMappingType(@Nullable String value) { - this.matchMappingType = value; + public final Builder pathMatch(String value, String... values) { + this.pathMatch = _listAdd(this.pathMatch, value, values); return this; } /** - * API name: {@code match_pattern} + * API name: {@code unmatch} + *

+ * Adds all elements of list to unmatch. */ - public final Builder matchPattern(@Nullable MatchType value) { - this.matchPattern = value; + public final Builder unmatch(List list) { + this.unmatch = _listAddAll(this.unmatch, list); return this; } /** - * API name: {@code path_match} + * API name: {@code unmatch} + *

+ * Adds one or more values to unmatch. */ - public final Builder pathMatch(@Nullable String value) { - this.pathMatch = value; + public final Builder unmatch(String value, String... values) { + this.unmatch = _listAdd(this.unmatch, value, values); return this; } /** * API name: {@code path_unmatch} + *

+ * Adds all elements of list to pathUnmatch. */ - public final Builder pathUnmatch(@Nullable String value) { - this.pathUnmatch = value; + public final Builder pathUnmatch(List list) { + this.pathUnmatch = _listAddAll(this.pathUnmatch, list); return this; } /** - * API name: {@code unmatch} + * API name: {@code path_unmatch} + *

+ * Adds one or more values to pathUnmatch. */ - public final Builder unmatch(@Nullable String value) { - this.unmatch = value; + public final Builder pathUnmatch(String value, String... values) { + this.pathUnmatch = _listAdd(this.pathUnmatch, value, values); return this; } - @Override - protected Builder self() { + /** + * API name: {@code match_mapping_type} + *

+ * Adds all elements of list to matchMappingType. + */ + public final Builder matchMappingType(List list) { + this.matchMappingType = _listAddAll(this.matchMappingType, list); return this; } /** - * Builds a {@link DynamicTemplate}. - * - * @throws NullPointerException - * if some of the required fields are null. + * API name: {@code match_mapping_type} + *

+ * Adds one or more values to matchMappingType. */ + public final Builder matchMappingType(String value, String... values) { + this.matchMappingType = _listAdd(this.matchMappingType, value, values); + return this; + } + + /** + * API name: {@code unmatch_mapping_type} + *

+ * Adds all elements of list to unmatchMappingType. + */ + public final Builder unmatchMappingType(List list) { + this.unmatchMappingType = _listAddAll(this.unmatchMappingType, list); + return this; + } + + /** + * API name: {@code unmatch_mapping_type} + *

+ * Adds one or more values to unmatchMappingType. + */ + public final Builder unmatchMappingType(String value, String... values) { + this.unmatchMappingType = _listAdd(this.unmatchMappingType, value, values); + return this; + } + + /** + * API name: {@code match_pattern} + */ + public final Builder matchPattern(@Nullable MatchType value) { + this.matchPattern = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + public ContainerBuilder mapping(Property v) { + this._kind = Kind.Mapping; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder mapping(Function> fn) { + return this.mapping(fn.apply(new Property.Builder()).build()); + } + + public ContainerBuilder runtime(Property v) { + this._kind = Kind.Runtime; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder runtime(Function> fn) { + return this.runtime(fn.apply(new Property.Builder()).build()); + } + public DynamicTemplate build() { _checkSingleUse(); - return new DynamicTemplate(this); } - } - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DynamicTemplate} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - DynamicTemplate::setupDynamicTemplateDeserializer); + public class ContainerBuilder implements ObjectBuilder { + + /** + * API name: {@code match} + *

+ * Adds all elements of list to match. + */ + public final ContainerBuilder match(List list) { + Builder.this.match = _listAddAll(Builder.this.match, list); + return this; + } + + /** + * API name: {@code match} + *

+ * Adds one or more values to match. + */ + public final ContainerBuilder match(String value, String... values) { + Builder.this.match = _listAdd(Builder.this.match, value, values); + return this; + } + + /** + * API name: {@code path_match} + *

+ * Adds all elements of list to pathMatch. + */ + public final ContainerBuilder pathMatch(List list) { + Builder.this.pathMatch = _listAddAll(Builder.this.pathMatch, list); + return this; + } + + /** + * API name: {@code path_match} + *

+ * Adds one or more values to pathMatch. + */ + public final ContainerBuilder pathMatch(String value, String... values) { + Builder.this.pathMatch = _listAdd(Builder.this.pathMatch, value, values); + return this; + } + + /** + * API name: {@code unmatch} + *

+ * Adds all elements of list to unmatch. + */ + public final ContainerBuilder unmatch(List list) { + Builder.this.unmatch = _listAddAll(Builder.this.unmatch, list); + return this; + } + + /** + * API name: {@code unmatch} + *

+ * Adds one or more values to unmatch. + */ + public final ContainerBuilder unmatch(String value, String... values) { + Builder.this.unmatch = _listAdd(Builder.this.unmatch, value, values); + return this; + } + + /** + * API name: {@code path_unmatch} + *

+ * Adds all elements of list to pathUnmatch. + */ + public final ContainerBuilder pathUnmatch(List list) { + Builder.this.pathUnmatch = _listAddAll(Builder.this.pathUnmatch, list); + return this; + } + + /** + * API name: {@code path_unmatch} + *

+ * Adds one or more values to pathUnmatch. + */ + public final ContainerBuilder pathUnmatch(String value, String... values) { + Builder.this.pathUnmatch = _listAdd(Builder.this.pathUnmatch, value, values); + return this; + } + + /** + * API name: {@code match_mapping_type} + *

+ * Adds all elements of list to matchMappingType. + */ + public final ContainerBuilder matchMappingType(List list) { + Builder.this.matchMappingType = _listAddAll(Builder.this.matchMappingType, list); + return this; + } + + /** + * API name: {@code match_mapping_type} + *

+ * Adds one or more values to matchMappingType. + */ + public final ContainerBuilder matchMappingType(String value, String... values) { + Builder.this.matchMappingType = _listAdd(Builder.this.matchMappingType, value, values); + return this; + } + + /** + * API name: {@code unmatch_mapping_type} + *

+ * Adds all elements of list to unmatchMappingType. + */ + public final ContainerBuilder unmatchMappingType(List list) { + Builder.this.unmatchMappingType = _listAddAll(Builder.this.unmatchMappingType, list); + return this; + } + + /** + * API name: {@code unmatch_mapping_type} + *

+ * Adds one or more values to unmatchMappingType. + */ + public final ContainerBuilder unmatchMappingType(String value, String... values) { + Builder.this.unmatchMappingType = _listAdd(Builder.this.unmatchMappingType, value, values); + return this; + } + + /** + * API name: {@code match_pattern} + */ + public final ContainerBuilder matchPattern(@Nullable MatchType value) { + Builder.this.matchPattern = value; + return this; + } + + public DynamicTemplate build() { + return Builder.this.build(); + } + } + } - protected static void setupDynamicTemplateDeserializer(ObjectDeserializer op) { + protected static void setupDynamicTemplateDeserializer(ObjectDeserializer op) { op.add(Builder::mapping, Property._DESERIALIZER, "mapping"); - op.add(Builder::match, JsonpDeserializer.stringDeserializer(), "match"); - op.add(Builder::matchMappingType, JsonpDeserializer.stringDeserializer(), "match_mapping_type"); + op.add(Builder::runtime, Property._DESERIALIZER, "runtime"); + op.add(Builder::match, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "match"); + op.add(Builder::pathMatch, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "path_match"); + op.add(Builder::unmatch, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "unmatch"); + op.add(Builder::pathUnmatch, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "path_unmatch"); + op.add(Builder::matchMappingType, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "match_mapping_type"); + op.add(Builder::unmatchMappingType, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "unmatch_mapping_type"); op.add(Builder::matchPattern, MatchType._DESERIALIZER, "match_pattern"); - op.add(Builder::pathMatch, JsonpDeserializer.stringDeserializer(), "path_match"); - op.add(Builder::pathUnmatch, JsonpDeserializer.stringDeserializer(), "path_unmatch"); - op.add(Builder::unmatch, JsonpDeserializer.stringDeserializer(), "unmatch"); } + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + DynamicTemplate::setupDynamicTemplateDeserializer, Builder::build); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicTemplateBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicTemplateBuilders.java new file mode 100644 index 000000000..0096d77f0 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicTemplateBuilders.java @@ -0,0 +1,83 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types.mapping; + +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Builders for {@link DynamicTemplate} variants. + */ +public class DynamicTemplateBuilders { + private DynamicTemplateBuilders() { + } + + /** + * Creates a builder for the {@link Property mapping} {@code DynamicTemplate} + * variant. + */ + public static Property.Builder mapping() { + return new Property.Builder(); + } + + /** + * Creates a DynamicTemplate of the {@link Property mapping} + * {@code DynamicTemplate} variant. + */ + public static DynamicTemplate mapping(Function> fn) { + DynamicTemplate.Builder builder = new DynamicTemplate.Builder(); + builder.mapping(fn.apply(new Property.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link Property runtime} {@code DynamicTemplate} + * variant. + */ + public static Property.Builder runtime() { + return new Property.Builder(); + } + + /** + * Creates a DynamicTemplate of the {@link Property runtime} + * {@code DynamicTemplate} variant. + */ + public static DynamicTemplate runtime(Function> fn) { + DynamicTemplate.Builder builder = new DynamicTemplate.Builder(); + builder.runtime(fn.apply(new Property.Builder()).build()); + return builder.build(); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicTemplateVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicTemplateVariant.java new file mode 100644 index 000000000..553a5b4ef --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicTemplateVariant.java @@ -0,0 +1,48 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types.mapping; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Base interface for {@link DynamicTemplate} variants. + */ +public interface DynamicTemplateVariant { + + DynamicTemplate.Kind _dynamicTemplateKind(); + + default DynamicTemplate _toDynamicTemplate() { + return new DynamicTemplate(this); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/FieldType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/FieldType.java index 6a42418aa..37c4734c7 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/FieldType.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/FieldType.java @@ -73,6 +73,8 @@ public enum FieldType implements JsonEnum { Object("object"), + Version("version"), + Murmur3("murmur3"), TokenCount("token_count"), @@ -127,10 +129,14 @@ public enum FieldType implements JsonEnum { DenseVector("dense_vector"), + SemanticText("semantic_text"), + SparseVector("sparse_vector"), MatchOnlyText("match_only_text"), + IcuCollationKeyword("icu_collation_keyword"), + ; private final String jsonValue; diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/GeoShapeProperty.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/GeoShapeProperty.java index 20b4bf77a..f113f8b18 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/GeoShapeProperty.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/GeoShapeProperty.java @@ -53,7 +53,7 @@ * searching with arbitrary geo shapes such as rectangles and polygons. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/geo-shape.html">Documentation * on elastic.co * @see API diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/IcuCollationProperty.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/IcuCollationProperty.java new file mode 100644 index 000000000..a4c839f18 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/IcuCollationProperty.java @@ -0,0 +1,601 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types.mapping; + +import co.elastic.clients.elasticsearch._types.analysis.IcuCollationAlternate; +import co.elastic.clients.elasticsearch._types.analysis.IcuCollationCaseFirst; +import co.elastic.clients.elasticsearch._types.analysis.IcuCollationDecomposition; +import co.elastic.clients.elasticsearch._types.analysis.IcuCollationStrength; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.mapping.IcuCollationProperty + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IcuCollationProperty extends DocValuesPropertyBase implements PropertyVariant { + @Nullable + private final Boolean norms; + + @Nullable + private final IndexOptions indexOptions; + + @Nullable + private final Boolean index; + + @Nullable + private final String nullValue; + + @Nullable + private final String rules; + + @Nullable + private final String language; + + @Nullable + private final String country; + + @Nullable + private final String variant; + + @Nullable + private final IcuCollationStrength strength; + + @Nullable + private final IcuCollationDecomposition decomposition; + + @Nullable + private final IcuCollationAlternate alternate; + + @Nullable + private final Boolean caseLevel; + + @Nullable + private final IcuCollationCaseFirst caseFirst; + + @Nullable + private final Boolean numeric; + + @Nullable + private final String variableTop; + + @Nullable + private final Boolean hiraganaQuaternaryMode; + + // --------------------------------------------------------------------------------------------- + + private IcuCollationProperty(Builder builder) { + super(builder); + + this.norms = builder.norms; + this.indexOptions = builder.indexOptions; + this.index = builder.index; + this.nullValue = builder.nullValue; + this.rules = builder.rules; + this.language = builder.language; + this.country = builder.country; + this.variant = builder.variant; + this.strength = builder.strength; + this.decomposition = builder.decomposition; + this.alternate = builder.alternate; + this.caseLevel = builder.caseLevel; + this.caseFirst = builder.caseFirst; + this.numeric = builder.numeric; + this.variableTop = builder.variableTop; + this.hiraganaQuaternaryMode = builder.hiraganaQuaternaryMode; + + } + + public static IcuCollationProperty of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Property variant kind. + */ + @Override + public Property.Kind _propertyKind() { + return Property.Kind.IcuCollationKeyword; + } + + /** + * API name: {@code norms} + */ + @Nullable + public final Boolean norms() { + return this.norms; + } + + /** + * API name: {@code index_options} + */ + @Nullable + public final IndexOptions indexOptions() { + return this.indexOptions; + } + + /** + * Should the field be searchable? + *

+ * API name: {@code index} + */ + @Nullable + public final Boolean index() { + return this.index; + } + + /** + * Accepts a string value which is substituted for any explicit null values. + * Defaults to null, which means the field is treated as missing. + *

+ * API name: {@code null_value} + */ + @Nullable + public final String nullValue() { + return this.nullValue; + } + + /** + * API name: {@code rules} + */ + @Nullable + public final String rules() { + return this.rules; + } + + /** + * API name: {@code language} + */ + @Nullable + public final String language() { + return this.language; + } + + /** + * API name: {@code country} + */ + @Nullable + public final String country() { + return this.country; + } + + /** + * API name: {@code variant} + */ + @Nullable + public final String variant() { + return this.variant; + } + + /** + * API name: {@code strength} + */ + @Nullable + public final IcuCollationStrength strength() { + return this.strength; + } + + /** + * API name: {@code decomposition} + */ + @Nullable + public final IcuCollationDecomposition decomposition() { + return this.decomposition; + } + + /** + * API name: {@code alternate} + */ + @Nullable + public final IcuCollationAlternate alternate() { + return this.alternate; + } + + /** + * API name: {@code case_level} + */ + @Nullable + public final Boolean caseLevel() { + return this.caseLevel; + } + + /** + * API name: {@code case_first} + */ + @Nullable + public final IcuCollationCaseFirst caseFirst() { + return this.caseFirst; + } + + /** + * API name: {@code numeric} + */ + @Nullable + public final Boolean numeric() { + return this.numeric; + } + + /** + * API name: {@code variable_top} + */ + @Nullable + public final String variableTop() { + return this.variableTop; + } + + /** + * API name: {@code hiragana_quaternary_mode} + */ + @Nullable + public final Boolean hiraganaQuaternaryMode() { + return this.hiraganaQuaternaryMode; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "icu_collation_keyword"); + super.serializeInternal(generator, mapper); + if (this.norms != null) { + generator.writeKey("norms"); + generator.write(this.norms); + + } + if (this.indexOptions != null) { + generator.writeKey("index_options"); + this.indexOptions.serialize(generator, mapper); + } + if (this.index != null) { + generator.writeKey("index"); + generator.write(this.index); + + } + if (this.nullValue != null) { + generator.writeKey("null_value"); + generator.write(this.nullValue); + + } + if (this.rules != null) { + generator.writeKey("rules"); + generator.write(this.rules); + + } + if (this.language != null) { + generator.writeKey("language"); + generator.write(this.language); + + } + if (this.country != null) { + generator.writeKey("country"); + generator.write(this.country); + + } + if (this.variant != null) { + generator.writeKey("variant"); + generator.write(this.variant); + + } + if (this.strength != null) { + generator.writeKey("strength"); + this.strength.serialize(generator, mapper); + } + if (this.decomposition != null) { + generator.writeKey("decomposition"); + this.decomposition.serialize(generator, mapper); + } + if (this.alternate != null) { + generator.writeKey("alternate"); + this.alternate.serialize(generator, mapper); + } + if (this.caseLevel != null) { + generator.writeKey("case_level"); + generator.write(this.caseLevel); + + } + if (this.caseFirst != null) { + generator.writeKey("case_first"); + this.caseFirst.serialize(generator, mapper); + } + if (this.numeric != null) { + generator.writeKey("numeric"); + generator.write(this.numeric); + + } + if (this.variableTop != null) { + generator.writeKey("variable_top"); + generator.write(this.variableTop); + + } + if (this.hiraganaQuaternaryMode != null) { + generator.writeKey("hiragana_quaternary_mode"); + generator.write(this.hiraganaQuaternaryMode); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IcuCollationProperty}. + */ + + public static class Builder extends DocValuesPropertyBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean norms; + + @Nullable + private IndexOptions indexOptions; + + @Nullable + private Boolean index; + + @Nullable + private String nullValue; + + @Nullable + private String rules; + + @Nullable + private String language; + + @Nullable + private String country; + + @Nullable + private String variant; + + @Nullable + private IcuCollationStrength strength; + + @Nullable + private IcuCollationDecomposition decomposition; + + @Nullable + private IcuCollationAlternate alternate; + + @Nullable + private Boolean caseLevel; + + @Nullable + private IcuCollationCaseFirst caseFirst; + + @Nullable + private Boolean numeric; + + @Nullable + private String variableTop; + + @Nullable + private Boolean hiraganaQuaternaryMode; + + /** + * API name: {@code norms} + */ + public final Builder norms(@Nullable Boolean value) { + this.norms = value; + return this; + } + + /** + * API name: {@code index_options} + */ + public final Builder indexOptions(@Nullable IndexOptions value) { + this.indexOptions = value; + return this; + } + + /** + * Should the field be searchable? + *

+ * API name: {@code index} + */ + public final Builder index(@Nullable Boolean value) { + this.index = value; + return this; + } + + /** + * Accepts a string value which is substituted for any explicit null values. + * Defaults to null, which means the field is treated as missing. + *

+ * API name: {@code null_value} + */ + public final Builder nullValue(@Nullable String value) { + this.nullValue = value; + return this; + } + + /** + * API name: {@code rules} + */ + public final Builder rules(@Nullable String value) { + this.rules = value; + return this; + } + + /** + * API name: {@code language} + */ + public final Builder language(@Nullable String value) { + this.language = value; + return this; + } + + /** + * API name: {@code country} + */ + public final Builder country(@Nullable String value) { + this.country = value; + return this; + } + + /** + * API name: {@code variant} + */ + public final Builder variant(@Nullable String value) { + this.variant = value; + return this; + } + + /** + * API name: {@code strength} + */ + public final Builder strength(@Nullable IcuCollationStrength value) { + this.strength = value; + return this; + } + + /** + * API name: {@code decomposition} + */ + public final Builder decomposition(@Nullable IcuCollationDecomposition value) { + this.decomposition = value; + return this; + } + + /** + * API name: {@code alternate} + */ + public final Builder alternate(@Nullable IcuCollationAlternate value) { + this.alternate = value; + return this; + } + + /** + * API name: {@code case_level} + */ + public final Builder caseLevel(@Nullable Boolean value) { + this.caseLevel = value; + return this; + } + + /** + * API name: {@code case_first} + */ + public final Builder caseFirst(@Nullable IcuCollationCaseFirst value) { + this.caseFirst = value; + return this; + } + + /** + * API name: {@code numeric} + */ + public final Builder numeric(@Nullable Boolean value) { + this.numeric = value; + return this; + } + + /** + * API name: {@code variable_top} + */ + public final Builder variableTop(@Nullable String value) { + this.variableTop = value; + return this; + } + + /** + * API name: {@code hiragana_quaternary_mode} + */ + public final Builder hiraganaQuaternaryMode(@Nullable Boolean value) { + this.hiraganaQuaternaryMode = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IcuCollationProperty}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IcuCollationProperty build() { + _checkSingleUse(); + + return new IcuCollationProperty(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IcuCollationProperty} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IcuCollationProperty::setupIcuCollationPropertyDeserializer); + + protected static void setupIcuCollationPropertyDeserializer(ObjectDeserializer op) { + DocValuesPropertyBase.setupDocValuesPropertyBaseDeserializer(op); + op.add(Builder::norms, JsonpDeserializer.booleanDeserializer(), "norms"); + op.add(Builder::indexOptions, IndexOptions._DESERIALIZER, "index_options"); + op.add(Builder::index, JsonpDeserializer.booleanDeserializer(), "index"); + op.add(Builder::nullValue, JsonpDeserializer.stringDeserializer(), "null_value"); + op.add(Builder::rules, JsonpDeserializer.stringDeserializer(), "rules"); + op.add(Builder::language, JsonpDeserializer.stringDeserializer(), "language"); + op.add(Builder::country, JsonpDeserializer.stringDeserializer(), "country"); + op.add(Builder::variant, JsonpDeserializer.stringDeserializer(), "variant"); + op.add(Builder::strength, IcuCollationStrength._DESERIALIZER, "strength"); + op.add(Builder::decomposition, IcuCollationDecomposition._DESERIALIZER, "decomposition"); + op.add(Builder::alternate, IcuCollationAlternate._DESERIALIZER, "alternate"); + op.add(Builder::caseLevel, JsonpDeserializer.booleanDeserializer(), "case_level"); + op.add(Builder::caseFirst, IcuCollationCaseFirst._DESERIALIZER, "case_first"); + op.add(Builder::numeric, JsonpDeserializer.booleanDeserializer(), "numeric"); + op.add(Builder::variableTop, JsonpDeserializer.stringDeserializer(), "variable_top"); + op.add(Builder::hiraganaQuaternaryMode, JsonpDeserializer.booleanDeserializer(), "hiragana_quaternary_mode"); + + op.ignore("type"); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/KeywordProperty.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/KeywordProperty.java index 1442a3279..022376e1c 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/KeywordProperty.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/KeywordProperty.java @@ -19,6 +19,7 @@ package co.elastic.clients.elasticsearch._types.mapping; +import co.elastic.clients.elasticsearch._types.Script; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -70,6 +71,12 @@ public class KeywordProperty extends DocValuesPropertyBase implements PropertyVa @Nullable private final IndexOptions indexOptions; + @Nullable + private final Script script; + + @Nullable + private final OnScriptError onScriptError; + @Nullable private final String normalizer; @@ -94,6 +101,8 @@ private KeywordProperty(Builder builder) { this.eagerGlobalOrdinals = builder.eagerGlobalOrdinals; this.index = builder.index; this.indexOptions = builder.indexOptions; + this.script = builder.script; + this.onScriptError = builder.onScriptError; this.normalizer = builder.normalizer; this.norms = builder.norms; this.nullValue = builder.nullValue; @@ -146,6 +155,22 @@ public final IndexOptions indexOptions() { return this.indexOptions; } + /** + * API name: {@code script} + */ + @Nullable + public final Script script() { + return this.script; + } + + /** + * API name: {@code on_script_error} + */ + @Nullable + public final OnScriptError onScriptError() { + return this.onScriptError; + } + /** * API name: {@code normalizer} */ @@ -212,6 +237,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("index_options"); this.indexOptions.serialize(generator, mapper); } + if (this.script != null) { + generator.writeKey("script"); + this.script.serialize(generator, mapper); + + } + if (this.onScriptError != null) { + generator.writeKey("on_script_error"); + this.onScriptError.serialize(generator, mapper); + } if (this.normalizer != null) { generator.writeKey("normalizer"); generator.write(this.normalizer); @@ -261,6 +295,12 @@ public static class Builder extends DocValuesPropertyBase.AbstractBuilder> fn) { + return this.script(fn.apply(new Script.Builder()).build()); + } + + /** + * API name: {@code on_script_error} + */ + public final Builder onScriptError(@Nullable OnScriptError value) { + this.onScriptError = value; + return this; + } + /** * API name: {@code normalizer} */ @@ -383,6 +446,8 @@ protected static void setupKeywordPropertyDeserializer(ObjectDeserializer @Nullable private Boolean enabled; + @Nullable + private Boolean subobjects; + /** * API name: {@code enabled} */ @@ -120,6 +140,14 @@ public final Builder enabled(@Nullable Boolean value) { return this; } + /** + * API name: {@code subobjects} + */ + public final Builder subobjects(@Nullable Boolean value) { + this.subobjects = value; + return this; + } + @Override protected Builder self() { return this; @@ -149,6 +177,7 @@ public ObjectProperty build() { protected static void setupObjectPropertyDeserializer(ObjectDeserializer op) { CorePropertyBase.setupCorePropertyBaseDeserializer(op); op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); + op.add(Builder::subobjects, JsonpDeserializer.booleanDeserializer(), "subobjects"); op.ignore("type"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/Property.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/Property.java index 327e9fad0..9e2cf94a5 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/Property.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/Property.java @@ -96,7 +96,7 @@ public enum Kind implements JsonEnum { DoubleRange("double_range"), - DynamicProperty("{dynamic_property}"), + DynamicType("{dynamic_type}"), Alias("alias"), @@ -114,6 +114,8 @@ public enum Kind implements JsonEnum { Histogram("histogram"), + IcuCollationKeyword("icu_collation_keyword"), + Integer("integer"), IntegerRange("integer_range"), @@ -150,6 +152,8 @@ public enum Kind implements JsonEnum { SearchAsYouType("search_as_you_type"), + SemanticText("semantic_text"), + Shape("shape"), Short("short"), @@ -433,21 +437,20 @@ public DoubleRangeProperty doubleRange() { } /** - * Is this variant instance of kind {@code {dynamic_property}}? + * Is this variant instance of kind {@code {dynamic_type}}? */ - public boolean isDynamicProperty() { - return _kind == Kind.DynamicProperty; + public boolean isDynamicType() { + return _kind == Kind.DynamicType; } /** - * Get the {@code {dynamic_property}} variant value. + * Get the {@code {dynamic_type}} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code {dynamic_property}} - * kind. + * if the current variant is not of the {@code {dynamic_type}} kind. */ - public DynamicProperty dynamicProperty() { - return TaggedUnionUtils.get(this, Kind.DynamicProperty); + public DynamicProperty dynamicType() { + return TaggedUnionUtils.get(this, Kind.DynamicType); } /** @@ -586,6 +589,24 @@ public HistogramProperty histogram() { return TaggedUnionUtils.get(this, Kind.Histogram); } + /** + * Is this variant instance of kind {@code icu_collation_keyword}? + */ + public boolean isIcuCollationKeyword() { + return _kind == Kind.IcuCollationKeyword; + } + + /** + * Get the {@code icu_collation_keyword} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the + * {@code icu_collation_keyword} kind. + */ + public IcuCollationProperty icuCollationKeyword() { + return TaggedUnionUtils.get(this, Kind.IcuCollationKeyword); + } + /** * Is this variant instance of kind {@code integer}? */ @@ -894,6 +915,23 @@ public SearchAsYouTypeProperty searchAsYouType() { return TaggedUnionUtils.get(this, Kind.SearchAsYouType); } + /** + * Is this variant instance of kind {@code semantic_text}? + */ + public boolean isSemanticText() { + return _kind == Kind.SemanticText; + } + + /** + * Get the {@code semantic_text} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code semantic_text} kind. + */ + public SemanticTextProperty semanticText() { + return TaggedUnionUtils.get(this, Kind.SemanticText); + } + /** * Is this variant instance of kind {@code shape}? */ @@ -1209,15 +1247,15 @@ public ObjectBuilder doubleRange( return this.doubleRange(fn.apply(new DoubleRangeProperty.Builder()).build()); } - public ObjectBuilder dynamicProperty(DynamicProperty v) { - this._kind = Kind.DynamicProperty; + public ObjectBuilder dynamicType(DynamicProperty v) { + this._kind = Kind.DynamicType; this._value = v; return this; } - public ObjectBuilder dynamicProperty( + public ObjectBuilder dynamicType( Function> fn) { - return this.dynamicProperty(fn.apply(new DynamicProperty.Builder()).build()); + return this.dynamicType(fn.apply(new DynamicProperty.Builder()).build()); } public ObjectBuilder alias(FieldAliasProperty v) { @@ -1308,6 +1346,17 @@ public ObjectBuilder histogram( return this.histogram(fn.apply(new HistogramProperty.Builder()).build()); } + public ObjectBuilder icuCollationKeyword(IcuCollationProperty v) { + this._kind = Kind.IcuCollationKeyword; + this._value = v; + return this; + } + + public ObjectBuilder icuCollationKeyword( + Function> fn) { + return this.icuCollationKeyword(fn.apply(new IcuCollationProperty.Builder()).build()); + } + public ObjectBuilder integer(IntegerNumberProperty v) { this._kind = Kind.Integer; this._value = v; @@ -1499,6 +1548,17 @@ public ObjectBuilder searchAsYouType( return this.searchAsYouType(fn.apply(new SearchAsYouTypeProperty.Builder()).build()); } + public ObjectBuilder semanticText(SemanticTextProperty v) { + this._kind = Kind.SemanticText; + this._value = v; + return this; + } + + public ObjectBuilder semanticText( + Function> fn) { + return this.semanticText(fn.apply(new SemanticTextProperty.Builder()).build()); + } + public ObjectBuilder shape(ShapeProperty v) { this._kind = Kind.Shape; this._value = v; @@ -1621,7 +1681,7 @@ protected static void setupPropertyDeserializer(ObjectDeserializer op) op.add(Builder::denseVector, DenseVectorProperty._DESERIALIZER, "dense_vector"); op.add(Builder::double_, DoubleNumberProperty._DESERIALIZER, "double"); op.add(Builder::doubleRange, DoubleRangeProperty._DESERIALIZER, "double_range"); - op.add(Builder::dynamicProperty, DynamicProperty._DESERIALIZER, "{dynamic_property}"); + op.add(Builder::dynamicType, DynamicProperty._DESERIALIZER, "{dynamic_type}"); op.add(Builder::alias, FieldAliasProperty._DESERIALIZER, "alias"); op.add(Builder::flattened, FlattenedProperty._DESERIALIZER, "flattened"); op.add(Builder::float_, FloatNumberProperty._DESERIALIZER, "float"); @@ -1630,6 +1690,7 @@ protected static void setupPropertyDeserializer(ObjectDeserializer op) op.add(Builder::geoShape, GeoShapeProperty._DESERIALIZER, "geo_shape"); op.add(Builder::halfFloat, HalfFloatNumberProperty._DESERIALIZER, "half_float"); op.add(Builder::histogram, HistogramProperty._DESERIALIZER, "histogram"); + op.add(Builder::icuCollationKeyword, IcuCollationProperty._DESERIALIZER, "icu_collation_keyword"); op.add(Builder::integer, IntegerNumberProperty._DESERIALIZER, "integer"); op.add(Builder::integerRange, IntegerRangeProperty._DESERIALIZER, "integer_range"); op.add(Builder::ip, IpProperty._DESERIALIZER, "ip"); @@ -1648,6 +1709,7 @@ protected static void setupPropertyDeserializer(ObjectDeserializer op) op.add(Builder::rankFeatures, RankFeaturesProperty._DESERIALIZER, "rank_features"); op.add(Builder::scaledFloat, ScaledFloatNumberProperty._DESERIALIZER, "scaled_float"); op.add(Builder::searchAsYouType, SearchAsYouTypeProperty._DESERIALIZER, "search_as_you_type"); + op.add(Builder::semanticText, SemanticTextProperty._DESERIALIZER, "semantic_text"); op.add(Builder::shape, ShapeProperty._DESERIALIZER, "shape"); op.add(Builder::short_, ShortNumberProperty._DESERIALIZER, "short"); op.add(Builder::sparseVector, SparseVectorProperty._DESERIALIZER, "sparse_vector"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBuilders.java index 0c2a12553..d77526ab1 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBuilders.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBuilders.java @@ -261,20 +261,20 @@ public static Property doubleRange(Function> fn) { + public static Property dynamicType(Function> fn) { Property.Builder builder = new Property.Builder(); - builder.dynamicProperty(fn.apply(new DynamicProperty.Builder()).build()); + builder.dynamicType(fn.apply(new DynamicProperty.Builder()).build()); return builder.build(); } @@ -423,6 +423,25 @@ public static Property histogram(Function> fn) { + Property.Builder builder = new Property.Builder(); + builder.icuCollationKeyword(fn.apply(new IcuCollationProperty.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link IntegerNumberProperty integer} * {@code Property} variant. @@ -748,6 +767,25 @@ public static Property searchAsYouType( return builder.build(); } + /** + * Creates a builder for the {@link SemanticTextProperty semantic_text} + * {@code Property} variant. + */ + public static SemanticTextProperty.Builder semanticText() { + return new SemanticTextProperty.Builder(); + } + + /** + * Creates a Property of the {@link SemanticTextProperty semantic_text} + * {@code Property} variant. + */ + public static Property semanticText( + Function> fn) { + Property.Builder builder = new Property.Builder(); + builder.semanticText(fn.apply(new SemanticTextProperty.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link ShapeProperty shape} {@code Property} * variant. diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RuntimeFieldType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RuntimeFieldType.java index d483387ae..f845209a2 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RuntimeFieldType.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RuntimeFieldType.java @@ -48,6 +48,8 @@ public enum RuntimeFieldType implements JsonEnum { Boolean("boolean"), + Composite("composite"), + Date("date"), Double("double"), diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SemanticTextProperty.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SemanticTextProperty.java new file mode 100644 index 000000000..38223450d --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SemanticTextProperty.java @@ -0,0 +1,213 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types.mapping; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.mapping.SemanticTextProperty + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SemanticTextProperty implements PropertyVariant, JsonpSerializable { + private final Map meta; + + private final String inferenceId; + + // --------------------------------------------------------------------------------------------- + + private SemanticTextProperty(Builder builder) { + + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.inferenceId = ApiTypeHelper.requireNonNull(builder.inferenceId, this, "inferenceId"); + + } + + public static SemanticTextProperty of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Property variant kind. + */ + @Override + public Property.Kind _propertyKind() { + return Property.Kind.SemanticText; + } + + /** + * API name: {@code meta} + */ + public final Map meta() { + return this.meta; + } + + /** + * Required - API name: {@code inference_id} + */ + public final String inferenceId() { + return this.inferenceId; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "semantic_text"); + + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + generator.write(item0.getValue()); + + } + generator.writeEnd(); + + } + generator.writeKey("inference_id"); + generator.write(this.inferenceId); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SemanticTextProperty}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Map meta; + + private String inferenceId; + + /** + * API name: {@code meta} + *

+ * Adds all entries of map to meta. + */ + public final Builder meta(Map map) { + this.meta = _mapPutAll(this.meta, map); + return this; + } + + /** + * API name: {@code meta} + *

+ * Adds an entry to meta. + */ + public final Builder meta(String key, String value) { + this.meta = _mapPut(this.meta, key, value); + return this; + } + + /** + * Required - API name: {@code inference_id} + */ + public final Builder inferenceId(String value) { + this.inferenceId = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SemanticTextProperty}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SemanticTextProperty build() { + _checkSingleUse(); + + return new SemanticTextProperty(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SemanticTextProperty} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SemanticTextProperty::setupSemanticTextPropertyDeserializer); + + protected static void setupSemanticTextPropertyDeserializer(ObjectDeserializer op) { + + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), "meta"); + op.add(Builder::inferenceId, JsonpDeserializer.stringDeserializer(), "inference_id"); + + op.ignore("type"); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ShapeProperty.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ShapeProperty.java index 8ca8d0b29..38abe417e 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ShapeProperty.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ShapeProperty.java @@ -54,7 +54,7 @@ * polygons. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/shape.html">Documentation * on elastic.co * @see API * specification diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TypeMapping.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TypeMapping.java index c48c99c17..8cfd5e3e6 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TypeMapping.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TypeMapping.java @@ -103,6 +103,9 @@ public class TypeMapping implements JsonpSerializable { @Nullable private final Boolean enabled; + @Nullable + private final Boolean subobjects; + @Nullable private final DataStreamTimestamp dataStreamTimestamp; @@ -125,6 +128,7 @@ private TypeMapping(Builder builder) { this.source = builder.source; this.runtime = ApiTypeHelper.unmodifiable(builder.runtime); this.enabled = builder.enabled; + this.subobjects = builder.subobjects; this.dataStreamTimestamp = builder.dataStreamTimestamp; } @@ -248,6 +252,14 @@ public final Boolean enabled() { return this.enabled; } + /** + * API name: {@code subobjects} + */ + @Nullable + public final Boolean subobjects() { + return this.subobjects; + } + /** * API name: {@code _data_stream_timestamp} */ @@ -376,6 +388,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("enabled"); generator.write(this.enabled); + } + if (this.subobjects != null) { + generator.writeKey("subobjects"); + generator.write(this.subobjects); + } if (this.dataStreamTimestamp != null) { generator.writeKey("_data_stream_timestamp"); @@ -442,6 +459,9 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private Boolean enabled; + @Nullable + private Boolean subobjects; + @Nullable private DataStreamTimestamp dataStreamTimestamp; @@ -686,6 +706,14 @@ public final Builder enabled(@Nullable Boolean value) { return this; } + /** + * API name: {@code subobjects} + */ + public final Builder subobjects(@Nullable Boolean value) { + this.subobjects = value; + return this; + } + /** * API name: {@code _data_stream_timestamp} */ @@ -747,6 +775,7 @@ protected static void setupTypeMappingDeserializer(ObjectDeserializer */ @JsonpDeserializable -public class BoolQuery extends QueryBase implements QueryVariant { +public class BoolQuery extends QueryBase implements ApiKeyQueryVariant, QueryVariant { private final List filter; @Nullable @@ -85,6 +87,14 @@ public static BoolQuery of(Function> fn) { return fn.apply(new Builder()).build(); } + /** + * ApiKeyQuery variant kind. + */ + @Override + public ApiKeyQuery.Kind _apiKeyQueryKind() { + return ApiKeyQuery.Kind.Bool; + } + /** * Query variant kind. */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/ExistsQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/ExistsQuery.java index 81acf91ec..b958d6fd0 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/ExistsQuery.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/ExistsQuery.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.query_dsl; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQuery; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQueryVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -55,7 +57,7 @@ * specification */ @JsonpDeserializable -public class ExistsQuery extends QueryBase implements QueryVariant { +public class ExistsQuery extends QueryBase implements ApiKeyQueryVariant, QueryVariant { private final String field; // --------------------------------------------------------------------------------------------- @@ -71,6 +73,14 @@ public static ExistsQuery of(Function> fn) { return fn.apply(new Builder()).build(); } + /** + * ApiKeyQuery variant kind. + */ + @Override + public ApiKeyQuery.Kind _apiKeyQueryKind() { + return ApiKeyQuery.Kind.Exists; + } + /** * Query variant kind. */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IdsQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IdsQuery.java index dff3c474b..75a04fee3 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IdsQuery.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IdsQuery.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.query_dsl; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQuery; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQueryVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -56,7 +58,7 @@ * specification */ @JsonpDeserializable -public class IdsQuery extends QueryBase implements QueryVariant { +public class IdsQuery extends QueryBase implements ApiKeyQueryVariant, QueryVariant { private final List values; // --------------------------------------------------------------------------------------------- @@ -72,6 +74,14 @@ public static IdsQuery of(Function> fn) { return fn.apply(new Builder()).build(); } + /** + * ApiKeyQuery variant kind. + */ + @Override + public ApiKeyQuery.Kind _apiKeyQueryKind() { + return ApiKeyQuery.Kind.Ids; + } + /** * Query variant kind. */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Like.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Like.java index 6b736dfce..0fa57cd34 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Like.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Like.java @@ -60,7 +60,7 @@ * the text. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/query-dsl-mlt-query.html#_document_input_parameters">Documentation * on elastic.co * @see API * specification diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/LikeDocument.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/LikeDocument.java index a2869693b..1e3bc3ed5 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/LikeDocument.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/LikeDocument.java @@ -144,6 +144,8 @@ public final String index() { } /** + * Overrides the default analyzer. + *

* API name: {@code per_field_analyzer} */ public final Map perFieldAnalyzer() { @@ -325,6 +327,8 @@ public final Builder index(@Nullable String value) { } /** + * Overrides the default analyzer. + *

* API name: {@code per_field_analyzer} *

* Adds all entries of map to perFieldAnalyzer. @@ -335,6 +339,8 @@ public final Builder perFieldAnalyzer(Map map) { } /** + * Overrides the default analyzer. + *

* API name: {@code per_field_analyzer} *

* Adds an entry to perFieldAnalyzer. diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchAllQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchAllQuery.java index 6f7e3bf13..f119c6418 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchAllQuery.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchAllQuery.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.query_dsl; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQuery; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQueryVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -52,7 +54,7 @@ * specification */ @JsonpDeserializable -public class MatchAllQuery extends QueryBase implements QueryVariant { +public class MatchAllQuery extends QueryBase implements ApiKeyQueryVariant, QueryVariant { // --------------------------------------------------------------------------------------------- private MatchAllQuery(Builder builder) { @@ -64,6 +66,14 @@ public static MatchAllQuery of(Function> f return fn.apply(new Builder()).build(); } + /** + * ApiKeyQuery variant kind. + */ + @Override + public ApiKeyQuery.Kind _apiKeyQueryKind() { + return ApiKeyQuery.Kind.MatchAll; + } + /** * Query variant kind. */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchQuery.java index 1bd44d100..5b8d885a4 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchQuery.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchQuery.java @@ -20,6 +20,8 @@ package co.elastic.clients.elasticsearch._types.query_dsl; import co.elastic.clients.elasticsearch._types.FieldValue; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQuery; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQueryVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -59,7 +61,7 @@ * specification */ @JsonpDeserializable -public class MatchQuery extends QueryBase implements QueryVariant { +public class MatchQuery extends QueryBase implements ApiKeyQueryVariant, QueryVariant { // Single key dictionary private final String field; @@ -127,6 +129,14 @@ public static MatchQuery of(Function> fn) { return fn.apply(new Builder()).build(); } + /** + * ApiKeyQuery variant kind. + */ + @Override + public ApiKeyQuery.Kind _apiKeyQueryKind() { + return ApiKeyQuery.Kind.Match; + } + /** * Query variant kind. */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MoreLikeThisQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MoreLikeThisQuery.java index d7a107e34..a8baebadc 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MoreLikeThisQuery.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MoreLikeThisQuery.java @@ -34,7 +34,6 @@ import java.lang.Long; import java.lang.String; import java.util.List; -import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -101,8 +100,6 @@ public class MoreLikeThisQuery extends QueryBase implements QueryVariant { @Nullable private final Integer minWordLength; - private final Map perFieldAnalyzer; - @Nullable private final String routing; @@ -134,7 +131,6 @@ private MoreLikeThisQuery(Builder builder) { this.minimumShouldMatch = builder.minimumShouldMatch; this.minTermFreq = builder.minTermFreq; this.minWordLength = builder.minWordLength; - this.perFieldAnalyzer = ApiTypeHelper.unmodifiable(builder.perFieldAnalyzer); this.routing = builder.routing; this.stopWords = ApiTypeHelper.unmodifiable(builder.stopWords); this.unlike = ApiTypeHelper.unmodifiable(builder.unlike); @@ -297,15 +293,6 @@ public final Integer minWordLength() { return this.minWordLength; } - /** - * Overrides the default analyzer. - *

- * API name: {@code per_field_analyzer} - */ - public final Map perFieldAnalyzer() { - return this.perFieldAnalyzer; - } - /** * API name: {@code routing} */ @@ -426,17 +413,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("min_word_length"); generator.write(this.minWordLength); - } - if (ApiTypeHelper.isDefined(this.perFieldAnalyzer)) { - generator.writeKey("per_field_analyzer"); - generator.writeStartObject(); - for (Map.Entry item0 : this.perFieldAnalyzer.entrySet()) { - generator.writeKey(item0.getKey()); - generator.write(item0.getValue()); - - } - generator.writeEnd(); - } if (this.routing != null) { generator.writeKey("routing"); @@ -520,9 +496,6 @@ public static class Builder extends QueryBase.AbstractBuilder implement @Nullable private Integer minWordLength; - @Nullable - private Map perFieldAnalyzer; - @Nullable private String routing; @@ -725,30 +698,6 @@ public final Builder minWordLength(@Nullable Integer value) { return this; } - /** - * Overrides the default analyzer. - *

- * API name: {@code per_field_analyzer} - *

- * Adds all entries of map to perFieldAnalyzer. - */ - public final Builder perFieldAnalyzer(Map map) { - this.perFieldAnalyzer = _mapPutAll(this.perFieldAnalyzer, map); - return this; - } - - /** - * Overrides the default analyzer. - *

- * API name: {@code per_field_analyzer} - *

- * Adds an entry to perFieldAnalyzer. - */ - public final Builder perFieldAnalyzer(String key, String value) { - this.perFieldAnalyzer = _mapPut(this.perFieldAnalyzer, key, value); - return this; - } - /** * API name: {@code routing} */ @@ -876,8 +825,6 @@ protected static void setupMoreLikeThisQueryDeserializer(ObjectDeserializer { + public static class Builder extends QueryBase.AbstractBuilder implements ObjectBuilder { private Kind _kind; private Object _value; @@ -263,7 +263,7 @@ public ContainerBuilder docs(List v) { return new ContainerBuilder(); } - protected PinnedQuery build() { + public PinnedQuery build() { _checkSingleUse(); return new PinnedQuery(this); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/PrefixQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/PrefixQuery.java index c175451ea..37a9cab6e 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/PrefixQuery.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/PrefixQuery.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.query_dsl; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQuery; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQueryVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -56,7 +58,7 @@ * specification */ @JsonpDeserializable -public class PrefixQuery extends QueryBase implements QueryVariant { +public class PrefixQuery extends QueryBase implements ApiKeyQueryVariant, QueryVariant { // Single key dictionary private final String field; @@ -84,6 +86,14 @@ public static PrefixQuery of(Function> fn) { return fn.apply(new Builder()).build(); } + /** + * ApiKeyQuery variant kind. + */ + @Override + public ApiKeyQuery.Kind _apiKeyQueryKind() { + return ApiKeyQuery.Kind.Prefix; + } + /** * Query variant kind. */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Query.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Query.java index 2d41eee0e..b545883ac 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Query.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Query.java @@ -62,7 +62,7 @@ /** * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/query-dsl.html">Documentation * on elastic.co * @see API @@ -152,19 +152,21 @@ public enum Kind implements JsonEnum { Regexp("regexp"), - RuleQuery("rule_query"), + Rule("rule"), Script("script"), ScriptScore("script_score"), + Semantic("semantic"), + Shape("shape"), SimpleQueryString("simple_query_string"), SpanContaining("span_containing"), - FieldMaskingSpan("field_masking_span"), + SpanFieldMasking("span_field_masking"), SpanFirst("span_first"), @@ -180,6 +182,8 @@ public enum Kind implements JsonEnum { SpanWithin("span_within"), + SparseVector("sparse_vector"), + Term("term"), Terms("terms"), @@ -872,20 +876,20 @@ public RegexpQuery regexp() { } /** - * Is this variant instance of kind {@code rule_query}? + * Is this variant instance of kind {@code rule}? */ - public boolean isRuleQuery() { - return _kind == Kind.RuleQuery; + public boolean isRule() { + return _kind == Kind.Rule; } /** - * Get the {@code rule_query} variant value. + * Get the {@code rule} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code rule_query} kind. + * if the current variant is not of the {@code rule} kind. */ - public RuleQuery ruleQuery() { - return TaggedUnionUtils.get(this, Kind.RuleQuery); + public RuleQuery rule() { + return TaggedUnionUtils.get(this, Kind.Rule); } /** @@ -922,6 +926,23 @@ public ScriptScoreQuery scriptScore() { return TaggedUnionUtils.get(this, Kind.ScriptScore); } + /** + * Is this variant instance of kind {@code semantic}? + */ + public boolean isSemantic() { + return _kind == Kind.Semantic; + } + + /** + * Get the {@code semantic} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code semantic} kind. + */ + public SemanticQuery semantic() { + return TaggedUnionUtils.get(this, Kind.Semantic); + } + /** * Is this variant instance of kind {@code shape}? */ @@ -976,21 +997,21 @@ public SpanContainingQuery spanContaining() { } /** - * Is this variant instance of kind {@code field_masking_span}? + * Is this variant instance of kind {@code span_field_masking}? */ - public boolean isFieldMaskingSpan() { - return _kind == Kind.FieldMaskingSpan; + public boolean isSpanFieldMasking() { + return _kind == Kind.SpanFieldMasking; } /** - * Get the {@code field_masking_span} variant value. + * Get the {@code span_field_masking} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code field_masking_span} + * if the current variant is not of the {@code span_field_masking} * kind. */ - public SpanFieldMaskingQuery fieldMaskingSpan() { - return TaggedUnionUtils.get(this, Kind.FieldMaskingSpan); + public SpanFieldMaskingQuery spanFieldMasking() { + return TaggedUnionUtils.get(this, Kind.SpanFieldMasking); } /** @@ -1112,6 +1133,23 @@ public SpanWithinQuery spanWithin() { return TaggedUnionUtils.get(this, Kind.SpanWithin); } + /** + * Is this variant instance of kind {@code sparse_vector}? + */ + public boolean isSparseVector() { + return _kind == Kind.SparseVector; + } + + /** + * Get the {@code sparse_vector} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code sparse_vector} kind. + */ + public SparseVectorQuery sparseVector() { + return TaggedUnionUtils.get(this, Kind.SparseVector); + } + /** * Is this variant instance of kind {@code term}? */ @@ -1679,14 +1717,14 @@ public ObjectBuilder regexp(Function ruleQuery(RuleQuery v) { - this._kind = Kind.RuleQuery; + public ObjectBuilder rule(RuleQuery v) { + this._kind = Kind.Rule; this._value = v; return this; } - public ObjectBuilder ruleQuery(Function> fn) { - return this.ruleQuery(fn.apply(new RuleQuery.Builder()).build()); + public ObjectBuilder rule(Function> fn) { + return this.rule(fn.apply(new RuleQuery.Builder()).build()); } public ObjectBuilder script(ScriptQuery v) { @@ -1710,6 +1748,16 @@ public ObjectBuilder scriptScore( return this.scriptScore(fn.apply(new ScriptScoreQuery.Builder()).build()); } + public ObjectBuilder semantic(SemanticQuery v) { + this._kind = Kind.Semantic; + this._value = v; + return this; + } + + public ObjectBuilder semantic(Function> fn) { + return this.semantic(fn.apply(new SemanticQuery.Builder()).build()); + } + public ObjectBuilder shape(ShapeQuery v) { this._kind = Kind.Shape; this._value = v; @@ -1742,15 +1790,15 @@ public ObjectBuilder spanContaining( return this.spanContaining(fn.apply(new SpanContainingQuery.Builder()).build()); } - public ObjectBuilder fieldMaskingSpan(SpanFieldMaskingQuery v) { - this._kind = Kind.FieldMaskingSpan; + public ObjectBuilder spanFieldMasking(SpanFieldMaskingQuery v) { + this._kind = Kind.SpanFieldMasking; this._value = v; return this; } - public ObjectBuilder fieldMaskingSpan( + public ObjectBuilder spanFieldMasking( Function> fn) { - return this.fieldMaskingSpan(fn.apply(new SpanFieldMaskingQuery.Builder()).build()); + return this.spanFieldMasking(fn.apply(new SpanFieldMaskingQuery.Builder()).build()); } public ObjectBuilder spanFirst(SpanFirstQuery v) { @@ -1824,6 +1872,17 @@ public ObjectBuilder spanWithin(Function sparseVector(SparseVectorQuery v) { + this._kind = Kind.SparseVector; + this._value = v; + return this; + } + + public ObjectBuilder sparseVector( + Function> fn) { + return this.sparseVector(fn.apply(new SparseVectorQuery.Builder()).build()); + } + public ObjectBuilder term(TermQuery v) { this._kind = Kind.Term; this._value = v; @@ -1967,13 +2026,14 @@ protected static void setupQueryDeserializer(ObjectDeserializer op) { op.add(Builder::range, RangeQuery._DESERIALIZER, "range"); op.add(Builder::rankFeature, RankFeatureQuery._DESERIALIZER, "rank_feature"); op.add(Builder::regexp, RegexpQuery._DESERIALIZER, "regexp"); - op.add(Builder::ruleQuery, RuleQuery._DESERIALIZER, "rule_query"); + op.add(Builder::rule, RuleQuery._DESERIALIZER, "rule"); op.add(Builder::script, ScriptQuery._DESERIALIZER, "script"); op.add(Builder::scriptScore, ScriptScoreQuery._DESERIALIZER, "script_score"); + op.add(Builder::semantic, SemanticQuery._DESERIALIZER, "semantic"); op.add(Builder::shape, ShapeQuery._DESERIALIZER, "shape"); op.add(Builder::simpleQueryString, SimpleQueryStringQuery._DESERIALIZER, "simple_query_string"); op.add(Builder::spanContaining, SpanContainingQuery._DESERIALIZER, "span_containing"); - op.add(Builder::fieldMaskingSpan, SpanFieldMaskingQuery._DESERIALIZER, "field_masking_span"); + op.add(Builder::spanFieldMasking, SpanFieldMaskingQuery._DESERIALIZER, "span_field_masking"); op.add(Builder::spanFirst, SpanFirstQuery._DESERIALIZER, "span_first"); op.add(Builder::spanMulti, SpanMultiTermQuery._DESERIALIZER, "span_multi"); op.add(Builder::spanNear, SpanNearQuery._DESERIALIZER, "span_near"); @@ -1981,6 +2041,7 @@ protected static void setupQueryDeserializer(ObjectDeserializer op) { op.add(Builder::spanOr, SpanOrQuery._DESERIALIZER, "span_or"); op.add(Builder::spanTerm, SpanTermQuery._DESERIALIZER, "span_term"); op.add(Builder::spanWithin, SpanWithinQuery._DESERIALIZER, "span_within"); + op.add(Builder::sparseVector, SparseVectorQuery._DESERIALIZER, "sparse_vector"); op.add(Builder::term, TermQuery._DESERIALIZER, "term"); op.add(Builder::terms, TermsQuery._DESERIALIZER, "terms"); op.add(Builder::termsSet, TermsSetQuery._DESERIALIZER, "terms_set"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryBuilders.java index 292600e20..33d581d8d 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryBuilders.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryBuilders.java @@ -667,18 +667,18 @@ public static Query regexp(Function> fn) { + public static Query rule(Function> fn) { Query.Builder builder = new Query.Builder(); - builder.ruleQuery(fn.apply(new RuleQuery.Builder()).build()); + builder.rule(fn.apply(new RuleQuery.Builder()).build()); return builder.build(); } @@ -716,6 +716,23 @@ public static Query scriptScore(Function> fn) { + Query.Builder builder = new Query.Builder(); + builder.semantic(fn.apply(new SemanticQuery.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link ShapeQuery shape} {@code Query} variant. */ @@ -770,21 +787,21 @@ public static Query spanContaining(Function> fn) { Query.Builder builder = new Query.Builder(); - builder.fieldMaskingSpan(fn.apply(new SpanFieldMaskingQuery.Builder()).build()); + builder.spanFieldMasking(fn.apply(new SpanFieldMaskingQuery.Builder()).build()); return builder.build(); } @@ -909,6 +926,24 @@ public static Query spanWithin(Function> fn) { + Query.Builder builder = new Query.Builder(); + builder.sparseVector(fn.apply(new SparseVectorQuery.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link TermQuery term} {@code Query} variant. */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RangeQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RangeQuery.java index 162b789a6..242c1d40f 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RangeQuery.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RangeQuery.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.query_dsl; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQuery; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQueryVariant; import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; @@ -56,7 +58,7 @@ * specification */ @JsonpDeserializable -public class RangeQuery extends RangeQueryBase implements QueryVariant { +public class RangeQuery extends RangeQueryBase implements ApiKeyQueryVariant, QueryVariant { // Single key dictionary private final String field; @@ -105,6 +107,14 @@ public static RangeQuery of(Function> fn) { return fn.apply(new Builder()).build(); } + /** + * ApiKeyQuery variant kind. + */ + @Override + public ApiKeyQuery.Kind _apiKeyQueryKind() { + return ApiKeyQuery.Kind.Range; + } + /** * Query variant kind. */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RuleQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RuleQuery.java index bb4a5c3c6..3fa84199f 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RuleQuery.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RuleQuery.java @@ -29,6 +29,7 @@ import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; import java.lang.String; +import java.util.List; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -59,7 +60,7 @@ public class RuleQuery extends QueryBase implements QueryVariant { private final Query organic; - private final String rulesetId; + private final List rulesetIds; private final JsonData matchCriteria; @@ -69,7 +70,7 @@ private RuleQuery(Builder builder) { super(builder); this.organic = ApiTypeHelper.requireNonNull(builder.organic, this, "organic"); - this.rulesetId = ApiTypeHelper.requireNonNull(builder.rulesetId, this, "rulesetId"); + this.rulesetIds = ApiTypeHelper.unmodifiableRequired(builder.rulesetIds, this, "rulesetIds"); this.matchCriteria = ApiTypeHelper.requireNonNull(builder.matchCriteria, this, "matchCriteria"); } @@ -83,7 +84,7 @@ public static RuleQuery of(Function> fn) { */ @Override public Query.Kind _queryKind() { - return Query.Kind.RuleQuery; + return Query.Kind.Rule; } /** @@ -94,10 +95,10 @@ public final Query organic() { } /** - * Required - API name: {@code ruleset_id} + * Required - API name: {@code ruleset_ids} */ - public final String rulesetId() { - return this.rulesetId; + public final List rulesetIds() { + return this.rulesetIds; } /** @@ -113,9 +114,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("organic"); this.organic.serialize(generator, mapper); - generator.writeKey("ruleset_id"); - generator.write(this.rulesetId); + if (ApiTypeHelper.isDefined(this.rulesetIds)) { + generator.writeKey("ruleset_ids"); + generator.writeStartArray(); + for (String item0 : this.rulesetIds) { + generator.write(item0); + } + generator.writeEnd(); + + } generator.writeKey("match_criteria"); this.matchCriteria.serialize(generator, mapper); @@ -130,7 +138,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { public static class Builder extends QueryBase.AbstractBuilder implements ObjectBuilder { private Query organic; - private String rulesetId; + private List rulesetIds; private JsonData matchCriteria; @@ -150,10 +158,22 @@ public final Builder organic(Function> fn) { } /** - * Required - API name: {@code ruleset_id} + * Required - API name: {@code ruleset_ids} + *

+ * Adds all elements of list to rulesetIds. + */ + public final Builder rulesetIds(List list) { + this.rulesetIds = _listAddAll(this.rulesetIds, list); + return this; + } + + /** + * Required - API name: {@code ruleset_ids} + *

+ * Adds one or more values to rulesetIds. */ - public final Builder rulesetId(String value) { - this.rulesetId = value; + public final Builder rulesetIds(String value, String... values) { + this.rulesetIds = _listAdd(this.rulesetIds, value, values); return this; } @@ -194,7 +214,8 @@ public RuleQuery build() { protected static void setupRuleQueryDeserializer(ObjectDeserializer op) { QueryBase.setupQueryBaseDeserializer(op); op.add(Builder::organic, Query._DESERIALIZER, "organic"); - op.add(Builder::rulesetId, JsonpDeserializer.stringDeserializer(), "ruleset_id"); + op.add(Builder::rulesetIds, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "ruleset_ids"); op.add(Builder::matchCriteria, JsonData._DESERIALIZER, "match_criteria"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SemanticQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SemanticQuery.java new file mode 100644 index 000000000..8f8d1c73e --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SemanticQuery.java @@ -0,0 +1,179 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types.query_dsl; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.query_dsl.SemanticQuery + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SemanticQuery extends QueryBase implements QueryVariant { + private final String field; + + private final String query; + + // --------------------------------------------------------------------------------------------- + + private SemanticQuery(Builder builder) { + super(builder); + + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); + this.query = ApiTypeHelper.requireNonNull(builder.query, this, "query"); + + } + + public static SemanticQuery of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Query variant kind. + */ + @Override + public Query.Kind _queryKind() { + return Query.Kind.Semantic; + } + + /** + * Required - The field to query, which must be a semantic_text field type + *

+ * API name: {@code field} + */ + public final String field() { + return this.field; + } + + /** + * Required - The query text + *

+ * API name: {@code query} + */ + public final String query() { + return this.query; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + super.serializeInternal(generator, mapper); + generator.writeKey("field"); + generator.write(this.field); + + generator.writeKey("query"); + generator.write(this.query); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SemanticQuery}. + */ + + public static class Builder extends QueryBase.AbstractBuilder implements ObjectBuilder { + private String field; + + private String query; + + /** + * Required - The field to query, which must be a semantic_text field type + *

+ * API name: {@code field} + */ + public final Builder field(String value) { + this.field = value; + return this; + } + + /** + * Required - The query text + *

+ * API name: {@code query} + */ + public final Builder query(String value) { + this.query = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SemanticQuery}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SemanticQuery build() { + _checkSingleUse(); + + return new SemanticQuery(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SemanticQuery} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + SemanticQuery::setupSemanticQueryDeserializer); + + protected static void setupSemanticQueryDeserializer(ObjectDeserializer op) { + QueryBase.setupQueryBaseDeserializer(op); + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); + op.add(Builder::query, JsonpDeserializer.stringDeserializer(), "query"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SimpleQueryStringQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SimpleQueryStringQuery.java index c23153bdc..ed1878df9 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SimpleQueryStringQuery.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SimpleQueryStringQuery.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.query_dsl; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQuery; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQueryVariant; import co.elastic.clients.json.JsonEnums; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; @@ -60,7 +62,7 @@ * specification */ @JsonpDeserializable -public class SimpleQueryStringQuery extends QueryBase implements QueryVariant { +public class SimpleQueryStringQuery extends QueryBase implements ApiKeyQueryVariant, QueryVariant { @Nullable private final String analyzer; @@ -122,6 +124,14 @@ public static SimpleQueryStringQuery of(Function */ @JsonpDeserializable -public class SpanQuery implements TaggedUnion, JsonpSerializable { +public class SpanQuery implements OpenTaggedUnion, JsonpSerializable { /** * {@link SpanQuery} variant kinds. @@ -73,7 +74,7 @@ public class SpanQuery implements TaggedUnion, JsonpSeri public enum Kind implements JsonEnum { SpanContaining("span_containing"), - FieldMaskingSpan("field_masking_span"), + SpanFieldMasking("span_field_masking"), SpanFirst("span_first"), @@ -91,6 +92,9 @@ public enum Kind implements JsonEnum { SpanWithin("span_within"), + /** A custom {@code SpanQuery} defined by a plugin */ + _Custom(null) + ; private final String jsonValue; @@ -122,6 +126,7 @@ public SpanQuery(SpanQueryVariant value) { this._kind = ApiTypeHelper.requireNonNull(value._spanQueryKind(), this, ""); this._value = ApiTypeHelper.requireNonNull(value, this, ""); + this._customKind = null; } @@ -129,6 +134,7 @@ private SpanQuery(Builder builder) { this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + this._customKind = builder._customKind; } @@ -155,21 +161,21 @@ public SpanContainingQuery spanContaining() { } /** - * Is this variant instance of kind {@code field_masking_span}? + * Is this variant instance of kind {@code span_field_masking}? */ - public boolean isFieldMaskingSpan() { - return _kind == Kind.FieldMaskingSpan; + public boolean isSpanFieldMasking() { + return _kind == Kind.SpanFieldMasking; } /** - * Get the {@code field_masking_span} variant value. + * Get the {@code span_field_masking} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code field_masking_span} + * if the current variant is not of the {@code span_field_masking} * kind. */ - public SpanFieldMaskingQuery fieldMaskingSpan() { - return TaggedUnionUtils.get(this, Kind.FieldMaskingSpan); + public SpanFieldMaskingQuery spanFieldMasking() { + return TaggedUnionUtils.get(this, Kind.SpanFieldMasking); } /** @@ -308,13 +314,42 @@ public SpanWithinQuery spanWithin() { return TaggedUnionUtils.get(this, Kind.SpanWithin); } + @Nullable + private final String _customKind; + + /** + * Is this a custom {@code SpanQuery} defined by a plugin? + */ + public boolean _isCustom() { + return _kind == Kind._Custom; + } + + /** + * Get the actual kind when {@code _kind()} equals {@link Kind#_Custom} + * (plugin-defined variant). + */ + @Nullable + public final String _customKind() { + return _customKind; + } + + /** + * Get the custom plugin-defined variant value. + * + * @throws IllegalStateException + * if the current variant is not {@link Kind#_Custom}. + */ + public JsonData _custom() { + return TaggedUnionUtils.get(this, Kind._Custom); + } + @Override @SuppressWarnings("unchecked") public void serialize(JsonGenerator generator, JsonpMapper mapper) { generator.writeStartObject(); - generator.writeKey(_kind.jsonValue()); + generator.writeKey(_kind == Kind._Custom ? _customKind : _kind.jsonValue()); if (_value instanceof JsonpSerializable) { ((JsonpSerializable) _value).serialize(generator, mapper); } @@ -331,6 +366,7 @@ public String toString() { public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { private Kind _kind; private Object _value; + private String _customKind; @Override protected Builder self() { @@ -347,15 +383,15 @@ public ObjectBuilder spanContaining( return this.spanContaining(fn.apply(new SpanContainingQuery.Builder()).build()); } - public ObjectBuilder fieldMaskingSpan(SpanFieldMaskingQuery v) { - this._kind = Kind.FieldMaskingSpan; + public ObjectBuilder spanFieldMasking(SpanFieldMaskingQuery v) { + this._kind = Kind.SpanFieldMasking; this._value = v; return this; } - public ObjectBuilder fieldMaskingSpan( + public ObjectBuilder spanFieldMasking( Function> fn) { - return this.fieldMaskingSpan(fn.apply(new SpanFieldMaskingQuery.Builder()).build()); + return this.spanFieldMasking(fn.apply(new SpanFieldMaskingQuery.Builder()).build()); } public ObjectBuilder spanFirst(SpanFirstQuery v) { @@ -440,6 +476,22 @@ public ObjectBuilder spanWithin( return this.spanWithin(fn.apply(new SpanWithinQuery.Builder()).build()); } + /** + * Define this {@code SpanQuery} as a plugin-defined variant. + * + * @param name + * the plugin-defined identifier + * @param data + * the data for this custom {@code SpanQuery}. It is converted + * internally to {@link JsonData}. + */ + public ObjectBuilder _custom(String name, Object data) { + this._kind = Kind._Custom; + this._customKind = name; + this._value = JsonData.of(data); + return this; + } + public SpanQuery build() { _checkSingleUse(); return new SpanQuery(this); @@ -450,7 +502,7 @@ public SpanQuery build() { protected static void setupSpanQueryDeserializer(ObjectDeserializer op) { op.add(Builder::spanContaining, SpanContainingQuery._DESERIALIZER, "span_containing"); - op.add(Builder::fieldMaskingSpan, SpanFieldMaskingQuery._DESERIALIZER, "field_masking_span"); + op.add(Builder::spanFieldMasking, SpanFieldMaskingQuery._DESERIALIZER, "span_field_masking"); op.add(Builder::spanFirst, SpanFirstQuery._DESERIALIZER, "span_first"); op.add(Builder::spanGap, SpanGapQuery._DESERIALIZER, "span_gap"); op.add(Builder::spanMulti, SpanMultiTermQuery._DESERIALIZER, "span_multi"); @@ -460,6 +512,11 @@ protected static void setupSpanQueryDeserializer(ObjectDeserializer op) op.add(Builder::spanTerm, SpanTermQuery._DESERIALIZER, "span_term"); op.add(Builder::spanWithin, SpanWithinQuery._DESERIALIZER, "span_within"); + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + JsonpUtils.ensureCustomVariantsAllowed(parser, mapper); + builder._custom(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + } public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanQueryBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanQueryBuilders.java index 1f0286ccc..47d368305 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanQueryBuilders.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanQueryBuilders.java @@ -64,21 +64,21 @@ public static SpanQuery spanContaining( } /** - * Creates a builder for the {@link SpanFieldMaskingQuery field_masking_span} + * Creates a builder for the {@link SpanFieldMaskingQuery span_field_masking} * {@code SpanQuery} variant. */ - public static SpanFieldMaskingQuery.Builder fieldMaskingSpan() { + public static SpanFieldMaskingQuery.Builder spanFieldMasking() { return new SpanFieldMaskingQuery.Builder(); } /** - * Creates a SpanQuery of the {@link SpanFieldMaskingQuery field_masking_span} + * Creates a SpanQuery of the {@link SpanFieldMaskingQuery span_field_masking} * {@code SpanQuery} variant. */ - public static SpanQuery fieldMaskingSpan( + public static SpanQuery spanFieldMasking( Function> fn) { SpanQuery.Builder builder = new SpanQuery.Builder(); - builder.fieldMaskingSpan(fn.apply(new SpanFieldMaskingQuery.Builder()).build()); + builder.spanFieldMasking(fn.apply(new SpanFieldMaskingQuery.Builder()).build()); return builder.build(); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SparseVectorQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SparseVectorQuery.java new file mode 100644 index 000000000..e6e4a2ab1 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SparseVectorQuery.java @@ -0,0 +1,467 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types.query_dsl; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.Float; +import java.lang.Object; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.query_dsl.SparseVectorQuery + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SparseVectorQuery extends QueryBase + implements + TaggedUnion, + QueryVariant, + JsonpSerializable { + + /** + * {@link SparseVectorQuery} variant kinds. + * + * @see API + * specification + */ + + public enum Kind implements JsonEnum { + QueryVector("query_vector"), + + InferenceId("inference_id"), + + ; + + private final String jsonValue; + + Kind(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + } + + /** + * Query variant kind. + */ + @Override + public Query.Kind _queryKind() { + return Query.Kind.SparseVector; + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + private final String field; + + @Nullable + private final String query; + + @Nullable + private final Boolean prune; + + @Nullable + private final TokenPruningConfig pruningConfig; + + private SparseVectorQuery(Builder builder) { + super(builder); + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); + this.query = builder.query; + this.prune = builder.prune; + this.pruningConfig = builder.pruningConfig; + + } + + public static SparseVectorQuery of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - The name of the field that contains the token-weight pairs to be + * searched against. This field must be a mapped sparse_vector field. + *

+ * API name: {@code field} + */ + public final String field() { + return this.field; + } + + /** + * The query text you want to use for search. If inference_id is specified, + * query must also be specified. + *

+ * API name: {@code query} + */ + @Nullable + public final String query() { + return this.query; + } + + /** + * Whether to perform pruning, omitting the non-significant tokens from the + * query to improve query performance. If prune is true but the pruning_config + * is not specified, pruning will occur but default values will be used. + * Default: false + *

+ * API name: {@code prune} + */ + @Nullable + public final Boolean prune() { + return this.prune; + } + + /** + * Optional pruning configuration. If enabled, this will omit non-significant + * tokens from the query in order to improve query performance. This is only + * used if prune is set to true. If prune is set to true but pruning_config is + * not specified, default values will be used. + *

+ * API name: {@code pruning_config} + */ + @Nullable + public final TokenPruningConfig pruningConfig() { + return this.pruningConfig; + } + + /** + * Is this variant instance of kind {@code query_vector}? + */ + public boolean isQueryVector() { + return _kind == Kind.QueryVector; + } + + /** + * Get the {@code query_vector} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code query_vector} kind. + */ + public Map queryVector() { + return TaggedUnionUtils.get(this, Kind.QueryVector); + } + + /** + * Is this variant instance of kind {@code inference_id}? + */ + public boolean isInferenceId() { + return _kind == Kind.InferenceId; + } + + /** + * Get the {@code inference_id} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code inference_id} kind. + */ + public String inferenceId() { + return TaggedUnionUtils.get(this, Kind.InferenceId); + } + + @Override + @SuppressWarnings("unchecked") + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeStartObject(); + + super.serializeInternal(generator, mapper); + generator.writeKey("field"); + generator.write(this.field); + + if (this.query != null) { + generator.writeKey("query"); + generator.write(this.query); + + } + if (this.prune != null) { + generator.writeKey("prune"); + generator.write(this.prune); + + } + if (this.pruningConfig != null) { + generator.writeKey("pruning_config"); + this.pruningConfig.serialize(generator, mapper); + + } + + generator.writeKey(_kind.jsonValue()); + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } else { + switch (_kind) { + case QueryVector : + generator.writeStartObject(); + for (Map.Entry item0 : ((Map) this._value).entrySet()) { + generator.writeKey(item0.getKey()); + generator.write(item0.getValue()); + + } + generator.writeEnd(); + + break; + case InferenceId : + generator.write(((String) this._value)); + + break; + } + } + + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends QueryBase.AbstractBuilder implements ObjectBuilder { + private Kind _kind; + private Object _value; + + private String field; + + @Nullable + private String query; + + @Nullable + private Boolean prune; + + @Nullable + private TokenPruningConfig pruningConfig; + + /** + * Required - The name of the field that contains the token-weight pairs to be + * searched against. This field must be a mapped sparse_vector field. + *

+ * API name: {@code field} + */ + public final Builder field(String value) { + this.field = value; + return this; + } + + /** + * The query text you want to use for search. If inference_id is specified, + * query must also be specified. + *

+ * API name: {@code query} + */ + public final Builder query(@Nullable String value) { + this.query = value; + return this; + } + + /** + * Whether to perform pruning, omitting the non-significant tokens from the + * query to improve query performance. If prune is true but the pruning_config + * is not specified, pruning will occur but default values will be used. + * Default: false + *

+ * API name: {@code prune} + */ + public final Builder prune(@Nullable Boolean value) { + this.prune = value; + return this; + } + + /** + * Optional pruning configuration. If enabled, this will omit non-significant + * tokens from the query in order to improve query performance. This is only + * used if prune is set to true. If prune is set to true but pruning_config is + * not specified, default values will be used. + *

+ * API name: {@code pruning_config} + */ + public final Builder pruningConfig(@Nullable TokenPruningConfig value) { + this.pruningConfig = value; + return this; + } + + /** + * Optional pruning configuration. If enabled, this will omit non-significant + * tokens from the query in order to improve query performance. This is only + * used if prune is set to true. If prune is set to true but pruning_config is + * not specified, default values will be used. + *

+ * API name: {@code pruning_config} + */ + public final Builder pruningConfig(Function> fn) { + return this.pruningConfig(fn.apply(new TokenPruningConfig.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + public ContainerBuilder queryVector(Map v) { + this._kind = Kind.QueryVector; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder inferenceId(String v) { + this._kind = Kind.InferenceId; + this._value = v; + return new ContainerBuilder(); + } + + public SparseVectorQuery build() { + _checkSingleUse(); + return new SparseVectorQuery(this); + } + + public class ContainerBuilder implements ObjectBuilder { + + /** + * Required - The name of the field that contains the token-weight pairs to be + * searched against. This field must be a mapped sparse_vector field. + *

+ * API name: {@code field} + */ + public final ContainerBuilder field(String value) { + Builder.this.field = value; + return this; + } + + /** + * The query text you want to use for search. If inference_id is specified, + * query must also be specified. + *

+ * API name: {@code query} + */ + public final ContainerBuilder query(@Nullable String value) { + Builder.this.query = value; + return this; + } + + /** + * Whether to perform pruning, omitting the non-significant tokens from the + * query to improve query performance. If prune is true but the pruning_config + * is not specified, pruning will occur but default values will be used. + * Default: false + *

+ * API name: {@code prune} + */ + public final ContainerBuilder prune(@Nullable Boolean value) { + Builder.this.prune = value; + return this; + } + + /** + * Optional pruning configuration. If enabled, this will omit non-significant + * tokens from the query in order to improve query performance. This is only + * used if prune is set to true. If prune is set to true but pruning_config is + * not specified, default values will be used. + *

+ * API name: {@code pruning_config} + */ + public final ContainerBuilder pruningConfig(@Nullable TokenPruningConfig value) { + Builder.this.pruningConfig = value; + return this; + } + + /** + * Optional pruning configuration. If enabled, this will omit non-significant + * tokens from the query in order to improve query performance. This is only + * used if prune is set to true. If prune is set to true but pruning_config is + * not specified, default values will be used. + *

+ * API name: {@code pruning_config} + */ + public final ContainerBuilder pruningConfig( + Function> fn) { + return this.pruningConfig(fn.apply(new TokenPruningConfig.Builder()).build()); + } + + public SparseVectorQuery build() { + return Builder.this.build(); + } + } + } + + protected static void setupSparseVectorQueryDeserializer(ObjectDeserializer op) { + QueryBase.setupQueryBaseDeserializer(op); + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); + op.add(Builder::queryVector, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.floatDeserializer()), + "query_vector"); + op.add(Builder::inferenceId, JsonpDeserializer.stringDeserializer(), "inference_id"); + op.add(Builder::query, JsonpDeserializer.stringDeserializer(), "query"); + op.add(Builder::prune, JsonpDeserializer.booleanDeserializer(), "prune"); + op.add(Builder::pruningConfig, TokenPruningConfig._DESERIALIZER, "pruning_config"); + + } + + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SparseVectorQuery::setupSparseVectorQueryDeserializer, Builder::build); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SparseVectorQueryBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SparseVectorQueryBuilders.java new file mode 100644 index 000000000..214734185 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SparseVectorQueryBuilders.java @@ -0,0 +1,53 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types.query_dsl; + +import co.elastic.clients.util.ObjectBuilder; +import java.lang.String; +import java.util.function.Function; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Builders for {@link SparseVectorQuery} variants. + *

+ * Variants query_vector, inference_id are not + * available here as they don't have a dedicated class. Use + * {@link SparseVectorQuery}'s builder for these. + * + */ +public class SparseVectorQueryBuilders { + private SparseVectorQueryBuilders() { + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SparseVectorQueryVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SparseVectorQueryVariant.java new file mode 100644 index 000000000..ed8dfbb9f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SparseVectorQueryVariant.java @@ -0,0 +1,44 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch._types.query_dsl; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Base interface for {@link SparseVectorQuery} variants. + */ +public interface SparseVectorQueryVariant { + + SparseVectorQuery.Kind _sparseVectorQueryKind(); + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermQuery.java index 6d2722ea7..1f69488c1 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermQuery.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermQuery.java @@ -20,6 +20,8 @@ package co.elastic.clients.elasticsearch._types.query_dsl; import co.elastic.clients.elasticsearch._types.FieldValue; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQuery; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQueryVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -57,7 +59,7 @@ * specification */ @JsonpDeserializable -public class TermQuery extends QueryBase implements QueryVariant { +public class TermQuery extends QueryBase implements ApiKeyQueryVariant, QueryVariant { // Single key dictionary private final String field; @@ -81,6 +83,14 @@ public static TermQuery of(Function> fn) { return fn.apply(new Builder()).build(); } + /** + * ApiKeyQuery variant kind. + */ + @Override + public ApiKeyQuery.Kind _apiKeyQueryKind() { + return ApiKeyQuery.Kind.Term; + } + /** * Query variant kind. */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermsQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermsQuery.java index 8a5b715aa..176c3e32d 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermsQuery.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermsQuery.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.query_dsl; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQuery; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQueryVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -55,7 +57,7 @@ * specification */ @JsonpDeserializable -public class TermsQuery extends QueryBase implements QueryVariant { +public class TermsQuery extends QueryBase implements ApiKeyQueryVariant, QueryVariant { private final String field; private final TermsQueryField terms; @@ -73,6 +75,14 @@ public static TermsQuery of(Function> fn) { return fn.apply(new Builder()).build(); } + /** + * ApiKeyQuery variant kind. + */ + @Override + public ApiKeyQuery.Kind _apiKeyQueryKind() { + return ApiKeyQuery.Kind.Terms; + } + /** * Query variant kind. */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/WildcardQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/WildcardQuery.java index 50c6811a6..ad0c60f89 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/WildcardQuery.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/WildcardQuery.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch._types.query_dsl; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQuery; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyQueryVariant; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -57,7 +59,7 @@ * specification */ @JsonpDeserializable -public class WildcardQuery extends QueryBase implements QueryVariant { +public class WildcardQuery extends QueryBase implements ApiKeyQueryVariant, QueryVariant { // Single key dictionary private final String field; @@ -90,6 +92,14 @@ public static WildcardQuery of(Function> f return fn.apply(new Builder()).build(); } + /** + * ApiKeyQuery variant kind. + */ + @Override + public ApiKeyQuery.Kind _apiKeyQueryKind() { + return ApiKeyQuery.Kind.Wildcard; + } + /** * Query variant kind. */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearch.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearch.java index 35bb4fcee..5e81d5af2 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearch.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearch.java @@ -646,8 +646,8 @@ public static JsonpDeserializer> createAsyncS * provided by the calling {@code JsonMapper}. */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer - .lazy(() -> createAsyncSearchDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:async_search._types.TDocument"))); + .lazy(() -> createAsyncSearchDeserializer(new NamedDeserializer<>( + "co.elastic.clients:Deserializer:async_search._types.AsyncSearch.TDocument"))); protected static void setupAsyncSearchDeserializer( ObjectDeserializer> op, JsonpDeserializer tDocumentDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearchStatusRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearchStatusRequest.java index bb8711bc9..e66afa4fd 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearchStatusRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearchStatusRequest.java @@ -56,10 +56,10 @@ // typedef: async_search.status.Request /** - * Retreives the status of a previously submitted async search request given its - * identifier, without retrieving search results. If the Elasticsearch security - * features are enabled, use of this API is restricted to the - * monitoring_user role. + * Get async search status Retrieves the status of a previously submitted async + * search request given its identifier, without retrieving search results. If + * the Elasticsearch security features are enabled, use of this API is + * restricted to the monitoring_user role. * * @see API * specification diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/ElasticsearchAsyncSearchAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/ElasticsearchAsyncSearchAsyncClient.java index 9bf4d2a80..38778c65d 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/ElasticsearchAsyncSearchAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/ElasticsearchAsyncSearchAsyncClient.java @@ -72,11 +72,15 @@ public ElasticsearchAsyncSearchAsyncClient withTransportOptions(@Nullable Transp // ----- Endpoint: async_search.delete /** - * Deletes an async search by ID. If the search is still running, the search - * request will be cancelled. Otherwise, the saved search results are deleted. + * Deletes an async search by identifier. If the search is still running, the + * search request will be cancelled. Otherwise, the saved search results are + * deleted. If the Elasticsearch security features are enabled, the deletion of + * a specific async search is restricted to: the authenticated user that + * submitted the original search request; users that have the + * cancel_task cluster privilege. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -88,14 +92,18 @@ public CompletableFuture delete(DeleteAsyncSearchRequ } /** - * Deletes an async search by ID. If the search is still running, the search - * request will be cancelled. Otherwise, the saved search results are deleted. + * Deletes an async search by identifier. If the search is still running, the + * search request will be cancelled. Otherwise, the saved search results are + * deleted. If the Elasticsearch security features are enabled, the deletion of + * a specific async search is restricted to: the authenticated user that + * submitted the original search request; users that have the + * cancel_task cluster privilege. * * @param fn * a function that initializes a builder to create the * {@link DeleteAsyncSearchRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -108,10 +116,12 @@ public final CompletableFuture delete( /** * Retrieves the results of a previously submitted async search request given - * its ID. + * its identifier. If the Elasticsearch security features are enabled, access to + * the results of a specific async search is restricted to the user or API key + * that submitted it. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -120,20 +130,22 @@ public CompletableFuture> get(GetA @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetAsyncSearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:async_search.get.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:async_search.get.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** * Retrieves the results of a previously submitted async search request given - * its ID. + * its identifier. If the Elasticsearch security features are enabled, access to + * the results of a specific async search is restricted to the user or API key + * that submitted it. * * @param fn * a function that initializes a builder to create the * {@link GetAsyncSearchRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -145,10 +157,12 @@ public final CompletableFuture> ge /** * Retrieves the results of a previously submitted async search request given - * its ID. + * its identifier. If the Elasticsearch security features are enabled, access to + * the results of a specific async search is restricted to the user or API key + * that submitted it. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -157,20 +171,22 @@ public CompletableFuture> get(GetA @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetAsyncSearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:async_search.get.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:async_search.get.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** * Retrieves the results of a previously submitted async search request given - * its ID. + * its identifier. If the Elasticsearch security features are enabled, access to + * the results of a specific async search is restricted to the user or API key + * that submitted it. * * @param fn * a function that initializes a builder to create the * {@link GetAsyncSearchRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -182,11 +198,13 @@ public final CompletableFuture> ge // ----- Endpoint: async_search.status /** - * Retrieves the status of a previously submitted async search request given its - * ID. + * Get async search status Retrieves the status of a previously submitted async + * search request given its identifier, without retrieving search results. If + * the Elasticsearch security features are enabled, use of this API is + * restricted to the monitoring_user role. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -198,14 +216,16 @@ public CompletableFuture status(AsyncSearchStatusRequ } /** - * Retrieves the status of a previously submitted async search request given its - * ID. + * Get async search status Retrieves the status of a previously submitted async + * search request given its identifier, without retrieving search results. If + * the Elasticsearch security features are enabled, use of this API is + * restricted to the monitoring_user role. * * @param fn * a function that initializes a builder to create the * {@link AsyncSearchStatusRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -217,10 +237,18 @@ public final CompletableFuture status( // ----- Endpoint: async_search.submit /** - * Executes a search request asynchronously. + * Runs a search request asynchronously. When the primary sort of the results is + * an indexed field, shards get sorted based on minimum and maximum value that + * they hold for that field, hence partial results become available following + * the sort criteria that was requested. Warning: Async search does not support + * scroll nor search requests that only include the suggest section. By default, + * Elasticsearch doesn’t allow you to store an async search response larger than + * 10Mb and an attempt to do this results in an error. The maximum allowed size + * for a stored async search response can be set by changing the + * search.max_async_search_response_size cluster level setting. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -229,19 +257,28 @@ public CompletableFuture> submit(SubmitReq @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SubmitRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:async_search.submit.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:async_search.submit.Response.TDocument", + getDeserializer(tDocumentClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Executes a search request asynchronously. + * Runs a search request asynchronously. When the primary sort of the results is + * an indexed field, shards get sorted based on minimum and maximum value that + * they hold for that field, hence partial results become available following + * the sort criteria that was requested. Warning: Async search does not support + * scroll nor search requests that only include the suggest section. By default, + * Elasticsearch doesn’t allow you to store an async search response larger than + * 10Mb and an attempt to do this results in an error. The maximum allowed size + * for a stored async search response can be set by changing the + * search.max_async_search_response_size cluster level setting. * * @param fn * a function that initializes a builder to create the * {@link SubmitRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -251,10 +288,18 @@ public final CompletableFuture> submit( } /** - * Executes a search request asynchronously. + * Runs a search request asynchronously. When the primary sort of the results is + * an indexed field, shards get sorted based on minimum and maximum value that + * they hold for that field, hence partial results become available following + * the sort criteria that was requested. Warning: Async search does not support + * scroll nor search requests that only include the suggest section. By default, + * Elasticsearch doesn’t allow you to store an async search response larger than + * 10Mb and an attempt to do this results in an error. The maximum allowed size + * for a stored async search response can be set by changing the + * search.max_async_search_response_size cluster level setting. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -262,19 +307,28 @@ public CompletableFuture> submit(SubmitReq @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SubmitRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:async_search.submit.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:async_search.submit.Response.TDocument", + getDeserializer(tDocumentType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Executes a search request asynchronously. + * Runs a search request asynchronously. When the primary sort of the results is + * an indexed field, shards get sorted based on minimum and maximum value that + * they hold for that field, hence partial results become available following + * the sort criteria that was requested. Warning: Async search does not support + * scroll nor search requests that only include the suggest section. By default, + * Elasticsearch doesn’t allow you to store an async search response larger than + * 10Mb and an attempt to do this results in an error. The maximum allowed size + * for a stored async search response can be set by changing the + * search.max_async_search_response_size cluster level setting. * * @param fn * a function that initializes a builder to create the * {@link SubmitRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/ElasticsearchAsyncSearchClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/ElasticsearchAsyncSearchClient.java index 431906056..d6e681576 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/ElasticsearchAsyncSearchClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/ElasticsearchAsyncSearchClient.java @@ -71,11 +71,15 @@ public ElasticsearchAsyncSearchClient withTransportOptions(@Nullable TransportOp // ----- Endpoint: async_search.delete /** - * Deletes an async search by ID. If the search is still running, the search - * request will be cancelled. Otherwise, the saved search results are deleted. + * Deletes an async search by identifier. If the search is still running, the + * search request will be cancelled. Otherwise, the saved search results are + * deleted. If the Elasticsearch security features are enabled, the deletion of + * a specific async search is restricted to: the authenticated user that + * submitted the original search request; users that have the + * cancel_task cluster privilege. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -88,14 +92,18 @@ public DeleteAsyncSearchResponse delete(DeleteAsyncSearchRequest request) } /** - * Deletes an async search by ID. If the search is still running, the search - * request will be cancelled. Otherwise, the saved search results are deleted. + * Deletes an async search by identifier. If the search is still running, the + * search request will be cancelled. Otherwise, the saved search results are + * deleted. If the Elasticsearch security features are enabled, the deletion of + * a specific async search is restricted to: the authenticated user that + * submitted the original search request; users that have the + * cancel_task cluster privilege. * * @param fn * a function that initializes a builder to create the * {@link DeleteAsyncSearchRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -109,10 +117,12 @@ public final DeleteAsyncSearchResponse delete( /** * Retrieves the results of a previously submitted async search request given - * its ID. + * its identifier. If the Elasticsearch security features are enabled, access to + * the results of a specific async search is restricted to the user or API key + * that submitted it. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -121,20 +131,22 @@ public GetAsyncSearchResponse get(GetAsyncSearchRequest r @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetAsyncSearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:async_search.get.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:async_search.get.Response.TDocument", getDeserializer(tDocumentClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** * Retrieves the results of a previously submitted async search request given - * its ID. + * its identifier. If the Elasticsearch security features are enabled, access to + * the results of a specific async search is restricted to the user or API key + * that submitted it. * * @param fn * a function that initializes a builder to create the * {@link GetAsyncSearchRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -146,10 +158,12 @@ public final GetAsyncSearchResponse get( /** * Retrieves the results of a previously submitted async search request given - * its ID. + * its identifier. If the Elasticsearch security features are enabled, access to + * the results of a specific async search is restricted to the user or API key + * that submitted it. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -158,20 +172,22 @@ public GetAsyncSearchResponse get(GetAsyncSearchRequest r @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetAsyncSearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:async_search.get.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:async_search.get.Response.TDocument", getDeserializer(tDocumentType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** * Retrieves the results of a previously submitted async search request given - * its ID. + * its identifier. If the Elasticsearch security features are enabled, access to + * the results of a specific async search is restricted to the user or API key + * that submitted it. * * @param fn * a function that initializes a builder to create the * {@link GetAsyncSearchRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -184,11 +200,13 @@ public final GetAsyncSearchResponse get( // ----- Endpoint: async_search.status /** - * Retrieves the status of a previously submitted async search request given its - * ID. + * Get async search status Retrieves the status of a previously submitted async + * search request given its identifier, without retrieving search results. If + * the Elasticsearch security features are enabled, use of this API is + * restricted to the monitoring_user role. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -201,14 +219,16 @@ public AsyncSearchStatusResponse status(AsyncSearchStatusRequest request) } /** - * Retrieves the status of a previously submitted async search request given its - * ID. + * Get async search status Retrieves the status of a previously submitted async + * search request given its identifier, without retrieving search results. If + * the Elasticsearch security features are enabled, use of this API is + * restricted to the monitoring_user role. * * @param fn * a function that initializes a builder to create the * {@link AsyncSearchStatusRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -221,10 +241,18 @@ public final AsyncSearchStatusResponse status( // ----- Endpoint: async_search.submit /** - * Executes a search request asynchronously. + * Runs a search request asynchronously. When the primary sort of the results is + * an indexed field, shards get sorted based on minimum and maximum value that + * they hold for that field, hence partial results become available following + * the sort criteria that was requested. Warning: Async search does not support + * scroll nor search requests that only include the suggest section. By default, + * Elasticsearch doesn’t allow you to store an async search response larger than + * 10Mb and an attempt to do this results in an error. The maximum allowed size + * for a stored async search response can be set by changing the + * search.max_async_search_response_size cluster level setting. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -233,19 +261,28 @@ public SubmitResponse submit(SubmitRequest request, Class @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SubmitRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:async_search.submit.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:async_search.submit.Response.TDocument", + getDeserializer(tDocumentClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Executes a search request asynchronously. + * Runs a search request asynchronously. When the primary sort of the results is + * an indexed field, shards get sorted based on minimum and maximum value that + * they hold for that field, hence partial results become available following + * the sort criteria that was requested. Warning: Async search does not support + * scroll nor search requests that only include the suggest section. By default, + * Elasticsearch doesn’t allow you to store an async search response larger than + * 10Mb and an attempt to do this results in an error. The maximum allowed size + * for a stored async search response can be set by changing the + * search.max_async_search_response_size cluster level setting. * * @param fn * a function that initializes a builder to create the * {@link SubmitRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -256,10 +293,18 @@ public final SubmitResponse submit( } /** - * Executes a search request asynchronously. + * Runs a search request asynchronously. When the primary sort of the results is + * an indexed field, shards get sorted based on minimum and maximum value that + * they hold for that field, hence partial results become available following + * the sort criteria that was requested. Warning: Async search does not support + * scroll nor search requests that only include the suggest section. By default, + * Elasticsearch doesn’t allow you to store an async search response larger than + * 10Mb and an attempt to do this results in an error. The maximum allowed size + * for a stored async search response can be set by changing the + * search.max_async_search_response_size cluster level setting. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ @@ -268,19 +313,28 @@ public SubmitResponse submit(SubmitRequest request, Type @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SubmitRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:async_search.submit.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:async_search.submit.Response.TDocument", + getDeserializer(tDocumentType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Executes a search request asynchronously. + * Runs a search request asynchronously. When the primary sort of the results is + * an indexed field, shards get sorted based on minimum and maximum value that + * they hold for that field, hence partial results become available following + * the sort criteria that was requested. Warning: Async search does not support + * scroll nor search requests that only include the suggest section. By default, + * Elasticsearch doesn’t allow you to store an async search response larger than + * 10Mb and an attempt to do this results in an error. The maximum allowed size + * for a stored async search response can be set by changing the + * search.max_async_search_response_size cluster level setting. * * @param fn * a function that initializes a builder to create the * {@link SubmitRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/async-search.html">Documentation * on elastic.co */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/GetAsyncSearchResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/GetAsyncSearchResponse.java index f6f53262d..9623ec018 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/GetAsyncSearchResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/GetAsyncSearchResponse.java @@ -112,7 +112,7 @@ public static JsonpDeserializer> c */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createGetAsyncSearchResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:async_search.get.TDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:async_search.get.Response.TDocument"))); protected static void setupGetAsyncSearchResponseDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java index 4b6ddf5ff..ba8a2be17 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java @@ -22,7 +22,7 @@ import co.elastic.clients.elasticsearch._types.ErrorResponse; import co.elastic.clients.elasticsearch._types.ExpandWildcard; import co.elastic.clients.elasticsearch._types.FieldValue; -import co.elastic.clients.elasticsearch._types.KnnQuery; +import co.elastic.clients.elasticsearch._types.KnnSearch; import co.elastic.clients.elasticsearch._types.RequestBase; import co.elastic.clients.elasticsearch._types.ScriptField; import co.elastic.clients.elasticsearch._types.SearchType; @@ -165,7 +165,7 @@ public class SubmitRequest extends RequestBase implements JsonpSerializable { @Nullable private final Boolean keepOnCompletion; - private final List knn; + private final List knn; @Nullable private final Boolean lenient; @@ -576,7 +576,7 @@ public final Boolean keepOnCompletion() { *

* API name: {@code knn} */ - public final List knn() { + public final List knn() { return this.knn; } @@ -1003,7 +1003,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (ApiTypeHelper.isDefined(this.knn)) { generator.writeKey("knn"); generator.writeStartArray(); - for (KnnQuery item0 : this.knn) { + for (KnnSearch item0 : this.knn) { item0.serialize(generator, mapper); } @@ -1114,12 +1114,18 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } if (ApiTypeHelper.isDefined(this.storedFields)) { generator.writeKey("stored_fields"); - generator.writeStartArray(); - for (String item0 : this.storedFields) { - generator.write(item0); + if (this.storedFields.size() == 1) { + String singleItem = this.storedFields.get(0); + generator.write(singleItem); + + } else { + generator.writeStartArray(); + for (String item0 : this.storedFields) { + generator.write(item0); + } + generator.writeEnd(); } - generator.writeEnd(); } if (this.suggest != null) { @@ -1235,7 +1241,7 @@ public static class Builder extends RequestBase.AbstractBuilder impleme private Boolean keepOnCompletion; @Nullable - private List knn; + private List knn; @Nullable private Boolean lenient; @@ -1761,7 +1767,7 @@ public final Builder keepOnCompletion(@Nullable Boolean value) { *

* Adds all elements of list to knn. */ - public final Builder knn(List list) { + public final Builder knn(List list) { this.knn = _listAddAll(this.knn, list); return this; } @@ -1773,7 +1779,7 @@ public final Builder knn(List list) { *

* Adds one or more values to knn. */ - public final Builder knn(KnnQuery value, KnnQuery... values) { + public final Builder knn(KnnSearch value, KnnSearch... values) { this.knn = _listAdd(this.knn, value, values); return this; } @@ -1785,8 +1791,8 @@ public final Builder knn(KnnQuery value, KnnQuery... values) { *

* Adds a value to knn using a builder lambda. */ - public final Builder knn(Function> fn) { - return knn(fn.apply(new KnnQuery.Builder()).build()); + public final Builder knn(Function> fn) { + return knn(fn.apply(new KnnSearch.Builder()).build()); } /** @@ -2442,7 +2448,7 @@ protected static void setupSubmitRequestDeserializer(ObjectDeserializer JsonpDeserializer> createSub */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createSubmitResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:async_search.submit.TDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:async_search.submit.Response.TDocument"))); protected static void setupSubmitResponseDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatAsyncClient.java index 9bf346b0e..3fe1491ca 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatAsyncClient.java @@ -67,11 +67,14 @@ public ElasticsearchCatAsyncClient withTransportOptions(@Nullable TransportOptio // ----- Endpoint: cat.aliases /** - * Shows information about currently configured aliases to indices including - * filter and routing infos. + * Retrieves the cluster’s index aliases, including filter and routing + * information. The API does not return data stream aliases. IMPORTANT: cat APIs + * are only intended for human consumption using the command line or the Kibana + * console. They are not intended for use by applications. For application + * consumption, use the aliases API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-alias.html">Documentation * on elastic.co */ @@ -83,14 +86,17 @@ public CompletableFuture aliases(AliasesRequest request) { } /** - * Shows information about currently configured aliases to indices including - * filter and routing infos. + * Retrieves the cluster’s index aliases, including filter and routing + * information. The API does not return data stream aliases. IMPORTANT: cat APIs + * are only intended for human consumption using the command line or the Kibana + * console. They are not intended for use by applications. For application + * consumption, use the aliases API. * * @param fn * a function that initializes a builder to create the * {@link AliasesRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-alias.html">Documentation * on elastic.co */ @@ -100,11 +106,14 @@ public final CompletableFuture aliases( } /** - * Shows information about currently configured aliases to indices including - * filter and routing infos. + * Retrieves the cluster’s index aliases, including filter and routing + * information. The API does not return data stream aliases. IMPORTANT: cat APIs + * are only intended for human consumption using the command line or the Kibana + * console. They are not intended for use by applications. For application + * consumption, use the aliases API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-alias.html">Documentation * on elastic.co */ @@ -116,7 +125,12 @@ public CompletableFuture aliases() { // ----- Endpoint: cat.component_templates /** - * Returns information about existing component_templates templates. + * Returns information about component templates in a cluster. Component + * templates are building blocks for constructing index templates that specify + * index mappings, settings, and aliases. IMPORTANT: cat APIs are only intended + * for human consumption using the command line or Kibana console. They are not + * intended for use by applications. For application consumption, use the get + * component template API. * * @see Documentation @@ -131,7 +145,12 @@ public CompletableFuture componentTemplates(Componen } /** - * Returns information about existing component_templates templates. + * Returns information about component templates in a cluster. Component + * templates are building blocks for constructing index templates that specify + * index mappings, settings, and aliases. IMPORTANT: cat APIs are only intended + * for human consumption using the command line or Kibana console. They are not + * intended for use by applications. For application consumption, use the get + * component template API. * * @param fn * a function that initializes a builder to create the @@ -147,7 +166,12 @@ public final CompletableFuture componentTemplates( } /** - * Returns information about existing component_templates templates. + * Returns information about component templates in a cluster. Component + * templates are building blocks for constructing index templates that specify + * index mappings, settings, and aliases. IMPORTANT: cat APIs are only intended + * for human consumption using the command line or Kibana console. They are not + * intended for use by applications. For application consumption, use the get + * component template API. * * @see Documentation @@ -162,11 +186,15 @@ public CompletableFuture componentTemplates() { // ----- Endpoint: cat.count /** - * Provides quick access to the document count of the entire cluster, or - * individual indices. + * Provides quick access to a document count for a data stream, an index, or an + * entire cluster. NOTE: The document count only includes live documents, not + * deleted documents which have not yet been removed by the merge process. + * IMPORTANT: cat APIs are only intended for human consumption using the command + * line or Kibana console. They are not intended for use by applications. For + * application consumption, use the count API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-count.html">Documentation * on elastic.co */ @@ -178,14 +206,18 @@ public CompletableFuture count(CountRequest request) { } /** - * Provides quick access to the document count of the entire cluster, or - * individual indices. + * Provides quick access to a document count for a data stream, an index, or an + * entire cluster. NOTE: The document count only includes live documents, not + * deleted documents which have not yet been removed by the merge process. + * IMPORTANT: cat APIs are only intended for human consumption using the command + * line or Kibana console. They are not intended for use by applications. For + * application consumption, use the count API. * * @param fn * a function that initializes a builder to create the * {@link CountRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-count.html">Documentation * on elastic.co */ @@ -195,11 +227,15 @@ public final CompletableFuture count( } /** - * Provides quick access to the document count of the entire cluster, or - * individual indices. + * Provides quick access to a document count for a data stream, an index, or an + * entire cluster. NOTE: The document count only includes live documents, not + * deleted documents which have not yet been removed by the merge process. + * IMPORTANT: cat APIs are only intended for human consumption using the command + * line or Kibana console. They are not intended for use by applications. For + * application consumption, use the count API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-count.html">Documentation * on elastic.co */ @@ -214,7 +250,7 @@ public CompletableFuture count() { * Returns help for the Cat APIs. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat.html">Documentation * on elastic.co */ public CompletableFuture help() { @@ -224,11 +260,20 @@ public CompletableFuture help() { // ----- Endpoint: cat.indices /** - * Returns information about indices: number of primaries and replicas, document - * counts, disk size, ... + * Returns high-level information about indices in a cluster, including backing + * indices for data streams. IMPORTANT: cat APIs are only intended for human + * consumption using the command line or Kibana console. They are not intended + * for use by applications. For application consumption, use the get index API. + * Use the cat indices API to get the following information for each index in a + * cluster: shard count; document count; deleted document count; primary store + * size; total store size of all shards, including shard replicas. These metrics + * are retrieved directly from Lucene, which Elasticsearch uses internally to + * power indexing and search. As a result, all document counts include hidden + * nested documents. To get an accurate count of Elasticsearch documents, use + * the cat count or count APIs. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-indices.html">Documentation * on elastic.co */ @@ -240,14 +285,23 @@ public CompletableFuture indices(IndicesRequest request) { } /** - * Returns information about indices: number of primaries and replicas, document - * counts, disk size, ... + * Returns high-level information about indices in a cluster, including backing + * indices for data streams. IMPORTANT: cat APIs are only intended for human + * consumption using the command line or Kibana console. They are not intended + * for use by applications. For application consumption, use the get index API. + * Use the cat indices API to get the following information for each index in a + * cluster: shard count; document count; deleted document count; primary store + * size; total store size of all shards, including shard replicas. These metrics + * are retrieved directly from Lucene, which Elasticsearch uses internally to + * power indexing and search. As a result, all document counts include hidden + * nested documents. To get an accurate count of Elasticsearch documents, use + * the cat count or count APIs. * * @param fn * a function that initializes a builder to create the * {@link IndicesRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-indices.html">Documentation * on elastic.co */ @@ -257,11 +311,20 @@ public final CompletableFuture indices( } /** - * Returns information about indices: number of primaries and replicas, document - * counts, disk size, ... + * Returns high-level information about indices in a cluster, including backing + * indices for data streams. IMPORTANT: cat APIs are only intended for human + * consumption using the command line or Kibana console. They are not intended + * for use by applications. For application consumption, use the get index API. + * Use the cat indices API to get the following information for each index in a + * cluster: shard count; document count; deleted document count; primary store + * size; total store size of all shards, including shard replicas. These metrics + * are retrieved directly from Lucene, which Elasticsearch uses internally to + * power indexing and search. As a result, all document counts include hidden + * nested documents. To get an accurate count of Elasticsearch documents, use + * the cat count or count APIs. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-indices.html">Documentation * on elastic.co */ @@ -273,10 +336,15 @@ public CompletableFuture indices() { // ----- Endpoint: cat.ml_data_frame_analytics /** - * Gets configuration and usage information about data frame analytics jobs. + * Returns configuration and usage information about data frame analytics jobs. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get data frame analytics jobs statistics + * API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-dfanalytics.html">Documentation * on elastic.co */ @@ -288,13 +356,18 @@ public CompletableFuture mlDataFrameAnalytics(MlDa } /** - * Gets configuration and usage information about data frame analytics jobs. + * Returns configuration and usage information about data frame analytics jobs. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get data frame analytics jobs statistics + * API. * * @param fn * a function that initializes a builder to create the * {@link MlDataFrameAnalyticsRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-dfanalytics.html">Documentation * on elastic.co */ @@ -304,10 +377,15 @@ public final CompletableFuture mlDataFrameAnalytic } /** - * Gets configuration and usage information about data frame analytics jobs. + * Returns configuration and usage information about data frame analytics jobs. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get data frame analytics jobs statistics + * API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-dfanalytics.html">Documentation * on elastic.co */ @@ -319,10 +397,18 @@ public CompletableFuture mlDataFrameAnalytics() { // ----- Endpoint: cat.ml_datafeeds /** - * Gets configuration and usage information about datafeeds. + * Returns configuration and usage information about datafeeds. This API returns + * a maximum of 10,000 datafeeds. If the Elasticsearch security features are + * enabled, you must have monitor_ml, monitor, + * manage_ml, or manage cluster privileges to use this + * API. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get datafeed statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-datafeeds.html">Documentation * on elastic.co */ @@ -334,13 +420,21 @@ public CompletableFuture mlDatafeeds(MlDatafeedsRequest req } /** - * Gets configuration and usage information about datafeeds. + * Returns configuration and usage information about datafeeds. This API returns + * a maximum of 10,000 datafeeds. If the Elasticsearch security features are + * enabled, you must have monitor_ml, monitor, + * manage_ml, or manage cluster privileges to use this + * API. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get datafeed statistics API. * * @param fn * a function that initializes a builder to create the * {@link MlDatafeedsRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-datafeeds.html">Documentation * on elastic.co */ @@ -350,10 +444,18 @@ public final CompletableFuture mlDatafeeds( } /** - * Gets configuration and usage information about datafeeds. + * Returns configuration and usage information about datafeeds. This API returns + * a maximum of 10,000 datafeeds. If the Elasticsearch security features are + * enabled, you must have monitor_ml, monitor, + * manage_ml, or manage cluster privileges to use this + * API. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get datafeed statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-datafeeds.html">Documentation * on elastic.co */ @@ -365,10 +467,18 @@ public CompletableFuture mlDatafeeds() { // ----- Endpoint: cat.ml_jobs /** - * Gets configuration and usage information about anomaly detection jobs. + * Returns configuration and usage information for anomaly detection jobs. This + * API returns a maximum of 10,000 jobs. If the Elasticsearch security features + * are enabled, you must have monitor_ml, monitor, + * manage_ml, or manage cluster privileges to use this + * API. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get anomaly detection job statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-anomaly-detectors.html">Documentation * on elastic.co */ @@ -380,13 +490,21 @@ public CompletableFuture mlJobs(MlJobsRequest request) { } /** - * Gets configuration and usage information about anomaly detection jobs. + * Returns configuration and usage information for anomaly detection jobs. This + * API returns a maximum of 10,000 jobs. If the Elasticsearch security features + * are enabled, you must have monitor_ml, monitor, + * manage_ml, or manage cluster privileges to use this + * API. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get anomaly detection job statistics API. * * @param fn * a function that initializes a builder to create the * {@link MlJobsRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-anomaly-detectors.html">Documentation * on elastic.co */ @@ -396,10 +514,18 @@ public final CompletableFuture mlJobs( } /** - * Gets configuration and usage information about anomaly detection jobs. + * Returns configuration and usage information for anomaly detection jobs. This + * API returns a maximum of 10,000 jobs. If the Elasticsearch security features + * are enabled, you must have monitor_ml, monitor, + * manage_ml, or manage cluster privileges to use this + * API. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get anomaly detection job statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-anomaly-detectors.html">Documentation * on elastic.co */ @@ -411,10 +537,14 @@ public CompletableFuture mlJobs() { // ----- Endpoint: cat.ml_trained_models /** - * Gets configuration and usage information about inference trained models. + * Returns configuration and usage information about inference trained models. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get trained models statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-trained-model.html">Documentation * on elastic.co */ @@ -426,13 +556,17 @@ public CompletableFuture mlTrainedModels(MlTrainedModel } /** - * Gets configuration and usage information about inference trained models. + * Returns configuration and usage information about inference trained models. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get trained models statistics API. * * @param fn * a function that initializes a builder to create the * {@link MlTrainedModelsRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-trained-model.html">Documentation * on elastic.co */ @@ -442,10 +576,14 @@ public final CompletableFuture mlTrainedModels( } /** - * Gets configuration and usage information about inference trained models. + * Returns configuration and usage information about inference trained models. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get trained models statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-trained-model.html">Documentation * on elastic.co */ @@ -457,10 +595,14 @@ public CompletableFuture mlTrainedModels() { // ----- Endpoint: cat.transforms /** - * Gets configuration and usage information about transforms. + * Returns configuration and usage information about transforms. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get transform statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-transforms.html">Documentation * on elastic.co */ @@ -472,13 +614,17 @@ public CompletableFuture transforms(TransformsRequest reques } /** - * Gets configuration and usage information about transforms. + * Returns configuration and usage information about transforms. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get transform statistics API. * * @param fn * a function that initializes a builder to create the * {@link TransformsRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-transforms.html">Documentation * on elastic.co */ @@ -488,10 +634,14 @@ public final CompletableFuture transforms( } /** - * Gets configuration and usage information about transforms. + * Returns configuration and usage information about transforms. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get transform statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-transforms.html">Documentation * on elastic.co */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatClient.java index d1a2bbbfa..9483c56ee 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatClient.java @@ -68,11 +68,14 @@ public ElasticsearchCatClient withTransportOptions(@Nullable TransportOptions tr // ----- Endpoint: cat.aliases /** - * Shows information about currently configured aliases to indices including - * filter and routing infos. + * Retrieves the cluster’s index aliases, including filter and routing + * information. The API does not return data stream aliases. IMPORTANT: cat APIs + * are only intended for human consumption using the command line or the Kibana + * console. They are not intended for use by applications. For application + * consumption, use the aliases API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-alias.html">Documentation * on elastic.co */ @@ -84,14 +87,17 @@ public AliasesResponse aliases(AliasesRequest request) throws IOException, Elast } /** - * Shows information about currently configured aliases to indices including - * filter and routing infos. + * Retrieves the cluster’s index aliases, including filter and routing + * information. The API does not return data stream aliases. IMPORTANT: cat APIs + * are only intended for human consumption using the command line or the Kibana + * console. They are not intended for use by applications. For application + * consumption, use the aliases API. * * @param fn * a function that initializes a builder to create the * {@link AliasesRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-alias.html">Documentation * on elastic.co */ @@ -101,11 +107,14 @@ public final AliasesResponse aliases(FunctionDocumentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-alias.html">Documentation * on elastic.co */ @@ -117,7 +126,12 @@ public AliasesResponse aliases() throws IOException, ElasticsearchException { // ----- Endpoint: cat.component_templates /** - * Returns information about existing component_templates templates. + * Returns information about component templates in a cluster. Component + * templates are building blocks for constructing index templates that specify + * index mappings, settings, and aliases. IMPORTANT: cat APIs are only intended + * for human consumption using the command line or Kibana console. They are not + * intended for use by applications. For application consumption, use the get + * component template API. * * @see Documentation @@ -133,7 +147,12 @@ public ComponentTemplatesResponse componentTemplates(ComponentTemplatesRequest r } /** - * Returns information about existing component_templates templates. + * Returns information about component templates in a cluster. Component + * templates are building blocks for constructing index templates that specify + * index mappings, settings, and aliases. IMPORTANT: cat APIs are only intended + * for human consumption using the command line or Kibana console. They are not + * intended for use by applications. For application consumption, use the get + * component template API. * * @param fn * a function that initializes a builder to create the @@ -150,7 +169,12 @@ public final ComponentTemplatesResponse componentTemplates( } /** - * Returns information about existing component_templates templates. + * Returns information about component templates in a cluster. Component + * templates are building blocks for constructing index templates that specify + * index mappings, settings, and aliases. IMPORTANT: cat APIs are only intended + * for human consumption using the command line or Kibana console. They are not + * intended for use by applications. For application consumption, use the get + * component template API. * * @see Documentation @@ -165,11 +189,15 @@ public ComponentTemplatesResponse componentTemplates() throws IOException, Elast // ----- Endpoint: cat.count /** - * Provides quick access to the document count of the entire cluster, or - * individual indices. + * Provides quick access to a document count for a data stream, an index, or an + * entire cluster. NOTE: The document count only includes live documents, not + * deleted documents which have not yet been removed by the merge process. + * IMPORTANT: cat APIs are only intended for human consumption using the command + * line or Kibana console. They are not intended for use by applications. For + * application consumption, use the count API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-count.html">Documentation * on elastic.co */ @@ -181,14 +209,18 @@ public CountResponse count(CountRequest request) throws IOException, Elasticsear } /** - * Provides quick access to the document count of the entire cluster, or - * individual indices. + * Provides quick access to a document count for a data stream, an index, or an + * entire cluster. NOTE: The document count only includes live documents, not + * deleted documents which have not yet been removed by the merge process. + * IMPORTANT: cat APIs are only intended for human consumption using the command + * line or Kibana console. They are not intended for use by applications. For + * application consumption, use the count API. * * @param fn * a function that initializes a builder to create the * {@link CountRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-count.html">Documentation * on elastic.co */ @@ -198,11 +230,15 @@ public final CountResponse count(FunctionDocumentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-count.html">Documentation * on elastic.co */ @@ -217,7 +253,7 @@ public CountResponse count() throws IOException, ElasticsearchException { * Returns help for the Cat APIs. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat.html">Documentation * on elastic.co */ public HelpResponse help() throws IOException, ElasticsearchException { @@ -227,11 +263,20 @@ public HelpResponse help() throws IOException, ElasticsearchException { // ----- Endpoint: cat.indices /** - * Returns information about indices: number of primaries and replicas, document - * counts, disk size, ... + * Returns high-level information about indices in a cluster, including backing + * indices for data streams. IMPORTANT: cat APIs are only intended for human + * consumption using the command line or Kibana console. They are not intended + * for use by applications. For application consumption, use the get index API. + * Use the cat indices API to get the following information for each index in a + * cluster: shard count; document count; deleted document count; primary store + * size; total store size of all shards, including shard replicas. These metrics + * are retrieved directly from Lucene, which Elasticsearch uses internally to + * power indexing and search. As a result, all document counts include hidden + * nested documents. To get an accurate count of Elasticsearch documents, use + * the cat count or count APIs. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-indices.html">Documentation * on elastic.co */ @@ -243,14 +288,23 @@ public IndicesResponse indices(IndicesRequest request) throws IOException, Elast } /** - * Returns information about indices: number of primaries and replicas, document - * counts, disk size, ... + * Returns high-level information about indices in a cluster, including backing + * indices for data streams. IMPORTANT: cat APIs are only intended for human + * consumption using the command line or Kibana console. They are not intended + * for use by applications. For application consumption, use the get index API. + * Use the cat indices API to get the following information for each index in a + * cluster: shard count; document count; deleted document count; primary store + * size; total store size of all shards, including shard replicas. These metrics + * are retrieved directly from Lucene, which Elasticsearch uses internally to + * power indexing and search. As a result, all document counts include hidden + * nested documents. To get an accurate count of Elasticsearch documents, use + * the cat count or count APIs. * * @param fn * a function that initializes a builder to create the * {@link IndicesRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-indices.html">Documentation * on elastic.co */ @@ -260,11 +314,20 @@ public final IndicesResponse indices(Function

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get data frame analytics jobs statistics + * API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-dfanalytics.html">Documentation * on elastic.co */ @@ -292,13 +360,18 @@ public MlDataFrameAnalyticsResponse mlDataFrameAnalytics(MlDataFrameAnalyticsReq } /** - * Gets configuration and usage information about data frame analytics jobs. + * Returns configuration and usage information about data frame analytics jobs. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get data frame analytics jobs statistics + * API. * * @param fn * a function that initializes a builder to create the * {@link MlDataFrameAnalyticsRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-dfanalytics.html">Documentation * on elastic.co */ @@ -309,10 +382,15 @@ public final MlDataFrameAnalyticsResponse mlDataFrameAnalytics( } /** - * Gets configuration and usage information about data frame analytics jobs. + * Returns configuration and usage information about data frame analytics jobs. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get data frame analytics jobs statistics + * API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-dfanalytics.html">Documentation * on elastic.co */ @@ -324,10 +402,18 @@ public MlDataFrameAnalyticsResponse mlDataFrameAnalytics() throws IOException, E // ----- Endpoint: cat.ml_datafeeds /** - * Gets configuration and usage information about datafeeds. + * Returns configuration and usage information about datafeeds. This API returns + * a maximum of 10,000 datafeeds. If the Elasticsearch security features are + * enabled, you must have monitor_ml, monitor, + * manage_ml, or manage cluster privileges to use this + * API. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get datafeed statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-datafeeds.html">Documentation * on elastic.co */ @@ -339,13 +425,21 @@ public MlDatafeedsResponse mlDatafeeds(MlDatafeedsRequest request) throws IOExce } /** - * Gets configuration and usage information about datafeeds. + * Returns configuration and usage information about datafeeds. This API returns + * a maximum of 10,000 datafeeds. If the Elasticsearch security features are + * enabled, you must have monitor_ml, monitor, + * manage_ml, or manage cluster privileges to use this + * API. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get datafeed statistics API. * * @param fn * a function that initializes a builder to create the * {@link MlDatafeedsRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-datafeeds.html">Documentation * on elastic.co */ @@ -356,10 +450,18 @@ public final MlDatafeedsResponse mlDatafeeds( } /** - * Gets configuration and usage information about datafeeds. + * Returns configuration and usage information about datafeeds. This API returns + * a maximum of 10,000 datafeeds. If the Elasticsearch security features are + * enabled, you must have monitor_ml, monitor, + * manage_ml, or manage cluster privileges to use this + * API. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get datafeed statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-datafeeds.html">Documentation * on elastic.co */ @@ -371,10 +473,18 @@ public MlDatafeedsResponse mlDatafeeds() throws IOException, ElasticsearchExcept // ----- Endpoint: cat.ml_jobs /** - * Gets configuration and usage information about anomaly detection jobs. + * Returns configuration and usage information for anomaly detection jobs. This + * API returns a maximum of 10,000 jobs. If the Elasticsearch security features + * are enabled, you must have monitor_ml, monitor, + * manage_ml, or manage cluster privileges to use this + * API. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get anomaly detection job statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-anomaly-detectors.html">Documentation * on elastic.co */ @@ -386,13 +496,21 @@ public MlJobsResponse mlJobs(MlJobsRequest request) throws IOException, Elastics } /** - * Gets configuration and usage information about anomaly detection jobs. + * Returns configuration and usage information for anomaly detection jobs. This + * API returns a maximum of 10,000 jobs. If the Elasticsearch security features + * are enabled, you must have monitor_ml, monitor, + * manage_ml, or manage cluster privileges to use this + * API. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get anomaly detection job statistics API. * * @param fn * a function that initializes a builder to create the * {@link MlJobsRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-anomaly-detectors.html">Documentation * on elastic.co */ @@ -402,10 +520,18 @@ public final MlJobsResponse mlJobs(Functionmonitor_ml, monitor, + * manage_ml, or manage cluster privileges to use this + * API. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get anomaly detection job statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-anomaly-detectors.html">Documentation * on elastic.co */ @@ -417,10 +543,14 @@ public MlJobsResponse mlJobs() throws IOException, ElasticsearchException { // ----- Endpoint: cat.ml_trained_models /** - * Gets configuration and usage information about inference trained models. + * Returns configuration and usage information about inference trained models. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get trained models statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-trained-model.html">Documentation * on elastic.co */ @@ -433,13 +563,17 @@ public MlTrainedModelsResponse mlTrainedModels(MlTrainedModelsRequest request) } /** - * Gets configuration and usage information about inference trained models. + * Returns configuration and usage information about inference trained models. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get trained models statistics API. * * @param fn * a function that initializes a builder to create the * {@link MlTrainedModelsRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-trained-model.html">Documentation * on elastic.co */ @@ -450,10 +584,14 @@ public final MlTrainedModelsResponse mlTrainedModels( } /** - * Gets configuration and usage information about inference trained models. + * Returns configuration and usage information about inference trained models. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get trained models statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-trained-model.html">Documentation * on elastic.co */ @@ -465,10 +603,14 @@ public MlTrainedModelsResponse mlTrainedModels() throws IOException, Elasticsear // ----- Endpoint: cat.transforms /** - * Gets configuration and usage information about transforms. + * Returns configuration and usage information about transforms. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get transform statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-transforms.html">Documentation * on elastic.co */ @@ -480,13 +622,17 @@ public TransformsResponse transforms(TransformsRequest request) throws IOExcepti } /** - * Gets configuration and usage information about transforms. + * Returns configuration and usage information about transforms. + *

+ * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get transform statistics API. * * @param fn * a function that initializes a builder to create the * {@link TransformsRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-transforms.html">Documentation * on elastic.co */ @@ -496,10 +642,14 @@ public final TransformsResponse transforms(Function + * IMPORTANT: cat APIs are only intended for human consumption using the Kibana + * console or command line. They are not intended for use by applications. For + * application consumption, use the get transform statistics API. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cat-transforms.html">Documentation * on elastic.co */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ClusterStatsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ClusterStatsRequest.java deleted file mode 100644 index c6336c710..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ClusterStatsRequest.java +++ /dev/null @@ -1,286 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -// typedef: cluster.stats.Request - -/** - * Returns cluster statistics. It returns basic index metrics (shard numbers, - * store size, memory usage) and information about the current nodes that form - * the cluster (number, roles, os, jvm versions, memory usage, cpu and installed - * plugins). - * - * @see API - * specification - */ - -public class ClusterStatsRequest extends RequestBase { - @Nullable - private final Boolean flatSettings; - - private final List nodeId; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private ClusterStatsRequest(Builder builder) { - - this.flatSettings = builder.flatSettings; - this.nodeId = ApiTypeHelper.unmodifiable(builder.nodeId); - this.timeout = builder.timeout; - - } - - public static ClusterStatsRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - @Nullable - public final Boolean flatSettings() { - return this.flatSettings; - } - - /** - * Comma-separated list of node filters used to limit returned information. - * Defaults to all nodes in the cluster. - *

- * API name: {@code node_id} - */ - public final List nodeId() { - return this.nodeId; - } - - /** - * Period to wait for each node to respond. If a node does not respond before - * its timeout expires, the response does not include its stats. However, timed - * out nodes are included in the response’s _nodes.failed property. - * Defaults to no timeout. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterStatsRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean flatSettings; - - @Nullable - private List nodeId; - - @Nullable - private Time timeout; - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - public final Builder flatSettings(@Nullable Boolean value) { - this.flatSettings = value; - return this; - } - - /** - * Comma-separated list of node filters used to limit returned information. - * Defaults to all nodes in the cluster. - *

- * API name: {@code node_id} - *

- * Adds all elements of list to nodeId. - */ - public final Builder nodeId(List list) { - this.nodeId = _listAddAll(this.nodeId, list); - return this; - } - - /** - * Comma-separated list of node filters used to limit returned information. - * Defaults to all nodes in the cluster. - *

- * API name: {@code node_id} - *

- * Adds one or more values to nodeId. - */ - public final Builder nodeId(String value, String... values) { - this.nodeId = _listAdd(this.nodeId, value, values); - return this; - } - - /** - * Period to wait for each node to respond. If a node does not respond before - * its timeout expires, the response does not include its stats. However, timed - * out nodes are included in the response’s _nodes.failed property. - * Defaults to no timeout. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for each node to respond. If a node does not respond before - * its timeout expires, the response does not include its stats. However, timed - * out nodes are included in the response’s _nodes.failed property. - * Defaults to no timeout. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterStatsRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterStatsRequest build() { - _checkSingleUse(); - - return new ClusterStatsRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cluster.stats}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/cluster.stats", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _nodeId = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.nodeId())) - propsSet |= _nodeId; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cluster"); - buf.append("/stats"); - return buf.toString(); - } - if (propsSet == (_nodeId)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_cluster"); - buf.append("/stats"); - buf.append("/nodes"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.nodeId.stream().map(v -> v).collect(Collectors.joining(",")), - buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _nodeId = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.nodeId())) - propsSet |= _nodeId; - - if (propsSet == 0) { - } - if (propsSet == (_nodeId)) { - params.put("nodeId", request.nodeId.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, ClusterStatsResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ElasticsearchClusterAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ElasticsearchClusterAsyncClient.java index 657a0f53c..b0f39a2b1 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ElasticsearchClusterAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ElasticsearchClusterAsyncClient.java @@ -71,10 +71,12 @@ public ElasticsearchClusterAsyncClient withTransportOptions(@Nullable TransportO // ----- Endpoint: cluster.delete_component_template /** - * Deletes a component template + * Deletes component templates. Component templates are building blocks for + * constructing index templates that specify index mappings, settings, and + * aliases. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -87,13 +89,15 @@ public CompletableFuture deleteComponentTemplat } /** - * Deletes a component template + * Deletes component templates. Component templates are building blocks for + * constructing index templates that specify index mappings, settings, and + * aliases. * * @param fn * a function that initializes a builder to create the * {@link DeleteComponentTemplateRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -108,7 +112,7 @@ public final CompletableFuture deleteComponentT * Returns information about whether a particular component template exist * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -126,7 +130,7 @@ public CompletableFuture existsComponentTemplate(ExistsComponen * a function that initializes a builder to create the * {@link ExistsComponentTemplateRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -138,10 +142,10 @@ public final CompletableFuture existsComponentTemplate( // ----- Endpoint: cluster.get_component_template /** - * Returns one or more component templates + * Retrieves information about component templates. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -153,13 +157,13 @@ public CompletableFuture getComponentTemplate(GetC } /** - * Returns one or more component templates + * Retrieves information about component templates. * * @param fn * a function that initializes a builder to create the * {@link GetComponentTemplateRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -169,10 +173,10 @@ public final CompletableFuture getComponentTemplat } /** - * Returns one or more component templates + * Retrieves information about component templates. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -187,7 +191,7 @@ public CompletableFuture getComponentTemplate() { * Returns different information about the cluster. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cluster-info.html">Documentation * on elastic.co */ @@ -205,7 +209,7 @@ public CompletableFuture info(ClusterInfoRequest request) { * a function that initializes a builder to create the * {@link ClusterInfoRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cluster-info.html">Documentation * on elastic.co */ @@ -217,10 +221,30 @@ public final CompletableFuture info( // ----- Endpoint: cluster.put_component_template /** - * Creates or updates a component template + * Creates or updates a component template. Component templates are building + * blocks for constructing index templates that specify index mappings, + * settings, and aliases. + *

+ * An index template can be composed of multiple component templates. To use a + * component template, specify it in an index template’s + * composed_of list. Component templates are only applied to new + * data streams and indices as part of a matching index template. + *

+ * Settings and mappings specified directly in the index template or the create + * index request override any settings or mappings specified in a component + * template. + *

+ * Component templates are only used during index creation. For data streams, + * this includes data stream creation and the creation of a stream’s backing + * indices. Changes to component templates do not affect existing indices, + * including a stream’s backing indices. + *

+ * You can use C-style /* *\/ block comments in component + * templates. You can include comments anywhere in the request body except + * before the opening curly bracket. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -232,13 +256,33 @@ public CompletableFuture putComponentTemplate(PutC } /** - * Creates or updates a component template + * Creates or updates a component template. Component templates are building + * blocks for constructing index templates that specify index mappings, + * settings, and aliases. + *

+ * An index template can be composed of multiple component templates. To use a + * component template, specify it in an index template’s + * composed_of list. Component templates are only applied to new + * data streams and indices as part of a matching index template. + *

+ * Settings and mappings specified directly in the index template or the create + * index request override any settings or mappings specified in a component + * template. + *

+ * Component templates are only used during index creation. For data streams, + * this includes data stream creation and the creation of a stream’s backing + * indices. Changes to component templates do not affect existing indices, + * including a stream’s backing indices. + *

+ * You can use C-style /* *\/ block comments in component + * templates. You can include comments anywhere in the request body except + * before the opening curly bracket. * * @param fn * a function that initializes a builder to create the * {@link PutComponentTemplateRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ElasticsearchClusterClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ElasticsearchClusterClient.java index e203bd5a6..5fb7be1cf 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ElasticsearchClusterClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ElasticsearchClusterClient.java @@ -69,10 +69,12 @@ public ElasticsearchClusterClient withTransportOptions(@Nullable TransportOption // ----- Endpoint: cluster.delete_component_template /** - * Deletes a component template + * Deletes component templates. Component templates are building blocks for + * constructing index templates that specify index mappings, settings, and + * aliases. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -85,13 +87,15 @@ public DeleteComponentTemplateResponse deleteComponentTemplate(DeleteComponentTe } /** - * Deletes a component template + * Deletes component templates. Component templates are building blocks for + * constructing index templates that specify index mappings, settings, and + * aliases. * * @param fn * a function that initializes a builder to create the * {@link DeleteComponentTemplateRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -107,7 +111,7 @@ public final DeleteComponentTemplateResponse deleteComponentTemplate( * Returns information about whether a particular component template exist * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -126,7 +130,7 @@ public BooleanResponse existsComponentTemplate(ExistsComponentTemplateRequest re * a function that initializes a builder to create the * {@link ExistsComponentTemplateRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -139,10 +143,10 @@ public final BooleanResponse existsComponentTemplate( // ----- Endpoint: cluster.get_component_template /** - * Returns one or more component templates + * Retrieves information about component templates. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -155,13 +159,13 @@ public GetComponentTemplateResponse getComponentTemplate(GetComponentTemplateReq } /** - * Returns one or more component templates + * Retrieves information about component templates. * * @param fn * a function that initializes a builder to create the * {@link GetComponentTemplateRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -172,10 +176,10 @@ public final GetComponentTemplateResponse getComponentTemplate( } /** - * Returns one or more component templates + * Retrieves information about component templates. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -190,7 +194,7 @@ public GetComponentTemplateResponse getComponentTemplate() throws IOException, E * Returns different information about the cluster. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cluster-info.html">Documentation * on elastic.co */ @@ -208,7 +212,7 @@ public ClusterInfoResponse info(ClusterInfoRequest request) throws IOException, * a function that initializes a builder to create the * {@link ClusterInfoRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/cluster-info.html">Documentation * on elastic.co */ @@ -220,10 +224,30 @@ public final ClusterInfoResponse info(Function + * An index template can be composed of multiple component templates. To use a + * component template, specify it in an index template’s + * composed_of list. Component templates are only applied to new + * data streams and indices as part of a matching index template. + *

+ * Settings and mappings specified directly in the index template or the create + * index request override any settings or mappings specified in a component + * template. + *

+ * Component templates are only used during index creation. For data streams, + * this includes data stream creation and the creation of a stream’s backing + * indices. Changes to component templates do not affect existing indices, + * including a stream’s backing indices. + *

+ * You can use C-style /* *\/ block comments in component + * templates. You can include comments anywhere in the request body except + * before the opening curly bracket. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ @@ -236,13 +260,33 @@ public PutComponentTemplateResponse putComponentTemplate(PutComponentTemplateReq } /** - * Creates or updates a component template + * Creates or updates a component template. Component templates are building + * blocks for constructing index templates that specify index mappings, + * settings, and aliases. + *

+ * An index template can be composed of multiple component templates. To use a + * component template, specify it in an index template’s + * composed_of list. Component templates are only applied to new + * data streams and indices as part of a matching index template. + *

+ * Settings and mappings specified directly in the index template or the create + * index request override any settings or mappings specified in a component + * template. + *

+ * Component templates are only used during index creation. For data streams, + * this includes data stream creation and the creation of a stream’s backing + * indices. Changes to component templates do not affect existing indices, + * including a stream’s backing indices. + *

+ * You can use C-style /* *\/ block comments in component + * templates. You can include comments anywhere in the request body except + * before the opening curly bracket. * * @param fn * a function that initializes a builder to create the * {@link PutComponentTemplateRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-component-template.html">Documentation * on elastic.co */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/GetClusterSettingsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/GetClusterSettingsRequest.java deleted file mode 100644 index 77f24d69e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/GetClusterSettingsRequest.java +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.get_settings.Request - -/** - * Returns cluster-wide settings. By default, it returns only settings that have - * been explicitly defined. - * - * @see API - * specification - */ - -public class GetClusterSettingsRequest extends RequestBase { - @Nullable - private final Boolean flatSettings; - - @Nullable - private final Boolean includeDefaults; - - @Nullable - private final Time masterTimeout; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private GetClusterSettingsRequest(Builder builder) { - - this.flatSettings = builder.flatSettings; - this.includeDefaults = builder.includeDefaults; - this.masterTimeout = builder.masterTimeout; - this.timeout = builder.timeout; - - } - - public static GetClusterSettingsRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - @Nullable - public final Boolean flatSettings() { - return this.flatSettings; - } - - /** - * If true, returns default cluster settings from the local node. - *

- * API name: {@code include_defaults} - */ - @Nullable - public final Boolean includeDefaults() { - return this.includeDefaults; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetClusterSettingsRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean flatSettings; - - @Nullable - private Boolean includeDefaults; - - @Nullable - private Time masterTimeout; - - @Nullable - private Time timeout; - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - public final Builder flatSettings(@Nullable Boolean value) { - this.flatSettings = value; - return this; - } - - /** - * If true, returns default cluster settings from the local node. - *

- * API name: {@code include_defaults} - */ - public final Builder includeDefaults(@Nullable Boolean value) { - this.includeDefaults = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetClusterSettingsRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetClusterSettingsRequest build() { - _checkSingleUse(); - - return new GetClusterSettingsRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cluster.get_settings}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/cluster.get_settings", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - return "/_cluster/settings"; - - }, - - // Path parameters - request -> { - return Collections.emptyMap(); - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.includeDefaults != null) { - params.put("include_defaults", String.valueOf(request.includeDefaults)); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, GetClusterSettingsResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/GetClusterSettingsResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/GetClusterSettingsResponse.java deleted file mode 100644 index 7fe288f9c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/GetClusterSettingsResponse.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster; - -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.get_settings.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GetClusterSettingsResponse implements JsonpSerializable { - private final Map persistent; - - private final Map transient_; - - private final Map defaults; - - // --------------------------------------------------------------------------------------------- - - private GetClusterSettingsResponse(Builder builder) { - - this.persistent = ApiTypeHelper.unmodifiableRequired(builder.persistent, this, "persistent"); - this.transient_ = ApiTypeHelper.unmodifiableRequired(builder.transient_, this, "transient_"); - this.defaults = ApiTypeHelper.unmodifiable(builder.defaults); - - } - - public static GetClusterSettingsResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code persistent} - */ - public final Map persistent() { - return this.persistent; - } - - /** - * Required - API name: {@code transient} - */ - public final Map transient_() { - return this.transient_; - } - - /** - * API name: {@code defaults} - */ - public final Map defaults() { - return this.defaults; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.persistent)) { - generator.writeKey("persistent"); - generator.writeStartObject(); - for (Map.Entry item0 : this.persistent.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.transient_)) { - generator.writeKey("transient"); - generator.writeStartObject(); - for (Map.Entry item0 : this.transient_.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.defaults)) { - generator.writeKey("defaults"); - generator.writeStartObject(); - for (Map.Entry item0 : this.defaults.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetClusterSettingsResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Map persistent; - - private Map transient_; - - @Nullable - private Map defaults; - - /** - * Required - API name: {@code persistent} - *

- * Adds all entries of map to persistent. - */ - public final Builder persistent(Map map) { - this.persistent = _mapPutAll(this.persistent, map); - return this; - } - - /** - * Required - API name: {@code persistent} - *

- * Adds an entry to persistent. - */ - public final Builder persistent(String key, JsonData value) { - this.persistent = _mapPut(this.persistent, key, value); - return this; - } - - /** - * Required - API name: {@code transient} - *

- * Adds all entries of map to transient_. - */ - public final Builder transient_(Map map) { - this.transient_ = _mapPutAll(this.transient_, map); - return this; - } - - /** - * Required - API name: {@code transient} - *

- * Adds an entry to transient_. - */ - public final Builder transient_(String key, JsonData value) { - this.transient_ = _mapPut(this.transient_, key, value); - return this; - } - - /** - * API name: {@code defaults} - *

- * Adds all entries of map to defaults. - */ - public final Builder defaults(Map map) { - this.defaults = _mapPutAll(this.defaults, map); - return this; - } - - /** - * API name: {@code defaults} - *

- * Adds an entry to defaults. - */ - public final Builder defaults(String key, JsonData value) { - this.defaults = _mapPut(this.defaults, key, value); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetClusterSettingsResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetClusterSettingsResponse build() { - _checkSingleUse(); - - return new GetClusterSettingsResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link GetClusterSettingsResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, GetClusterSettingsResponse::setupGetClusterSettingsResponseDeserializer); - - protected static void setupGetClusterSettingsResponseDeserializer( - ObjectDeserializer op) { - - op.add(Builder::persistent, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "persistent"); - op.add(Builder::transient_, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "transient"); - op.add(Builder::defaults, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "defaults"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PendingTasksRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PendingTasksRequest.java deleted file mode 100644 index 4add9d310..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PendingTasksRequest.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.pending_tasks.Request - -/** - * Returns cluster-level changes (such as create index, update mapping, allocate - * or fail shard) that have not yet been executed. NOTE: This API returns a list - * of any pending updates to the cluster state. These are distinct from the - * tasks reported by the Task Management API which include periodic tasks and - * tasks initiated by the user, such as node stats, search queries, or create - * index requests. However, if a user-initiated task such as a create index - * command causes a cluster state update, the activity of this task might be - * reported by both task api and pending cluster tasks API. - * - * @see API - * specification - */ - -public class PendingTasksRequest extends RequestBase { - @Nullable - private final Boolean local; - - @Nullable - private final Time masterTimeout; - - // --------------------------------------------------------------------------------------------- - - private PendingTasksRequest(Builder builder) { - - this.local = builder.local; - this.masterTimeout = builder.masterTimeout; - - } - - public static PendingTasksRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If true, the request retrieves information from the local node - * only. If false, information is retrieved from the master node. - *

- * API name: {@code local} - */ - @Nullable - public final Boolean local() { - return this.local; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PendingTasksRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean local; - - @Nullable - private Time masterTimeout; - - /** - * If true, the request retrieves information from the local node - * only. If false, information is retrieved from the master node. - *

- * API name: {@code local} - */ - public final Builder local(@Nullable Boolean value) { - this.local = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PendingTasksRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PendingTasksRequest build() { - _checkSingleUse(); - - return new PendingTasksRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cluster.pending_tasks}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/cluster.pending_tasks", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - return "/_cluster/pending_tasks"; - - }, - - // Path parameters - request -> { - return Collections.emptyMap(); - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, PendingTasksResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PendingTasksResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PendingTasksResponse.java deleted file mode 100644 index f3628885d..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PendingTasksResponse.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster; - -import co.elastic.clients.elasticsearch.cluster.pending_tasks.PendingTask; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.pending_tasks.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class PendingTasksResponse implements JsonpSerializable { - private final List tasks; - - // --------------------------------------------------------------------------------------------- - - private PendingTasksResponse(Builder builder) { - - this.tasks = ApiTypeHelper.unmodifiableRequired(builder.tasks, this, "tasks"); - - } - - public static PendingTasksResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code tasks} - */ - public final List tasks() { - return this.tasks; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.tasks)) { - generator.writeKey("tasks"); - generator.writeStartArray(); - for (PendingTask item0 : this.tasks) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PendingTasksResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private List tasks; - - /** - * Required - API name: {@code tasks} - *

- * Adds all elements of list to tasks. - */ - public final Builder tasks(List list) { - this.tasks = _listAddAll(this.tasks, list); - return this; - } - - /** - * Required - API name: {@code tasks} - *

- * Adds one or more values to tasks. - */ - public final Builder tasks(PendingTask value, PendingTask... values) { - this.tasks = _listAdd(this.tasks, value, values); - return this; - } - - /** - * Required - API name: {@code tasks} - *

- * Adds a value to tasks using a builder lambda. - */ - public final Builder tasks(Function> fn) { - return tasks(fn.apply(new PendingTask.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PendingTasksResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PendingTasksResponse build() { - _checkSingleUse(); - - return new PendingTasksResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PendingTasksResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PendingTasksResponse::setupPendingTasksResponseDeserializer); - - protected static void setupPendingTasksResponseDeserializer(ObjectDeserializer op) { - - op.add(Builder::tasks, JsonpDeserializer.arrayDeserializer(PendingTask._DESERIALIZER), "tasks"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PutClusterSettingsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PutClusterSettingsRequest.java deleted file mode 100644 index 6d0f7a331..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PutClusterSettingsRequest.java +++ /dev/null @@ -1,355 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.put_settings.Request - -/** - * Updates the cluster settings. - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutClusterSettingsRequest extends RequestBase implements JsonpSerializable { - @Nullable - private final Boolean flatSettings; - - @Nullable - private final Time masterTimeout; - - private final Map persistent; - - @Nullable - private final Time timeout; - - private final Map transient_; - - // --------------------------------------------------------------------------------------------- - - private PutClusterSettingsRequest(Builder builder) { - - this.flatSettings = builder.flatSettings; - this.masterTimeout = builder.masterTimeout; - this.persistent = ApiTypeHelper.unmodifiable(builder.persistent); - this.timeout = builder.timeout; - this.transient_ = ApiTypeHelper.unmodifiable(builder.transient_); - - } - - public static PutClusterSettingsRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Return settings in flat format (default: false) - *

- * API name: {@code flat_settings} - */ - @Nullable - public final Boolean flatSettings() { - return this.flatSettings; - } - - /** - * Explicit operation timeout for connection to master node - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * API name: {@code persistent} - */ - public final Map persistent() { - return this.persistent; - } - - /** - * Explicit operation timeout - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - /** - * API name: {@code transient} - */ - public final Map transient_() { - return this.transient_; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.persistent)) { - generator.writeKey("persistent"); - generator.writeStartObject(); - for (Map.Entry item0 : this.persistent.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.transient_)) { - generator.writeKey("transient"); - generator.writeStartObject(); - for (Map.Entry item0 : this.transient_.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutClusterSettingsRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean flatSettings; - - @Nullable - private Time masterTimeout; - - @Nullable - private Map persistent; - - @Nullable - private Time timeout; - - @Nullable - private Map transient_; - - /** - * Return settings in flat format (default: false) - *

- * API name: {@code flat_settings} - */ - public final Builder flatSettings(@Nullable Boolean value) { - this.flatSettings = value; - return this; - } - - /** - * Explicit operation timeout for connection to master node - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Explicit operation timeout for connection to master node - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code persistent} - *

- * Adds all entries of map to persistent. - */ - public final Builder persistent(Map map) { - this.persistent = _mapPutAll(this.persistent, map); - return this; - } - - /** - * API name: {@code persistent} - *

- * Adds an entry to persistent. - */ - public final Builder persistent(String key, JsonData value) { - this.persistent = _mapPut(this.persistent, key, value); - return this; - } - - /** - * Explicit operation timeout - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Explicit operation timeout - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - /** - * API name: {@code transient} - *

- * Adds all entries of map to transient_. - */ - public final Builder transient_(Map map) { - this.transient_ = _mapPutAll(this.transient_, map); - return this; - } - - /** - * API name: {@code transient} - *

- * Adds an entry to transient_. - */ - public final Builder transient_(String key, JsonData value) { - this.transient_ = _mapPut(this.transient_, key, value); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutClusterSettingsRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutClusterSettingsRequest build() { - _checkSingleUse(); - - return new PutClusterSettingsRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutClusterSettingsRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PutClusterSettingsRequest::setupPutClusterSettingsRequestDeserializer); - - protected static void setupPutClusterSettingsRequestDeserializer( - ObjectDeserializer op) { - - op.add(Builder::persistent, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "persistent"); - op.add(Builder::transient_, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "transient"); - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code cluster.put_settings}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/cluster.put_settings", - - // Request method - request -> { - return "PUT"; - - }, - - // Request path - request -> { - return "/_cluster/settings"; - - }, - - // Path parameters - request -> { - return Collections.emptyMap(); - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), true, PutClusterSettingsResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PutClusterSettingsResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PutClusterSettingsResponse.java deleted file mode 100644 index 7af607a53..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PutClusterSettingsResponse.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponse; -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.put_settings.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class PutClusterSettingsResponse implements AcknowledgedResponse, JsonpSerializable { - private final boolean acknowledged; - - private final Map persistent; - - private final Map transient_; - - // --------------------------------------------------------------------------------------------- - - private PutClusterSettingsResponse(Builder builder) { - - this.acknowledged = ApiTypeHelper.requireNonNull(builder.acknowledged, this, "acknowledged"); - this.persistent = ApiTypeHelper.unmodifiableRequired(builder.persistent, this, "persistent"); - this.transient_ = ApiTypeHelper.unmodifiableRequired(builder.transient_, this, "transient_"); - - } - - public static PutClusterSettingsResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code acknowledged} - */ - public final boolean acknowledged() { - return this.acknowledged; - } - - /** - * Required - API name: {@code persistent} - */ - public final Map persistent() { - return this.persistent; - } - - /** - * Required - API name: {@code transient} - */ - public final Map transient_() { - return this.transient_; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("acknowledged"); - generator.write(this.acknowledged); - - if (ApiTypeHelper.isDefined(this.persistent)) { - generator.writeKey("persistent"); - generator.writeStartObject(); - for (Map.Entry item0 : this.persistent.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.transient_)) { - generator.writeKey("transient"); - generator.writeStartObject(); - for (Map.Entry item0 : this.transient_.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PutClusterSettingsResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Boolean acknowledged; - - private Map persistent; - - private Map transient_; - - /** - * Required - API name: {@code acknowledged} - */ - public final Builder acknowledged(boolean value) { - this.acknowledged = value; - return this; - } - - /** - * Required - API name: {@code persistent} - *

- * Adds all entries of map to persistent. - */ - public final Builder persistent(Map map) { - this.persistent = _mapPutAll(this.persistent, map); - return this; - } - - /** - * Required - API name: {@code persistent} - *

- * Adds an entry to persistent. - */ - public final Builder persistent(String key, JsonData value) { - this.persistent = _mapPut(this.persistent, key, value); - return this; - } - - /** - * Required - API name: {@code transient} - *

- * Adds all entries of map to transient_. - */ - public final Builder transient_(Map map) { - this.transient_ = _mapPutAll(this.transient_, map); - return this; - } - - /** - * Required - API name: {@code transient} - *

- * Adds an entry to transient_. - */ - public final Builder transient_(String key, JsonData value) { - this.transient_ = _mapPut(this.transient_, key, value); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PutClusterSettingsResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PutClusterSettingsResponse build() { - _checkSingleUse(); - - return new PutClusterSettingsResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PutClusterSettingsResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, PutClusterSettingsResponse::setupPutClusterSettingsResponseDeserializer); - - protected static void setupPutClusterSettingsResponseDeserializer( - ObjectDeserializer op) { - - op.add(Builder::acknowledged, JsonpDeserializer.booleanDeserializer(), "acknowledged"); - op.add(Builder::persistent, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "persistent"); - op.add(Builder::transient_, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "transient"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PutComponentTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PutComponentTemplateRequest.java index 11e89e166..1e28d7a92 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PutComponentTemplateRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PutComponentTemplateRequest.java @@ -93,10 +93,10 @@ public class PutComponentTemplateRequest extends RequestBase implements JsonpSer private final Map meta; @Nullable - private final Boolean allowAutoCreate; + private final Boolean create; @Nullable - private final Boolean create; + private final Boolean deprecated; @Nullable private final Time masterTimeout; @@ -113,8 +113,8 @@ public class PutComponentTemplateRequest extends RequestBase implements JsonpSer private PutComponentTemplateRequest(Builder builder) { this.meta = ApiTypeHelper.unmodifiable(builder.meta); - this.allowAutoCreate = builder.allowAutoCreate; this.create = builder.create; + this.deprecated = builder.deprecated; this.masterTimeout = builder.masterTimeout; this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); this.template = ApiTypeHelper.requireNonNull(builder.template, this, "template"); @@ -139,29 +139,26 @@ public final Map meta() { } /** - * This setting overrides the value of the action.auto_create_index - * cluster setting. If set to true in a template, then indices can - * be automatically created using that template even if auto-creation of indices - * is disabled via actions.auto_create_index. If set to - * false then data streams matching the template must always be - * explicitly created. + * If true, this request cannot replace or update existing + * component templates. *

- * API name: {@code allow_auto_create} + * API name: {@code create} */ @Nullable - public final Boolean allowAutoCreate() { - return this.allowAutoCreate; + public final Boolean create() { + return this.create; } /** - * If true, this request cannot replace or update existing - * component templates. + * Marks this index template as deprecated. When creating or updating a + * non-deprecated index template that uses deprecated components, Elasticsearch + * will emit a deprecation warning. *

- * API name: {@code create} + * API name: {@code deprecated} */ @Nullable - public final Boolean create() { - return this.create; + public final Boolean deprecated() { + return this.deprecated; } /** @@ -231,9 +228,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } - if (this.allowAutoCreate != null) { - generator.writeKey("allow_auto_create"); - generator.write(this.allowAutoCreate); + if (this.deprecated != null) { + generator.writeKey("deprecated"); + generator.write(this.deprecated); } generator.writeKey("template"); @@ -260,10 +257,10 @@ public static class Builder extends RequestBase.AbstractBuilder private Map meta; @Nullable - private Boolean allowAutoCreate; + private Boolean create; @Nullable - private Boolean create; + private Boolean deprecated; @Nullable private Time masterTimeout; @@ -306,28 +303,25 @@ public final Builder meta(String key, JsonData value) { } /** - * This setting overrides the value of the action.auto_create_index - * cluster setting. If set to true in a template, then indices can - * be automatically created using that template even if auto-creation of indices - * is disabled via actions.auto_create_index. If set to - * false then data streams matching the template must always be - * explicitly created. + * If true, this request cannot replace or update existing + * component templates. *

- * API name: {@code allow_auto_create} + * API name: {@code create} */ - public final Builder allowAutoCreate(@Nullable Boolean value) { - this.allowAutoCreate = value; + public final Builder create(@Nullable Boolean value) { + this.create = value; return this; } /** - * If true, this request cannot replace or update existing - * component templates. + * Marks this index template as deprecated. When creating or updating a + * non-deprecated index template that uses deprecated components, Elasticsearch + * will emit a deprecation warning. *

- * API name: {@code create} + * API name: {@code deprecated} */ - public final Builder create(@Nullable Boolean value) { - this.create = value; + public final Builder deprecated(@Nullable Boolean value) { + this.deprecated = value; return this; } @@ -428,7 +422,7 @@ protected static void setupPutComponentTemplateRequestDeserializer( ObjectDeserializer op) { op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); - op.add(Builder::allowAutoCreate, JsonpDeserializer.booleanDeserializer(), "allow_auto_create"); + op.add(Builder::deprecated, JsonpDeserializer.booleanDeserializer(), "deprecated"); op.add(Builder::template, IndexState._DESERIALIZER, "template"); op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/pending_tasks/PendingTask.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/pending_tasks/PendingTask.java deleted file mode 100644 index 753065294..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/pending_tasks/PendingTask.java +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.pending_tasks; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.pending_tasks.PendingTask - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class PendingTask implements JsonpSerializable { - private final boolean executing; - - private final int insertOrder; - - private final String priority; - - private final String source; - - @Nullable - private final Time timeInQueue; - - private final long timeInQueueMillis; - - // --------------------------------------------------------------------------------------------- - - private PendingTask(Builder builder) { - - this.executing = ApiTypeHelper.requireNonNull(builder.executing, this, "executing"); - this.insertOrder = ApiTypeHelper.requireNonNull(builder.insertOrder, this, "insertOrder"); - this.priority = ApiTypeHelper.requireNonNull(builder.priority, this, "priority"); - this.source = ApiTypeHelper.requireNonNull(builder.source, this, "source"); - this.timeInQueue = builder.timeInQueue; - this.timeInQueueMillis = ApiTypeHelper.requireNonNull(builder.timeInQueueMillis, this, "timeInQueueMillis"); - - } - - public static PendingTask of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Indicates whether the pending tasks are currently executing or - * not. - *

- * API name: {@code executing} - */ - public final boolean executing() { - return this.executing; - } - - /** - * Required - The number that represents when the task has been inserted into - * the task queue. - *

- * API name: {@code insert_order} - */ - public final int insertOrder() { - return this.insertOrder; - } - - /** - * Required - The priority of the pending task. The valid priorities in - * descending priority order are: IMMEDIATE > - * URGENT > HIGH > NORMAL > - * LOW > LANGUID. - *

- * API name: {@code priority} - */ - public final String priority() { - return this.priority; - } - - /** - * Required - A general description of the cluster task that may include a - * reason and origin. - *

- * API name: {@code source} - */ - public final String source() { - return this.source; - } - - /** - * The time since the task is waiting for being performed. - *

- * API name: {@code time_in_queue} - */ - @Nullable - public final Time timeInQueue() { - return this.timeInQueue; - } - - /** - * Required - The time expressed in milliseconds since the task is waiting for - * being performed. - *

- * API name: {@code time_in_queue_millis} - */ - public final long timeInQueueMillis() { - return this.timeInQueueMillis; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("executing"); - generator.write(this.executing); - - generator.writeKey("insert_order"); - generator.write(this.insertOrder); - - generator.writeKey("priority"); - generator.write(this.priority); - - generator.writeKey("source"); - generator.write(this.source); - - if (this.timeInQueue != null) { - generator.writeKey("time_in_queue"); - this.timeInQueue.serialize(generator, mapper); - - } - generator.writeKey("time_in_queue_millis"); - generator.write(this.timeInQueueMillis); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PendingTask}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Boolean executing; - - private Integer insertOrder; - - private String priority; - - private String source; - - @Nullable - private Time timeInQueue; - - private Long timeInQueueMillis; - - /** - * Required - Indicates whether the pending tasks are currently executing or - * not. - *

- * API name: {@code executing} - */ - public final Builder executing(boolean value) { - this.executing = value; - return this; - } - - /** - * Required - The number that represents when the task has been inserted into - * the task queue. - *

- * API name: {@code insert_order} - */ - public final Builder insertOrder(int value) { - this.insertOrder = value; - return this; - } - - /** - * Required - The priority of the pending task. The valid priorities in - * descending priority order are: IMMEDIATE > - * URGENT > HIGH > NORMAL > - * LOW > LANGUID. - *

- * API name: {@code priority} - */ - public final Builder priority(String value) { - this.priority = value; - return this; - } - - /** - * Required - A general description of the cluster task that may include a - * reason and origin. - *

- * API name: {@code source} - */ - public final Builder source(String value) { - this.source = value; - return this; - } - - /** - * The time since the task is waiting for being performed. - *

- * API name: {@code time_in_queue} - */ - public final Builder timeInQueue(@Nullable Time value) { - this.timeInQueue = value; - return this; - } - - /** - * The time since the task is waiting for being performed. - *

- * API name: {@code time_in_queue} - */ - public final Builder timeInQueue(Function> fn) { - return this.timeInQueue(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - The time expressed in milliseconds since the task is waiting for - * being performed. - *

- * API name: {@code time_in_queue_millis} - */ - public final Builder timeInQueueMillis(long value) { - this.timeInQueueMillis = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link PendingTask}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PendingTask build() { - _checkSingleUse(); - - return new PendingTask(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PendingTask} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - PendingTask::setupPendingTaskDeserializer); - - protected static void setupPendingTaskDeserializer(ObjectDeserializer op) { - - op.add(Builder::executing, JsonpDeserializer.booleanDeserializer(), "executing"); - op.add(Builder::insertOrder, JsonpDeserializer.integerDeserializer(), "insert_order"); - op.add(Builder::priority, JsonpDeserializer.stringDeserializer(), "priority"); - op.add(Builder::source, JsonpDeserializer.stringDeserializer(), "source"); - op.add(Builder::timeInQueue, Time._DESERIALIZER, "time_in_queue"); - op.add(Builder::timeInQueueMillis, JsonpDeserializer.longDeserializer(), "time_in_queue_millis"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/CharFilterTypes.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/CharFilterTypes.java deleted file mode 100644 index 135d8389c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/CharFilterTypes.java +++ /dev/null @@ -1,632 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.CharFilterTypes - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class CharFilterTypes implements JsonpSerializable { - private final List analyzerTypes; - - private final List builtInAnalyzers; - - private final List builtInCharFilters; - - private final List builtInFilters; - - private final List builtInTokenizers; - - private final List charFilterTypes; - - private final List filterTypes; - - private final List tokenizerTypes; - - // --------------------------------------------------------------------------------------------- - - private CharFilterTypes(Builder builder) { - - this.analyzerTypes = ApiTypeHelper.unmodifiableRequired(builder.analyzerTypes, this, "analyzerTypes"); - this.builtInAnalyzers = ApiTypeHelper.unmodifiableRequired(builder.builtInAnalyzers, this, "builtInAnalyzers"); - this.builtInCharFilters = ApiTypeHelper.unmodifiableRequired(builder.builtInCharFilters, this, - "builtInCharFilters"); - this.builtInFilters = ApiTypeHelper.unmodifiableRequired(builder.builtInFilters, this, "builtInFilters"); - this.builtInTokenizers = ApiTypeHelper.unmodifiableRequired(builder.builtInTokenizers, this, - "builtInTokenizers"); - this.charFilterTypes = ApiTypeHelper.unmodifiableRequired(builder.charFilterTypes, this, "charFilterTypes"); - this.filterTypes = ApiTypeHelper.unmodifiableRequired(builder.filterTypes, this, "filterTypes"); - this.tokenizerTypes = ApiTypeHelper.unmodifiableRequired(builder.tokenizerTypes, this, "tokenizerTypes"); - - } - - public static CharFilterTypes of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Contains statistics about analyzer types used in selected nodes. - *

- * API name: {@code analyzer_types} - */ - public final List analyzerTypes() { - return this.analyzerTypes; - } - - /** - * Required - Contains statistics about built-in analyzers used in selected - * nodes. - *

- * API name: {@code built_in_analyzers} - */ - public final List builtInAnalyzers() { - return this.builtInAnalyzers; - } - - /** - * Required - Contains statistics about built-in character filters used in - * selected nodes. - *

- * API name: {@code built_in_char_filters} - */ - public final List builtInCharFilters() { - return this.builtInCharFilters; - } - - /** - * Required - Contains statistics about built-in token filters used in selected - * nodes. - *

- * API name: {@code built_in_filters} - */ - public final List builtInFilters() { - return this.builtInFilters; - } - - /** - * Required - Contains statistics about built-in tokenizers used in selected - * nodes. - *

- * API name: {@code built_in_tokenizers} - */ - public final List builtInTokenizers() { - return this.builtInTokenizers; - } - - /** - * Required - Contains statistics about character filter types used in selected - * nodes. - *

- * API name: {@code char_filter_types} - */ - public final List charFilterTypes() { - return this.charFilterTypes; - } - - /** - * Required - Contains statistics about token filter types used in selected - * nodes. - *

- * API name: {@code filter_types} - */ - public final List filterTypes() { - return this.filterTypes; - } - - /** - * Required - Contains statistics about tokenizer types used in selected nodes. - *

- * API name: {@code tokenizer_types} - */ - public final List tokenizerTypes() { - return this.tokenizerTypes; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.analyzerTypes)) { - generator.writeKey("analyzer_types"); - generator.writeStartArray(); - for (FieldTypes item0 : this.analyzerTypes) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.builtInAnalyzers)) { - generator.writeKey("built_in_analyzers"); - generator.writeStartArray(); - for (FieldTypes item0 : this.builtInAnalyzers) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.builtInCharFilters)) { - generator.writeKey("built_in_char_filters"); - generator.writeStartArray(); - for (FieldTypes item0 : this.builtInCharFilters) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.builtInFilters)) { - generator.writeKey("built_in_filters"); - generator.writeStartArray(); - for (FieldTypes item0 : this.builtInFilters) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.builtInTokenizers)) { - generator.writeKey("built_in_tokenizers"); - generator.writeStartArray(); - for (FieldTypes item0 : this.builtInTokenizers) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.charFilterTypes)) { - generator.writeKey("char_filter_types"); - generator.writeStartArray(); - for (FieldTypes item0 : this.charFilterTypes) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.filterTypes)) { - generator.writeKey("filter_types"); - generator.writeStartArray(); - for (FieldTypes item0 : this.filterTypes) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.tokenizerTypes)) { - generator.writeKey("tokenizer_types"); - generator.writeStartArray(); - for (FieldTypes item0 : this.tokenizerTypes) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link CharFilterTypes}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private List analyzerTypes; - - private List builtInAnalyzers; - - private List builtInCharFilters; - - private List builtInFilters; - - private List builtInTokenizers; - - private List charFilterTypes; - - private List filterTypes; - - private List tokenizerTypes; - - /** - * Required - Contains statistics about analyzer types used in selected nodes. - *

- * API name: {@code analyzer_types} - *

- * Adds all elements of list to analyzerTypes. - */ - public final Builder analyzerTypes(List list) { - this.analyzerTypes = _listAddAll(this.analyzerTypes, list); - return this; - } - - /** - * Required - Contains statistics about analyzer types used in selected nodes. - *

- * API name: {@code analyzer_types} - *

- * Adds one or more values to analyzerTypes. - */ - public final Builder analyzerTypes(FieldTypes value, FieldTypes... values) { - this.analyzerTypes = _listAdd(this.analyzerTypes, value, values); - return this; - } - - /** - * Required - Contains statistics about analyzer types used in selected nodes. - *

- * API name: {@code analyzer_types} - *

- * Adds a value to analyzerTypes using a builder lambda. - */ - public final Builder analyzerTypes(Function> fn) { - return analyzerTypes(fn.apply(new FieldTypes.Builder()).build()); - } - - /** - * Required - Contains statistics about built-in analyzers used in selected - * nodes. - *

- * API name: {@code built_in_analyzers} - *

- * Adds all elements of list to builtInAnalyzers. - */ - public final Builder builtInAnalyzers(List list) { - this.builtInAnalyzers = _listAddAll(this.builtInAnalyzers, list); - return this; - } - - /** - * Required - Contains statistics about built-in analyzers used in selected - * nodes. - *

- * API name: {@code built_in_analyzers} - *

- * Adds one or more values to builtInAnalyzers. - */ - public final Builder builtInAnalyzers(FieldTypes value, FieldTypes... values) { - this.builtInAnalyzers = _listAdd(this.builtInAnalyzers, value, values); - return this; - } - - /** - * Required - Contains statistics about built-in analyzers used in selected - * nodes. - *

- * API name: {@code built_in_analyzers} - *

- * Adds a value to builtInAnalyzers using a builder lambda. - */ - public final Builder builtInAnalyzers(Function> fn) { - return builtInAnalyzers(fn.apply(new FieldTypes.Builder()).build()); - } - - /** - * Required - Contains statistics about built-in character filters used in - * selected nodes. - *

- * API name: {@code built_in_char_filters} - *

- * Adds all elements of list to builtInCharFilters. - */ - public final Builder builtInCharFilters(List list) { - this.builtInCharFilters = _listAddAll(this.builtInCharFilters, list); - return this; - } - - /** - * Required - Contains statistics about built-in character filters used in - * selected nodes. - *

- * API name: {@code built_in_char_filters} - *

- * Adds one or more values to builtInCharFilters. - */ - public final Builder builtInCharFilters(FieldTypes value, FieldTypes... values) { - this.builtInCharFilters = _listAdd(this.builtInCharFilters, value, values); - return this; - } - - /** - * Required - Contains statistics about built-in character filters used in - * selected nodes. - *

- * API name: {@code built_in_char_filters} - *

- * Adds a value to builtInCharFilters using a builder lambda. - */ - public final Builder builtInCharFilters(Function> fn) { - return builtInCharFilters(fn.apply(new FieldTypes.Builder()).build()); - } - - /** - * Required - Contains statistics about built-in token filters used in selected - * nodes. - *

- * API name: {@code built_in_filters} - *

- * Adds all elements of list to builtInFilters. - */ - public final Builder builtInFilters(List list) { - this.builtInFilters = _listAddAll(this.builtInFilters, list); - return this; - } - - /** - * Required - Contains statistics about built-in token filters used in selected - * nodes. - *

- * API name: {@code built_in_filters} - *

- * Adds one or more values to builtInFilters. - */ - public final Builder builtInFilters(FieldTypes value, FieldTypes... values) { - this.builtInFilters = _listAdd(this.builtInFilters, value, values); - return this; - } - - /** - * Required - Contains statistics about built-in token filters used in selected - * nodes. - *

- * API name: {@code built_in_filters} - *

- * Adds a value to builtInFilters using a builder lambda. - */ - public final Builder builtInFilters(Function> fn) { - return builtInFilters(fn.apply(new FieldTypes.Builder()).build()); - } - - /** - * Required - Contains statistics about built-in tokenizers used in selected - * nodes. - *

- * API name: {@code built_in_tokenizers} - *

- * Adds all elements of list to builtInTokenizers. - */ - public final Builder builtInTokenizers(List list) { - this.builtInTokenizers = _listAddAll(this.builtInTokenizers, list); - return this; - } - - /** - * Required - Contains statistics about built-in tokenizers used in selected - * nodes. - *

- * API name: {@code built_in_tokenizers} - *

- * Adds one or more values to builtInTokenizers. - */ - public final Builder builtInTokenizers(FieldTypes value, FieldTypes... values) { - this.builtInTokenizers = _listAdd(this.builtInTokenizers, value, values); - return this; - } - - /** - * Required - Contains statistics about built-in tokenizers used in selected - * nodes. - *

- * API name: {@code built_in_tokenizers} - *

- * Adds a value to builtInTokenizers using a builder lambda. - */ - public final Builder builtInTokenizers(Function> fn) { - return builtInTokenizers(fn.apply(new FieldTypes.Builder()).build()); - } - - /** - * Required - Contains statistics about character filter types used in selected - * nodes. - *

- * API name: {@code char_filter_types} - *

- * Adds all elements of list to charFilterTypes. - */ - public final Builder charFilterTypes(List list) { - this.charFilterTypes = _listAddAll(this.charFilterTypes, list); - return this; - } - - /** - * Required - Contains statistics about character filter types used in selected - * nodes. - *

- * API name: {@code char_filter_types} - *

- * Adds one or more values to charFilterTypes. - */ - public final Builder charFilterTypes(FieldTypes value, FieldTypes... values) { - this.charFilterTypes = _listAdd(this.charFilterTypes, value, values); - return this; - } - - /** - * Required - Contains statistics about character filter types used in selected - * nodes. - *

- * API name: {@code char_filter_types} - *

- * Adds a value to charFilterTypes using a builder lambda. - */ - public final Builder charFilterTypes(Function> fn) { - return charFilterTypes(fn.apply(new FieldTypes.Builder()).build()); - } - - /** - * Required - Contains statistics about token filter types used in selected - * nodes. - *

- * API name: {@code filter_types} - *

- * Adds all elements of list to filterTypes. - */ - public final Builder filterTypes(List list) { - this.filterTypes = _listAddAll(this.filterTypes, list); - return this; - } - - /** - * Required - Contains statistics about token filter types used in selected - * nodes. - *

- * API name: {@code filter_types} - *

- * Adds one or more values to filterTypes. - */ - public final Builder filterTypes(FieldTypes value, FieldTypes... values) { - this.filterTypes = _listAdd(this.filterTypes, value, values); - return this; - } - - /** - * Required - Contains statistics about token filter types used in selected - * nodes. - *

- * API name: {@code filter_types} - *

- * Adds a value to filterTypes using a builder lambda. - */ - public final Builder filterTypes(Function> fn) { - return filterTypes(fn.apply(new FieldTypes.Builder()).build()); - } - - /** - * Required - Contains statistics about tokenizer types used in selected nodes. - *

- * API name: {@code tokenizer_types} - *

- * Adds all elements of list to tokenizerTypes. - */ - public final Builder tokenizerTypes(List list) { - this.tokenizerTypes = _listAddAll(this.tokenizerTypes, list); - return this; - } - - /** - * Required - Contains statistics about tokenizer types used in selected nodes. - *

- * API name: {@code tokenizer_types} - *

- * Adds one or more values to tokenizerTypes. - */ - public final Builder tokenizerTypes(FieldTypes value, FieldTypes... values) { - this.tokenizerTypes = _listAdd(this.tokenizerTypes, value, values); - return this; - } - - /** - * Required - Contains statistics about tokenizer types used in selected nodes. - *

- * API name: {@code tokenizer_types} - *

- * Adds a value to tokenizerTypes using a builder lambda. - */ - public final Builder tokenizerTypes(Function> fn) { - return tokenizerTypes(fn.apply(new FieldTypes.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link CharFilterTypes}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public CharFilterTypes build() { - _checkSingleUse(); - - return new CharFilterTypes(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link CharFilterTypes} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - CharFilterTypes::setupCharFilterTypesDeserializer); - - protected static void setupCharFilterTypesDeserializer(ObjectDeserializer op) { - - op.add(Builder::analyzerTypes, JsonpDeserializer.arrayDeserializer(FieldTypes._DESERIALIZER), "analyzer_types"); - op.add(Builder::builtInAnalyzers, JsonpDeserializer.arrayDeserializer(FieldTypes._DESERIALIZER), - "built_in_analyzers"); - op.add(Builder::builtInCharFilters, JsonpDeserializer.arrayDeserializer(FieldTypes._DESERIALIZER), - "built_in_char_filters"); - op.add(Builder::builtInFilters, JsonpDeserializer.arrayDeserializer(FieldTypes._DESERIALIZER), - "built_in_filters"); - op.add(Builder::builtInTokenizers, JsonpDeserializer.arrayDeserializer(FieldTypes._DESERIALIZER), - "built_in_tokenizers"); - op.add(Builder::charFilterTypes, JsonpDeserializer.arrayDeserializer(FieldTypes._DESERIALIZER), - "char_filter_types"); - op.add(Builder::filterTypes, JsonpDeserializer.arrayDeserializer(FieldTypes._DESERIALIZER), "filter_types"); - op.add(Builder::tokenizerTypes, JsonpDeserializer.arrayDeserializer(FieldTypes._DESERIALIZER), - "tokenizer_types"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterFileSystem.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterFileSystem.java deleted file mode 100644 index bcc7691a6..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterFileSystem.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; - -// typedef: cluster.stats.ClusterFileSystem - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterFileSystem implements JsonpSerializable { - private final long availableInBytes; - - private final long freeInBytes; - - private final long totalInBytes; - - // --------------------------------------------------------------------------------------------- - - private ClusterFileSystem(Builder builder) { - - this.availableInBytes = ApiTypeHelper.requireNonNull(builder.availableInBytes, this, "availableInBytes"); - this.freeInBytes = ApiTypeHelper.requireNonNull(builder.freeInBytes, this, "freeInBytes"); - this.totalInBytes = ApiTypeHelper.requireNonNull(builder.totalInBytes, this, "totalInBytes"); - - } - - public static ClusterFileSystem of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Total number of bytes available to JVM in file stores across all - * selected nodes. Depending on operating system or process-level restrictions, - * this number may be less than nodes.fs.free_in_byes. This is the - * actual amount of free disk space the selected Elasticsearch nodes can use. - *

- * API name: {@code available_in_bytes} - */ - public final long availableInBytes() { - return this.availableInBytes; - } - - /** - * Required - Total number of unallocated bytes in file stores across all - * selected nodes. - *

- * API name: {@code free_in_bytes} - */ - public final long freeInBytes() { - return this.freeInBytes; - } - - /** - * Required - Total size, in bytes, of all file stores across all selected - * nodes. - *

- * API name: {@code total_in_bytes} - */ - public final long totalInBytes() { - return this.totalInBytes; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("available_in_bytes"); - generator.write(this.availableInBytes); - - generator.writeKey("free_in_bytes"); - generator.write(this.freeInBytes); - - generator.writeKey("total_in_bytes"); - generator.write(this.totalInBytes); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterFileSystem}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Long availableInBytes; - - private Long freeInBytes; - - private Long totalInBytes; - - /** - * Required - Total number of bytes available to JVM in file stores across all - * selected nodes. Depending on operating system or process-level restrictions, - * this number may be less than nodes.fs.free_in_byes. This is the - * actual amount of free disk space the selected Elasticsearch nodes can use. - *

- * API name: {@code available_in_bytes} - */ - public final Builder availableInBytes(long value) { - this.availableInBytes = value; - return this; - } - - /** - * Required - Total number of unallocated bytes in file stores across all - * selected nodes. - *

- * API name: {@code free_in_bytes} - */ - public final Builder freeInBytes(long value) { - this.freeInBytes = value; - return this; - } - - /** - * Required - Total size, in bytes, of all file stores across all selected - * nodes. - *

- * API name: {@code total_in_bytes} - */ - public final Builder totalInBytes(long value) { - this.totalInBytes = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterFileSystem}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterFileSystem build() { - _checkSingleUse(); - - return new ClusterFileSystem(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterFileSystem} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ClusterFileSystem::setupClusterFileSystemDeserializer); - - protected static void setupClusterFileSystemDeserializer(ObjectDeserializer op) { - - op.add(Builder::availableInBytes, JsonpDeserializer.longDeserializer(), "available_in_bytes"); - op.add(Builder::freeInBytes, JsonpDeserializer.longDeserializer(), "free_in_bytes"); - op.add(Builder::totalInBytes, JsonpDeserializer.longDeserializer(), "total_in_bytes"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIndices.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIndices.java deleted file mode 100644 index 6aa8c598b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIndices.java +++ /dev/null @@ -1,564 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.elasticsearch._types.CompletionStats; -import co.elastic.clients.elasticsearch._types.DocStats; -import co.elastic.clients.elasticsearch._types.FielddataStats; -import co.elastic.clients.elasticsearch._types.QueryCacheStats; -import co.elastic.clients.elasticsearch._types.SegmentsStats; -import co.elastic.clients.elasticsearch._types.StoreStats; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterIndices - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterIndices implements JsonpSerializable { - private final CharFilterTypes analysis; - - private final CompletionStats completion; - - private final long count; - - private final DocStats docs; - - private final FielddataStats fielddata; - - private final QueryCacheStats queryCache; - - private final SegmentsStats segments; - - private final ClusterIndicesShards shards; - - private final StoreStats store; - - private final FieldTypesMappings mappings; - - private final List versions; - - // --------------------------------------------------------------------------------------------- - - private ClusterIndices(Builder builder) { - - this.analysis = ApiTypeHelper.requireNonNull(builder.analysis, this, "analysis"); - this.completion = ApiTypeHelper.requireNonNull(builder.completion, this, "completion"); - this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); - this.docs = ApiTypeHelper.requireNonNull(builder.docs, this, "docs"); - this.fielddata = ApiTypeHelper.requireNonNull(builder.fielddata, this, "fielddata"); - this.queryCache = ApiTypeHelper.requireNonNull(builder.queryCache, this, "queryCache"); - this.segments = ApiTypeHelper.requireNonNull(builder.segments, this, "segments"); - this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards"); - this.store = ApiTypeHelper.requireNonNull(builder.store, this, "store"); - this.mappings = ApiTypeHelper.requireNonNull(builder.mappings, this, "mappings"); - this.versions = ApiTypeHelper.unmodifiable(builder.versions); - - } - - public static ClusterIndices of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Contains statistics about analyzers and analyzer components used - * in selected nodes. - *

- * API name: {@code analysis} - */ - public final CharFilterTypes analysis() { - return this.analysis; - } - - /** - * Required - Contains statistics about memory used for completion in selected - * nodes. - *

- * API name: {@code completion} - */ - public final CompletionStats completion() { - return this.completion; - } - - /** - * Required - Total number of indices with shards assigned to selected nodes. - *

- * API name: {@code count} - */ - public final long count() { - return this.count; - } - - /** - * Required - Contains counts for documents in selected nodes. - *

- * API name: {@code docs} - */ - public final DocStats docs() { - return this.docs; - } - - /** - * Required - Contains statistics about the field data cache of selected nodes. - *

- * API name: {@code fielddata} - */ - public final FielddataStats fielddata() { - return this.fielddata; - } - - /** - * Required - Contains statistics about the query cache of selected nodes. - *

- * API name: {@code query_cache} - */ - public final QueryCacheStats queryCache() { - return this.queryCache; - } - - /** - * Required - Contains statistics about segments in selected nodes. - *

- * API name: {@code segments} - */ - public final SegmentsStats segments() { - return this.segments; - } - - /** - * Required - Contains statistics about indices with shards assigned to selected - * nodes. - *

- * API name: {@code shards} - */ - public final ClusterIndicesShards shards() { - return this.shards; - } - - /** - * Required - Contains statistics about the size of shards assigned to selected - * nodes. - *

- * API name: {@code store} - */ - public final StoreStats store() { - return this.store; - } - - /** - * Required - Contains statistics about field mappings in selected nodes. - *

- * API name: {@code mappings} - */ - public final FieldTypesMappings mappings() { - return this.mappings; - } - - /** - * Contains statistics about analyzers and analyzer components used in selected - * nodes. - *

- * API name: {@code versions} - */ - public final List versions() { - return this.versions; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("analysis"); - this.analysis.serialize(generator, mapper); - - generator.writeKey("completion"); - this.completion.serialize(generator, mapper); - - generator.writeKey("count"); - generator.write(this.count); - - generator.writeKey("docs"); - this.docs.serialize(generator, mapper); - - generator.writeKey("fielddata"); - this.fielddata.serialize(generator, mapper); - - generator.writeKey("query_cache"); - this.queryCache.serialize(generator, mapper); - - generator.writeKey("segments"); - this.segments.serialize(generator, mapper); - - generator.writeKey("shards"); - this.shards.serialize(generator, mapper); - - generator.writeKey("store"); - this.store.serialize(generator, mapper); - - generator.writeKey("mappings"); - this.mappings.serialize(generator, mapper); - - if (ApiTypeHelper.isDefined(this.versions)) { - generator.writeKey("versions"); - generator.writeStartArray(); - for (IndicesVersions item0 : this.versions) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterIndices}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private CharFilterTypes analysis; - - private CompletionStats completion; - - private Long count; - - private DocStats docs; - - private FielddataStats fielddata; - - private QueryCacheStats queryCache; - - private SegmentsStats segments; - - private ClusterIndicesShards shards; - - private StoreStats store; - - private FieldTypesMappings mappings; - - @Nullable - private List versions; - - /** - * Required - Contains statistics about analyzers and analyzer components used - * in selected nodes. - *

- * API name: {@code analysis} - */ - public final Builder analysis(CharFilterTypes value) { - this.analysis = value; - return this; - } - - /** - * Required - Contains statistics about analyzers and analyzer components used - * in selected nodes. - *

- * API name: {@code analysis} - */ - public final Builder analysis(Function> fn) { - return this.analysis(fn.apply(new CharFilterTypes.Builder()).build()); - } - - /** - * Required - Contains statistics about memory used for completion in selected - * nodes. - *

- * API name: {@code completion} - */ - public final Builder completion(CompletionStats value) { - this.completion = value; - return this; - } - - /** - * Required - Contains statistics about memory used for completion in selected - * nodes. - *

- * API name: {@code completion} - */ - public final Builder completion(Function> fn) { - return this.completion(fn.apply(new CompletionStats.Builder()).build()); - } - - /** - * Required - Total number of indices with shards assigned to selected nodes. - *

- * API name: {@code count} - */ - public final Builder count(long value) { - this.count = value; - return this; - } - - /** - * Required - Contains counts for documents in selected nodes. - *

- * API name: {@code docs} - */ - public final Builder docs(DocStats value) { - this.docs = value; - return this; - } - - /** - * Required - Contains counts for documents in selected nodes. - *

- * API name: {@code docs} - */ - public final Builder docs(Function> fn) { - return this.docs(fn.apply(new DocStats.Builder()).build()); - } - - /** - * Required - Contains statistics about the field data cache of selected nodes. - *

- * API name: {@code fielddata} - */ - public final Builder fielddata(FielddataStats value) { - this.fielddata = value; - return this; - } - - /** - * Required - Contains statistics about the field data cache of selected nodes. - *

- * API name: {@code fielddata} - */ - public final Builder fielddata(Function> fn) { - return this.fielddata(fn.apply(new FielddataStats.Builder()).build()); - } - - /** - * Required - Contains statistics about the query cache of selected nodes. - *

- * API name: {@code query_cache} - */ - public final Builder queryCache(QueryCacheStats value) { - this.queryCache = value; - return this; - } - - /** - * Required - Contains statistics about the query cache of selected nodes. - *

- * API name: {@code query_cache} - */ - public final Builder queryCache(Function> fn) { - return this.queryCache(fn.apply(new QueryCacheStats.Builder()).build()); - } - - /** - * Required - Contains statistics about segments in selected nodes. - *

- * API name: {@code segments} - */ - public final Builder segments(SegmentsStats value) { - this.segments = value; - return this; - } - - /** - * Required - Contains statistics about segments in selected nodes. - *

- * API name: {@code segments} - */ - public final Builder segments(Function> fn) { - return this.segments(fn.apply(new SegmentsStats.Builder()).build()); - } - - /** - * Required - Contains statistics about indices with shards assigned to selected - * nodes. - *

- * API name: {@code shards} - */ - public final Builder shards(ClusterIndicesShards value) { - this.shards = value; - return this; - } - - /** - * Required - Contains statistics about indices with shards assigned to selected - * nodes. - *

- * API name: {@code shards} - */ - public final Builder shards(Function> fn) { - return this.shards(fn.apply(new ClusterIndicesShards.Builder()).build()); - } - - /** - * Required - Contains statistics about the size of shards assigned to selected - * nodes. - *

- * API name: {@code store} - */ - public final Builder store(StoreStats value) { - this.store = value; - return this; - } - - /** - * Required - Contains statistics about the size of shards assigned to selected - * nodes. - *

- * API name: {@code store} - */ - public final Builder store(Function> fn) { - return this.store(fn.apply(new StoreStats.Builder()).build()); - } - - /** - * Required - Contains statistics about field mappings in selected nodes. - *

- * API name: {@code mappings} - */ - public final Builder mappings(FieldTypesMappings value) { - this.mappings = value; - return this; - } - - /** - * Required - Contains statistics about field mappings in selected nodes. - *

- * API name: {@code mappings} - */ - public final Builder mappings(Function> fn) { - return this.mappings(fn.apply(new FieldTypesMappings.Builder()).build()); - } - - /** - * Contains statistics about analyzers and analyzer components used in selected - * nodes. - *

- * API name: {@code versions} - *

- * Adds all elements of list to versions. - */ - public final Builder versions(List list) { - this.versions = _listAddAll(this.versions, list); - return this; - } - - /** - * Contains statistics about analyzers and analyzer components used in selected - * nodes. - *

- * API name: {@code versions} - *

- * Adds one or more values to versions. - */ - public final Builder versions(IndicesVersions value, IndicesVersions... values) { - this.versions = _listAdd(this.versions, value, values); - return this; - } - - /** - * Contains statistics about analyzers and analyzer components used in selected - * nodes. - *

- * API name: {@code versions} - *

- * Adds a value to versions using a builder lambda. - */ - public final Builder versions(Function> fn) { - return versions(fn.apply(new IndicesVersions.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterIndices}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterIndices build() { - _checkSingleUse(); - - return new ClusterIndices(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterIndices} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ClusterIndices::setupClusterIndicesDeserializer); - - protected static void setupClusterIndicesDeserializer(ObjectDeserializer op) { - - op.add(Builder::analysis, CharFilterTypes._DESERIALIZER, "analysis"); - op.add(Builder::completion, CompletionStats._DESERIALIZER, "completion"); - op.add(Builder::count, JsonpDeserializer.longDeserializer(), "count"); - op.add(Builder::docs, DocStats._DESERIALIZER, "docs"); - op.add(Builder::fielddata, FielddataStats._DESERIALIZER, "fielddata"); - op.add(Builder::queryCache, QueryCacheStats._DESERIALIZER, "query_cache"); - op.add(Builder::segments, SegmentsStats._DESERIALIZER, "segments"); - op.add(Builder::shards, ClusterIndicesShards._DESERIALIZER, "shards"); - op.add(Builder::store, StoreStats._DESERIALIZER, "store"); - op.add(Builder::mappings, FieldTypesMappings._DESERIALIZER, "mappings"); - op.add(Builder::versions, JsonpDeserializer.arrayDeserializer(IndicesVersions._DESERIALIZER), "versions"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIndicesShards.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIndicesShards.java deleted file mode 100644 index ec55ac4ea..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIndicesShards.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Double; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterIndicesShards - -/** - * Contains statistics about shards assigned to selected nodes. - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterIndicesShards implements JsonpSerializable { - @Nullable - private final ClusterIndicesShardsIndex index; - - @Nullable - private final Double primaries; - - @Nullable - private final Double replication; - - @Nullable - private final Double total; - - // --------------------------------------------------------------------------------------------- - - private ClusterIndicesShards(Builder builder) { - - this.index = builder.index; - this.primaries = builder.primaries; - this.replication = builder.replication; - this.total = builder.total; - - } - - public static ClusterIndicesShards of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Contains statistics about shards assigned to selected nodes. - *

- * API name: {@code index} - */ - @Nullable - public final ClusterIndicesShardsIndex index() { - return this.index; - } - - /** - * Number of primary shards assigned to selected nodes. - *

- * API name: {@code primaries} - */ - @Nullable - public final Double primaries() { - return this.primaries; - } - - /** - * Ratio of replica shards to primary shards across all selected nodes. - *

- * API name: {@code replication} - */ - @Nullable - public final Double replication() { - return this.replication; - } - - /** - * Total number of shards assigned to selected nodes. - *

- * API name: {@code total} - */ - @Nullable - public final Double total() { - return this.total; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.index != null) { - generator.writeKey("index"); - this.index.serialize(generator, mapper); - - } - if (this.primaries != null) { - generator.writeKey("primaries"); - generator.write(this.primaries); - - } - if (this.replication != null) { - generator.writeKey("replication"); - generator.write(this.replication); - - } - if (this.total != null) { - generator.writeKey("total"); - generator.write(this.total); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterIndicesShards}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private ClusterIndicesShardsIndex index; - - @Nullable - private Double primaries; - - @Nullable - private Double replication; - - @Nullable - private Double total; - - /** - * Contains statistics about shards assigned to selected nodes. - *

- * API name: {@code index} - */ - public final Builder index(@Nullable ClusterIndicesShardsIndex value) { - this.index = value; - return this; - } - - /** - * Contains statistics about shards assigned to selected nodes. - *

- * API name: {@code index} - */ - public final Builder index( - Function> fn) { - return this.index(fn.apply(new ClusterIndicesShardsIndex.Builder()).build()); - } - - /** - * Number of primary shards assigned to selected nodes. - *

- * API name: {@code primaries} - */ - public final Builder primaries(@Nullable Double value) { - this.primaries = value; - return this; - } - - /** - * Ratio of replica shards to primary shards across all selected nodes. - *

- * API name: {@code replication} - */ - public final Builder replication(@Nullable Double value) { - this.replication = value; - return this; - } - - /** - * Total number of shards assigned to selected nodes. - *

- * API name: {@code total} - */ - public final Builder total(@Nullable Double value) { - this.total = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterIndicesShards}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterIndicesShards build() { - _checkSingleUse(); - - return new ClusterIndicesShards(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterIndicesShards} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ClusterIndicesShards::setupClusterIndicesShardsDeserializer); - - protected static void setupClusterIndicesShardsDeserializer(ObjectDeserializer op) { - - op.add(Builder::index, ClusterIndicesShardsIndex._DESERIALIZER, "index"); - op.add(Builder::primaries, JsonpDeserializer.doubleDeserializer(), "primaries"); - op.add(Builder::replication, JsonpDeserializer.doubleDeserializer(), "replication"); - op.add(Builder::total, JsonpDeserializer.doubleDeserializer(), "total"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIndicesShardsIndex.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIndicesShardsIndex.java deleted file mode 100644 index 954b42682..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIndicesShardsIndex.java +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterIndicesShardsIndex - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterIndicesShardsIndex implements JsonpSerializable { - private final ClusterShardMetrics primaries; - - private final ClusterShardMetrics replication; - - private final ClusterShardMetrics shards; - - // --------------------------------------------------------------------------------------------- - - private ClusterIndicesShardsIndex(Builder builder) { - - this.primaries = ApiTypeHelper.requireNonNull(builder.primaries, this, "primaries"); - this.replication = ApiTypeHelper.requireNonNull(builder.replication, this, "replication"); - this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards"); - - } - - public static ClusterIndicesShardsIndex of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Contains statistics about the number of primary shards assigned to - * selected nodes. - *

- * API name: {@code primaries} - */ - public final ClusterShardMetrics primaries() { - return this.primaries; - } - - /** - * Required - Contains statistics about the number of replication shards - * assigned to selected nodes. - *

- * API name: {@code replication} - */ - public final ClusterShardMetrics replication() { - return this.replication; - } - - /** - * Required - Contains statistics about the number of shards assigned to - * selected nodes. - *

- * API name: {@code shards} - */ - public final ClusterShardMetrics shards() { - return this.shards; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("primaries"); - this.primaries.serialize(generator, mapper); - - generator.writeKey("replication"); - this.replication.serialize(generator, mapper); - - generator.writeKey("shards"); - this.shards.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterIndicesShardsIndex}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private ClusterShardMetrics primaries; - - private ClusterShardMetrics replication; - - private ClusterShardMetrics shards; - - /** - * Required - Contains statistics about the number of primary shards assigned to - * selected nodes. - *

- * API name: {@code primaries} - */ - public final Builder primaries(ClusterShardMetrics value) { - this.primaries = value; - return this; - } - - /** - * Required - Contains statistics about the number of primary shards assigned to - * selected nodes. - *

- * API name: {@code primaries} - */ - public final Builder primaries(Function> fn) { - return this.primaries(fn.apply(new ClusterShardMetrics.Builder()).build()); - } - - /** - * Required - Contains statistics about the number of replication shards - * assigned to selected nodes. - *

- * API name: {@code replication} - */ - public final Builder replication(ClusterShardMetrics value) { - this.replication = value; - return this; - } - - /** - * Required - Contains statistics about the number of replication shards - * assigned to selected nodes. - *

- * API name: {@code replication} - */ - public final Builder replication(Function> fn) { - return this.replication(fn.apply(new ClusterShardMetrics.Builder()).build()); - } - - /** - * Required - Contains statistics about the number of shards assigned to - * selected nodes. - *

- * API name: {@code shards} - */ - public final Builder shards(ClusterShardMetrics value) { - this.shards = value; - return this; - } - - /** - * Required - Contains statistics about the number of shards assigned to - * selected nodes. - *

- * API name: {@code shards} - */ - public final Builder shards(Function> fn) { - return this.shards(fn.apply(new ClusterShardMetrics.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterIndicesShardsIndex}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterIndicesShardsIndex build() { - _checkSingleUse(); - - return new ClusterIndicesShardsIndex(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterIndicesShardsIndex} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ClusterIndicesShardsIndex::setupClusterIndicesShardsIndexDeserializer); - - protected static void setupClusterIndicesShardsIndexDeserializer( - ObjectDeserializer op) { - - op.add(Builder::primaries, ClusterShardMetrics._DESERIALIZER, "primaries"); - op.add(Builder::replication, ClusterShardMetrics._DESERIALIZER, "replication"); - op.add(Builder::shards, ClusterShardMetrics._DESERIALIZER, "shards"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIngest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIngest.java deleted file mode 100644 index 35f71d5df..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIngest.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterIngest - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterIngest implements JsonpSerializable { - private final int numberOfPipelines; - - private final Map processorStats; - - // --------------------------------------------------------------------------------------------- - - private ClusterIngest(Builder builder) { - - this.numberOfPipelines = ApiTypeHelper.requireNonNull(builder.numberOfPipelines, this, "numberOfPipelines"); - this.processorStats = ApiTypeHelper.unmodifiableRequired(builder.processorStats, this, "processorStats"); - - } - - public static ClusterIngest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code number_of_pipelines} - */ - public final int numberOfPipelines() { - return this.numberOfPipelines; - } - - /** - * Required - API name: {@code processor_stats} - */ - public final Map processorStats() { - return this.processorStats; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("number_of_pipelines"); - generator.write(this.numberOfPipelines); - - if (ApiTypeHelper.isDefined(this.processorStats)) { - generator.writeKey("processor_stats"); - generator.writeStartObject(); - for (Map.Entry item0 : this.processorStats.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterIngest}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Integer numberOfPipelines; - - private Map processorStats; - - /** - * Required - API name: {@code number_of_pipelines} - */ - public final Builder numberOfPipelines(int value) { - this.numberOfPipelines = value; - return this; - } - - /** - * Required - API name: {@code processor_stats} - *

- * Adds all entries of map to processorStats. - */ - public final Builder processorStats(Map map) { - this.processorStats = _mapPutAll(this.processorStats, map); - return this; - } - - /** - * Required - API name: {@code processor_stats} - *

- * Adds an entry to processorStats. - */ - public final Builder processorStats(String key, ClusterProcessor value) { - this.processorStats = _mapPut(this.processorStats, key, value); - return this; - } - - /** - * Required - API name: {@code processor_stats} - *

- * Adds an entry to processorStats using a builder lambda. - */ - public final Builder processorStats(String key, - Function> fn) { - return processorStats(key, fn.apply(new ClusterProcessor.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterIngest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterIngest build() { - _checkSingleUse(); - - return new ClusterIngest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterIngest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ClusterIngest::setupClusterIngestDeserializer); - - protected static void setupClusterIngestDeserializer(ObjectDeserializer op) { - - op.add(Builder::numberOfPipelines, JsonpDeserializer.integerDeserializer(), "number_of_pipelines"); - op.add(Builder::processorStats, JsonpDeserializer.stringMapDeserializer(ClusterProcessor._DESERIALIZER), - "processor_stats"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterJvm.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterJvm.java deleted file mode 100644 index 6dfb7f62c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterJvm.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterJvm - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterJvm implements JsonpSerializable { - private final long maxUptimeInMillis; - - private final ClusterJvmMemory mem; - - private final long threads; - - private final List versions; - - // --------------------------------------------------------------------------------------------- - - private ClusterJvm(Builder builder) { - - this.maxUptimeInMillis = ApiTypeHelper.requireNonNull(builder.maxUptimeInMillis, this, "maxUptimeInMillis"); - this.mem = ApiTypeHelper.requireNonNull(builder.mem, this, "mem"); - this.threads = ApiTypeHelper.requireNonNull(builder.threads, this, "threads"); - this.versions = ApiTypeHelper.unmodifiableRequired(builder.versions, this, "versions"); - - } - - public static ClusterJvm of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Uptime duration, in milliseconds, since JVM last started. - *

- * API name: {@code max_uptime_in_millis} - */ - public final long maxUptimeInMillis() { - return this.maxUptimeInMillis; - } - - /** - * Required - Contains statistics about memory used by selected nodes. - *

- * API name: {@code mem} - */ - public final ClusterJvmMemory mem() { - return this.mem; - } - - /** - * Required - Number of active threads in use by JVM across all selected nodes. - *

- * API name: {@code threads} - */ - public final long threads() { - return this.threads; - } - - /** - * Required - Contains statistics about the JVM versions used by selected nodes. - *

- * API name: {@code versions} - */ - public final List versions() { - return this.versions; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("max_uptime_in_millis"); - generator.write(this.maxUptimeInMillis); - - generator.writeKey("mem"); - this.mem.serialize(generator, mapper); - - generator.writeKey("threads"); - generator.write(this.threads); - - if (ApiTypeHelper.isDefined(this.versions)) { - generator.writeKey("versions"); - generator.writeStartArray(); - for (ClusterJvmVersion item0 : this.versions) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterJvm}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Long maxUptimeInMillis; - - private ClusterJvmMemory mem; - - private Long threads; - - private List versions; - - /** - * Required - Uptime duration, in milliseconds, since JVM last started. - *

- * API name: {@code max_uptime_in_millis} - */ - public final Builder maxUptimeInMillis(long value) { - this.maxUptimeInMillis = value; - return this; - } - - /** - * Required - Contains statistics about memory used by selected nodes. - *

- * API name: {@code mem} - */ - public final Builder mem(ClusterJvmMemory value) { - this.mem = value; - return this; - } - - /** - * Required - Contains statistics about memory used by selected nodes. - *

- * API name: {@code mem} - */ - public final Builder mem(Function> fn) { - return this.mem(fn.apply(new ClusterJvmMemory.Builder()).build()); - } - - /** - * Required - Number of active threads in use by JVM across all selected nodes. - *

- * API name: {@code threads} - */ - public final Builder threads(long value) { - this.threads = value; - return this; - } - - /** - * Required - Contains statistics about the JVM versions used by selected nodes. - *

- * API name: {@code versions} - *

- * Adds all elements of list to versions. - */ - public final Builder versions(List list) { - this.versions = _listAddAll(this.versions, list); - return this; - } - - /** - * Required - Contains statistics about the JVM versions used by selected nodes. - *

- * API name: {@code versions} - *

- * Adds one or more values to versions. - */ - public final Builder versions(ClusterJvmVersion value, ClusterJvmVersion... values) { - this.versions = _listAdd(this.versions, value, values); - return this; - } - - /** - * Required - Contains statistics about the JVM versions used by selected nodes. - *

- * API name: {@code versions} - *

- * Adds a value to versions using a builder lambda. - */ - public final Builder versions(Function> fn) { - return versions(fn.apply(new ClusterJvmVersion.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterJvm}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterJvm build() { - _checkSingleUse(); - - return new ClusterJvm(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterJvm} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ClusterJvm::setupClusterJvmDeserializer); - - protected static void setupClusterJvmDeserializer(ObjectDeserializer op) { - - op.add(Builder::maxUptimeInMillis, JsonpDeserializer.longDeserializer(), "max_uptime_in_millis"); - op.add(Builder::mem, ClusterJvmMemory._DESERIALIZER, "mem"); - op.add(Builder::threads, JsonpDeserializer.longDeserializer(), "threads"); - op.add(Builder::versions, JsonpDeserializer.arrayDeserializer(ClusterJvmVersion._DESERIALIZER), "versions"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterJvmMemory.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterJvmMemory.java deleted file mode 100644 index 850f9cdb2..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterJvmMemory.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; - -// typedef: cluster.stats.ClusterJvmMemory - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterJvmMemory implements JsonpSerializable { - private final long heapMaxInBytes; - - private final long heapUsedInBytes; - - // --------------------------------------------------------------------------------------------- - - private ClusterJvmMemory(Builder builder) { - - this.heapMaxInBytes = ApiTypeHelper.requireNonNull(builder.heapMaxInBytes, this, "heapMaxInBytes"); - this.heapUsedInBytes = ApiTypeHelper.requireNonNull(builder.heapUsedInBytes, this, "heapUsedInBytes"); - - } - - public static ClusterJvmMemory of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Maximum amount of memory, in bytes, available for use by the heap - * across all selected nodes. - *

- * API name: {@code heap_max_in_bytes} - */ - public final long heapMaxInBytes() { - return this.heapMaxInBytes; - } - - /** - * Required - Memory, in bytes, currently in use by the heap across all selected - * nodes. - *

- * API name: {@code heap_used_in_bytes} - */ - public final long heapUsedInBytes() { - return this.heapUsedInBytes; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("heap_max_in_bytes"); - generator.write(this.heapMaxInBytes); - - generator.writeKey("heap_used_in_bytes"); - generator.write(this.heapUsedInBytes); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterJvmMemory}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Long heapMaxInBytes; - - private Long heapUsedInBytes; - - /** - * Required - Maximum amount of memory, in bytes, available for use by the heap - * across all selected nodes. - *

- * API name: {@code heap_max_in_bytes} - */ - public final Builder heapMaxInBytes(long value) { - this.heapMaxInBytes = value; - return this; - } - - /** - * Required - Memory, in bytes, currently in use by the heap across all selected - * nodes. - *

- * API name: {@code heap_used_in_bytes} - */ - public final Builder heapUsedInBytes(long value) { - this.heapUsedInBytes = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterJvmMemory}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterJvmMemory build() { - _checkSingleUse(); - - return new ClusterJvmMemory(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterJvmMemory} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ClusterJvmMemory::setupClusterJvmMemoryDeserializer); - - protected static void setupClusterJvmMemoryDeserializer(ObjectDeserializer op) { - - op.add(Builder::heapMaxInBytes, JsonpDeserializer.longDeserializer(), "heap_max_in_bytes"); - op.add(Builder::heapUsedInBytes, JsonpDeserializer.longDeserializer(), "heap_used_in_bytes"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterJvmVersion.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterJvmVersion.java deleted file mode 100644 index 17b945cf0..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterJvmVersion.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.Integer; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterJvmVersion - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterJvmVersion implements JsonpSerializable { - private final boolean bundledJdk; - - private final int count; - - private final boolean usingBundledJdk; - - private final String version; - - private final String vmName; - - private final String vmVendor; - - private final String vmVersion; - - // --------------------------------------------------------------------------------------------- - - private ClusterJvmVersion(Builder builder) { - - this.bundledJdk = ApiTypeHelper.requireNonNull(builder.bundledJdk, this, "bundledJdk"); - this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); - this.usingBundledJdk = ApiTypeHelper.requireNonNull(builder.usingBundledJdk, this, "usingBundledJdk"); - this.version = ApiTypeHelper.requireNonNull(builder.version, this, "version"); - this.vmName = ApiTypeHelper.requireNonNull(builder.vmName, this, "vmName"); - this.vmVendor = ApiTypeHelper.requireNonNull(builder.vmVendor, this, "vmVendor"); - this.vmVersion = ApiTypeHelper.requireNonNull(builder.vmVersion, this, "vmVersion"); - - } - - public static ClusterJvmVersion of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Always true. All distributions come with a bundled - * Java Development Kit (JDK). - *

- * API name: {@code bundled_jdk} - */ - public final boolean bundledJdk() { - return this.bundledJdk; - } - - /** - * Required - Total number of selected nodes using JVM. - *

- * API name: {@code count} - */ - public final int count() { - return this.count; - } - - /** - * Required - If true, a bundled JDK is in use by JVM. - *

- * API name: {@code using_bundled_jdk} - */ - public final boolean usingBundledJdk() { - return this.usingBundledJdk; - } - - /** - * Required - Version of JVM used by one or more selected nodes. - *

- * API name: {@code version} - */ - public final String version() { - return this.version; - } - - /** - * Required - Name of the JVM. - *

- * API name: {@code vm_name} - */ - public final String vmName() { - return this.vmName; - } - - /** - * Required - Vendor of the JVM. - *

- * API name: {@code vm_vendor} - */ - public final String vmVendor() { - return this.vmVendor; - } - - /** - * Required - Full version number of JVM. The full version number includes a - * plus sign (+) followed by the build number. - *

- * API name: {@code vm_version} - */ - public final String vmVersion() { - return this.vmVersion; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("bundled_jdk"); - generator.write(this.bundledJdk); - - generator.writeKey("count"); - generator.write(this.count); - - generator.writeKey("using_bundled_jdk"); - generator.write(this.usingBundledJdk); - - generator.writeKey("version"); - generator.write(this.version); - - generator.writeKey("vm_name"); - generator.write(this.vmName); - - generator.writeKey("vm_vendor"); - generator.write(this.vmVendor); - - generator.writeKey("vm_version"); - generator.write(this.vmVersion); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterJvmVersion}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Boolean bundledJdk; - - private Integer count; - - private Boolean usingBundledJdk; - - private String version; - - private String vmName; - - private String vmVendor; - - private String vmVersion; - - /** - * Required - Always true. All distributions come with a bundled - * Java Development Kit (JDK). - *

- * API name: {@code bundled_jdk} - */ - public final Builder bundledJdk(boolean value) { - this.bundledJdk = value; - return this; - } - - /** - * Required - Total number of selected nodes using JVM. - *

- * API name: {@code count} - */ - public final Builder count(int value) { - this.count = value; - return this; - } - - /** - * Required - If true, a bundled JDK is in use by JVM. - *

- * API name: {@code using_bundled_jdk} - */ - public final Builder usingBundledJdk(boolean value) { - this.usingBundledJdk = value; - return this; - } - - /** - * Required - Version of JVM used by one or more selected nodes. - *

- * API name: {@code version} - */ - public final Builder version(String value) { - this.version = value; - return this; - } - - /** - * Required - Name of the JVM. - *

- * API name: {@code vm_name} - */ - public final Builder vmName(String value) { - this.vmName = value; - return this; - } - - /** - * Required - Vendor of the JVM. - *

- * API name: {@code vm_vendor} - */ - public final Builder vmVendor(String value) { - this.vmVendor = value; - return this; - } - - /** - * Required - Full version number of JVM. The full version number includes a - * plus sign (+) followed by the build number. - *

- * API name: {@code vm_version} - */ - public final Builder vmVersion(String value) { - this.vmVersion = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterJvmVersion}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterJvmVersion build() { - _checkSingleUse(); - - return new ClusterJvmVersion(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterJvmVersion} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ClusterJvmVersion::setupClusterJvmVersionDeserializer); - - protected static void setupClusterJvmVersionDeserializer(ObjectDeserializer op) { - - op.add(Builder::bundledJdk, JsonpDeserializer.booleanDeserializer(), "bundled_jdk"); - op.add(Builder::count, JsonpDeserializer.integerDeserializer(), "count"); - op.add(Builder::usingBundledJdk, JsonpDeserializer.booleanDeserializer(), "using_bundled_jdk"); - op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version"); - op.add(Builder::vmName, JsonpDeserializer.stringDeserializer(), "vm_name"); - op.add(Builder::vmVendor, JsonpDeserializer.stringDeserializer(), "vm_vendor"); - op.add(Builder::vmVersion, JsonpDeserializer.stringDeserializer(), "vm_version"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterNetworkTypes.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterNetworkTypes.java deleted file mode 100644 index 0fc5e3f51..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterNetworkTypes.java +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterNetworkTypes - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterNetworkTypes implements JsonpSerializable { - private final Map httpTypes; - - private final Map transportTypes; - - // --------------------------------------------------------------------------------------------- - - private ClusterNetworkTypes(Builder builder) { - - this.httpTypes = ApiTypeHelper.unmodifiableRequired(builder.httpTypes, this, "httpTypes"); - this.transportTypes = ApiTypeHelper.unmodifiableRequired(builder.transportTypes, this, "transportTypes"); - - } - - public static ClusterNetworkTypes of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Contains statistics about the HTTP network types used by selected - * nodes. - *

- * API name: {@code http_types} - */ - public final Map httpTypes() { - return this.httpTypes; - } - - /** - * Required - Contains statistics about the transport network types used by - * selected nodes. - *

- * API name: {@code transport_types} - */ - public final Map transportTypes() { - return this.transportTypes; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.httpTypes)) { - generator.writeKey("http_types"); - generator.writeStartObject(); - for (Map.Entry item0 : this.httpTypes.entrySet()) { - generator.writeKey(item0.getKey()); - generator.write(item0.getValue()); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.transportTypes)) { - generator.writeKey("transport_types"); - generator.writeStartObject(); - for (Map.Entry item0 : this.transportTypes.entrySet()) { - generator.writeKey(item0.getKey()); - generator.write(item0.getValue()); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterNetworkTypes}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Map httpTypes; - - private Map transportTypes; - - /** - * Required - Contains statistics about the HTTP network types used by selected - * nodes. - *

- * API name: {@code http_types} - *

- * Adds all entries of map to httpTypes. - */ - public final Builder httpTypes(Map map) { - this.httpTypes = _mapPutAll(this.httpTypes, map); - return this; - } - - /** - * Required - Contains statistics about the HTTP network types used by selected - * nodes. - *

- * API name: {@code http_types} - *

- * Adds an entry to httpTypes. - */ - public final Builder httpTypes(String key, Integer value) { - this.httpTypes = _mapPut(this.httpTypes, key, value); - return this; - } - - /** - * Required - Contains statistics about the transport network types used by - * selected nodes. - *

- * API name: {@code transport_types} - *

- * Adds all entries of map to transportTypes. - */ - public final Builder transportTypes(Map map) { - this.transportTypes = _mapPutAll(this.transportTypes, map); - return this; - } - - /** - * Required - Contains statistics about the transport network types used by - * selected nodes. - *

- * API name: {@code transport_types} - *

- * Adds an entry to transportTypes. - */ - public final Builder transportTypes(String key, Integer value) { - this.transportTypes = _mapPut(this.transportTypes, key, value); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterNetworkTypes}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterNetworkTypes build() { - _checkSingleUse(); - - return new ClusterNetworkTypes(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterNetworkTypes} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ClusterNetworkTypes::setupClusterNetworkTypesDeserializer); - - protected static void setupClusterNetworkTypesDeserializer(ObjectDeserializer op) { - - op.add(Builder::httpTypes, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.integerDeserializer()), - "http_types"); - op.add(Builder::transportTypes, - JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.integerDeserializer()), "transport_types"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterNodeCount.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterNodeCount.java deleted file mode 100644 index 8b1cb111e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterNodeCount.java +++ /dev/null @@ -1,461 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterNodeCount - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterNodeCount implements JsonpSerializable { - private final int coordinatingOnly; - - private final int data; - - private final int dataCold; - - private final int dataContent; - - @Nullable - private final Integer dataFrozen; - - private final int dataHot; - - private final int dataWarm; - - private final int ingest; - - private final int master; - - private final int ml; - - private final int remoteClusterClient; - - private final int total; - - private final int transform; - - private final int votingOnly; - - // --------------------------------------------------------------------------------------------- - - private ClusterNodeCount(Builder builder) { - - this.coordinatingOnly = ApiTypeHelper.requireNonNull(builder.coordinatingOnly, this, "coordinatingOnly"); - this.data = ApiTypeHelper.requireNonNull(builder.data, this, "data"); - this.dataCold = ApiTypeHelper.requireNonNull(builder.dataCold, this, "dataCold"); - this.dataContent = ApiTypeHelper.requireNonNull(builder.dataContent, this, "dataContent"); - this.dataFrozen = builder.dataFrozen; - this.dataHot = ApiTypeHelper.requireNonNull(builder.dataHot, this, "dataHot"); - this.dataWarm = ApiTypeHelper.requireNonNull(builder.dataWarm, this, "dataWarm"); - this.ingest = ApiTypeHelper.requireNonNull(builder.ingest, this, "ingest"); - this.master = ApiTypeHelper.requireNonNull(builder.master, this, "master"); - this.ml = ApiTypeHelper.requireNonNull(builder.ml, this, "ml"); - this.remoteClusterClient = ApiTypeHelper.requireNonNull(builder.remoteClusterClient, this, - "remoteClusterClient"); - this.total = ApiTypeHelper.requireNonNull(builder.total, this, "total"); - this.transform = ApiTypeHelper.requireNonNull(builder.transform, this, "transform"); - this.votingOnly = ApiTypeHelper.requireNonNull(builder.votingOnly, this, "votingOnly"); - - } - - public static ClusterNodeCount of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code coordinating_only} - */ - public final int coordinatingOnly() { - return this.coordinatingOnly; - } - - /** - * Required - API name: {@code data} - */ - public final int data() { - return this.data; - } - - /** - * Required - API name: {@code data_cold} - */ - public final int dataCold() { - return this.dataCold; - } - - /** - * Required - API name: {@code data_content} - */ - public final int dataContent() { - return this.dataContent; - } - - /** - * API name: {@code data_frozen} - */ - @Nullable - public final Integer dataFrozen() { - return this.dataFrozen; - } - - /** - * Required - API name: {@code data_hot} - */ - public final int dataHot() { - return this.dataHot; - } - - /** - * Required - API name: {@code data_warm} - */ - public final int dataWarm() { - return this.dataWarm; - } - - /** - * Required - API name: {@code ingest} - */ - public final int ingest() { - return this.ingest; - } - - /** - * Required - API name: {@code master} - */ - public final int master() { - return this.master; - } - - /** - * Required - API name: {@code ml} - */ - public final int ml() { - return this.ml; - } - - /** - * Required - API name: {@code remote_cluster_client} - */ - public final int remoteClusterClient() { - return this.remoteClusterClient; - } - - /** - * Required - API name: {@code total} - */ - public final int total() { - return this.total; - } - - /** - * Required - API name: {@code transform} - */ - public final int transform() { - return this.transform; - } - - /** - * Required - API name: {@code voting_only} - */ - public final int votingOnly() { - return this.votingOnly; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("coordinating_only"); - generator.write(this.coordinatingOnly); - - generator.writeKey("data"); - generator.write(this.data); - - generator.writeKey("data_cold"); - generator.write(this.dataCold); - - generator.writeKey("data_content"); - generator.write(this.dataContent); - - if (this.dataFrozen != null) { - generator.writeKey("data_frozen"); - generator.write(this.dataFrozen); - - } - generator.writeKey("data_hot"); - generator.write(this.dataHot); - - generator.writeKey("data_warm"); - generator.write(this.dataWarm); - - generator.writeKey("ingest"); - generator.write(this.ingest); - - generator.writeKey("master"); - generator.write(this.master); - - generator.writeKey("ml"); - generator.write(this.ml); - - generator.writeKey("remote_cluster_client"); - generator.write(this.remoteClusterClient); - - generator.writeKey("total"); - generator.write(this.total); - - generator.writeKey("transform"); - generator.write(this.transform); - - generator.writeKey("voting_only"); - generator.write(this.votingOnly); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterNodeCount}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Integer coordinatingOnly; - - private Integer data; - - private Integer dataCold; - - private Integer dataContent; - - @Nullable - private Integer dataFrozen; - - private Integer dataHot; - - private Integer dataWarm; - - private Integer ingest; - - private Integer master; - - private Integer ml; - - private Integer remoteClusterClient; - - private Integer total; - - private Integer transform; - - private Integer votingOnly; - - /** - * Required - API name: {@code coordinating_only} - */ - public final Builder coordinatingOnly(int value) { - this.coordinatingOnly = value; - return this; - } - - /** - * Required - API name: {@code data} - */ - public final Builder data(int value) { - this.data = value; - return this; - } - - /** - * Required - API name: {@code data_cold} - */ - public final Builder dataCold(int value) { - this.dataCold = value; - return this; - } - - /** - * Required - API name: {@code data_content} - */ - public final Builder dataContent(int value) { - this.dataContent = value; - return this; - } - - /** - * API name: {@code data_frozen} - */ - public final Builder dataFrozen(@Nullable Integer value) { - this.dataFrozen = value; - return this; - } - - /** - * Required - API name: {@code data_hot} - */ - public final Builder dataHot(int value) { - this.dataHot = value; - return this; - } - - /** - * Required - API name: {@code data_warm} - */ - public final Builder dataWarm(int value) { - this.dataWarm = value; - return this; - } - - /** - * Required - API name: {@code ingest} - */ - public final Builder ingest(int value) { - this.ingest = value; - return this; - } - - /** - * Required - API name: {@code master} - */ - public final Builder master(int value) { - this.master = value; - return this; - } - - /** - * Required - API name: {@code ml} - */ - public final Builder ml(int value) { - this.ml = value; - return this; - } - - /** - * Required - API name: {@code remote_cluster_client} - */ - public final Builder remoteClusterClient(int value) { - this.remoteClusterClient = value; - return this; - } - - /** - * Required - API name: {@code total} - */ - public final Builder total(int value) { - this.total = value; - return this; - } - - /** - * Required - API name: {@code transform} - */ - public final Builder transform(int value) { - this.transform = value; - return this; - } - - /** - * Required - API name: {@code voting_only} - */ - public final Builder votingOnly(int value) { - this.votingOnly = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterNodeCount}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterNodeCount build() { - _checkSingleUse(); - - return new ClusterNodeCount(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterNodeCount} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ClusterNodeCount::setupClusterNodeCountDeserializer); - - protected static void setupClusterNodeCountDeserializer(ObjectDeserializer op) { - - op.add(Builder::coordinatingOnly, JsonpDeserializer.integerDeserializer(), "coordinating_only"); - op.add(Builder::data, JsonpDeserializer.integerDeserializer(), "data"); - op.add(Builder::dataCold, JsonpDeserializer.integerDeserializer(), "data_cold"); - op.add(Builder::dataContent, JsonpDeserializer.integerDeserializer(), "data_content"); - op.add(Builder::dataFrozen, JsonpDeserializer.integerDeserializer(), "data_frozen"); - op.add(Builder::dataHot, JsonpDeserializer.integerDeserializer(), "data_hot"); - op.add(Builder::dataWarm, JsonpDeserializer.integerDeserializer(), "data_warm"); - op.add(Builder::ingest, JsonpDeserializer.integerDeserializer(), "ingest"); - op.add(Builder::master, JsonpDeserializer.integerDeserializer(), "master"); - op.add(Builder::ml, JsonpDeserializer.integerDeserializer(), "ml"); - op.add(Builder::remoteClusterClient, JsonpDeserializer.integerDeserializer(), "remote_cluster_client"); - op.add(Builder::total, JsonpDeserializer.integerDeserializer(), "total"); - op.add(Builder::transform, JsonpDeserializer.integerDeserializer(), "transform"); - op.add(Builder::votingOnly, JsonpDeserializer.integerDeserializer(), "voting_only"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterNodes.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterNodes.java deleted file mode 100644 index 17eac729e..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterNodes.java +++ /dev/null @@ -1,650 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.elasticsearch._types.PluginStats; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.String; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterNodes - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterNodes implements JsonpSerializable { - private final ClusterNodeCount count; - - private final Map discoveryTypes; - - private final ClusterFileSystem fs; - - private final IndexingPressure indexingPressure; - - private final ClusterIngest ingest; - - private final ClusterJvm jvm; - - private final ClusterNetworkTypes networkTypes; - - private final ClusterOperatingSystem os; - - private final List packagingTypes; - - private final List plugins; - - private final ClusterProcess process; - - private final List versions; - - // --------------------------------------------------------------------------------------------- - - private ClusterNodes(Builder builder) { - - this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); - this.discoveryTypes = ApiTypeHelper.unmodifiableRequired(builder.discoveryTypes, this, "discoveryTypes"); - this.fs = ApiTypeHelper.requireNonNull(builder.fs, this, "fs"); - this.indexingPressure = ApiTypeHelper.requireNonNull(builder.indexingPressure, this, "indexingPressure"); - this.ingest = ApiTypeHelper.requireNonNull(builder.ingest, this, "ingest"); - this.jvm = ApiTypeHelper.requireNonNull(builder.jvm, this, "jvm"); - this.networkTypes = ApiTypeHelper.requireNonNull(builder.networkTypes, this, "networkTypes"); - this.os = ApiTypeHelper.requireNonNull(builder.os, this, "os"); - this.packagingTypes = ApiTypeHelper.unmodifiableRequired(builder.packagingTypes, this, "packagingTypes"); - this.plugins = ApiTypeHelper.unmodifiableRequired(builder.plugins, this, "plugins"); - this.process = ApiTypeHelper.requireNonNull(builder.process, this, "process"); - this.versions = ApiTypeHelper.unmodifiableRequired(builder.versions, this, "versions"); - - } - - public static ClusterNodes of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Contains counts for nodes selected by the request’s node filters. - *

- * API name: {@code count} - */ - public final ClusterNodeCount count() { - return this.count; - } - - /** - * Required - Contains statistics about the discovery types used by selected - * nodes. - *

- * API name: {@code discovery_types} - */ - public final Map discoveryTypes() { - return this.discoveryTypes; - } - - /** - * Required - Contains statistics about file stores by selected nodes. - *

- * API name: {@code fs} - */ - public final ClusterFileSystem fs() { - return this.fs; - } - - /** - * Required - API name: {@code indexing_pressure} - */ - public final IndexingPressure indexingPressure() { - return this.indexingPressure; - } - - /** - * Required - API name: {@code ingest} - */ - public final ClusterIngest ingest() { - return this.ingest; - } - - /** - * Required - Contains statistics about the Java Virtual Machines (JVMs) used by - * selected nodes. - *

- * API name: {@code jvm} - */ - public final ClusterJvm jvm() { - return this.jvm; - } - - /** - * Required - Contains statistics about the transport and HTTP networks used by - * selected nodes. - *

- * API name: {@code network_types} - */ - public final ClusterNetworkTypes networkTypes() { - return this.networkTypes; - } - - /** - * Required - Contains statistics about the operating systems used by selected - * nodes. - *

- * API name: {@code os} - */ - public final ClusterOperatingSystem os() { - return this.os; - } - - /** - * Required - Contains statistics about Elasticsearch distributions installed on - * selected nodes. - *

- * API name: {@code packaging_types} - */ - public final List packagingTypes() { - return this.packagingTypes; - } - - /** - * Required - Contains statistics about installed plugins and modules by - * selected nodes. If no plugins or modules are installed, this array is empty. - *

- * API name: {@code plugins} - */ - public final List plugins() { - return this.plugins; - } - - /** - * Required - Contains statistics about processes used by selected nodes. - *

- * API name: {@code process} - */ - public final ClusterProcess process() { - return this.process; - } - - /** - * Required - Array of Elasticsearch versions used on selected nodes. - *

- * API name: {@code versions} - */ - public final List versions() { - return this.versions; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("count"); - this.count.serialize(generator, mapper); - - if (ApiTypeHelper.isDefined(this.discoveryTypes)) { - generator.writeKey("discovery_types"); - generator.writeStartObject(); - for (Map.Entry item0 : this.discoveryTypes.entrySet()) { - generator.writeKey(item0.getKey()); - generator.write(item0.getValue()); - - } - generator.writeEnd(); - - } - generator.writeKey("fs"); - this.fs.serialize(generator, mapper); - - generator.writeKey("indexing_pressure"); - this.indexingPressure.serialize(generator, mapper); - - generator.writeKey("ingest"); - this.ingest.serialize(generator, mapper); - - generator.writeKey("jvm"); - this.jvm.serialize(generator, mapper); - - generator.writeKey("network_types"); - this.networkTypes.serialize(generator, mapper); - - generator.writeKey("os"); - this.os.serialize(generator, mapper); - - if (ApiTypeHelper.isDefined(this.packagingTypes)) { - generator.writeKey("packaging_types"); - generator.writeStartArray(); - for (NodePackagingType item0 : this.packagingTypes) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.plugins)) { - generator.writeKey("plugins"); - generator.writeStartArray(); - for (PluginStats item0 : this.plugins) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - generator.writeKey("process"); - this.process.serialize(generator, mapper); - - if (ApiTypeHelper.isDefined(this.versions)) { - generator.writeKey("versions"); - generator.writeStartArray(); - for (String item0 : this.versions) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterNodes}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private ClusterNodeCount count; - - private Map discoveryTypes; - - private ClusterFileSystem fs; - - private IndexingPressure indexingPressure; - - private ClusterIngest ingest; - - private ClusterJvm jvm; - - private ClusterNetworkTypes networkTypes; - - private ClusterOperatingSystem os; - - private List packagingTypes; - - private List plugins; - - private ClusterProcess process; - - private List versions; - - /** - * Required - Contains counts for nodes selected by the request’s node filters. - *

- * API name: {@code count} - */ - public final Builder count(ClusterNodeCount value) { - this.count = value; - return this; - } - - /** - * Required - Contains counts for nodes selected by the request’s node filters. - *

- * API name: {@code count} - */ - public final Builder count(Function> fn) { - return this.count(fn.apply(new ClusterNodeCount.Builder()).build()); - } - - /** - * Required - Contains statistics about the discovery types used by selected - * nodes. - *

- * API name: {@code discovery_types} - *

- * Adds all entries of map to discoveryTypes. - */ - public final Builder discoveryTypes(Map map) { - this.discoveryTypes = _mapPutAll(this.discoveryTypes, map); - return this; - } - - /** - * Required - Contains statistics about the discovery types used by selected - * nodes. - *

- * API name: {@code discovery_types} - *

- * Adds an entry to discoveryTypes. - */ - public final Builder discoveryTypes(String key, Integer value) { - this.discoveryTypes = _mapPut(this.discoveryTypes, key, value); - return this; - } - - /** - * Required - Contains statistics about file stores by selected nodes. - *

- * API name: {@code fs} - */ - public final Builder fs(ClusterFileSystem value) { - this.fs = value; - return this; - } - - /** - * Required - Contains statistics about file stores by selected nodes. - *

- * API name: {@code fs} - */ - public final Builder fs(Function> fn) { - return this.fs(fn.apply(new ClusterFileSystem.Builder()).build()); - } - - /** - * Required - API name: {@code indexing_pressure} - */ - public final Builder indexingPressure(IndexingPressure value) { - this.indexingPressure = value; - return this; - } - - /** - * Required - API name: {@code indexing_pressure} - */ - public final Builder indexingPressure(Function> fn) { - return this.indexingPressure(fn.apply(new IndexingPressure.Builder()).build()); - } - - /** - * Required - API name: {@code ingest} - */ - public final Builder ingest(ClusterIngest value) { - this.ingest = value; - return this; - } - - /** - * Required - API name: {@code ingest} - */ - public final Builder ingest(Function> fn) { - return this.ingest(fn.apply(new ClusterIngest.Builder()).build()); - } - - /** - * Required - Contains statistics about the Java Virtual Machines (JVMs) used by - * selected nodes. - *

- * API name: {@code jvm} - */ - public final Builder jvm(ClusterJvm value) { - this.jvm = value; - return this; - } - - /** - * Required - Contains statistics about the Java Virtual Machines (JVMs) used by - * selected nodes. - *

- * API name: {@code jvm} - */ - public final Builder jvm(Function> fn) { - return this.jvm(fn.apply(new ClusterJvm.Builder()).build()); - } - - /** - * Required - Contains statistics about the transport and HTTP networks used by - * selected nodes. - *

- * API name: {@code network_types} - */ - public final Builder networkTypes(ClusterNetworkTypes value) { - this.networkTypes = value; - return this; - } - - /** - * Required - Contains statistics about the transport and HTTP networks used by - * selected nodes. - *

- * API name: {@code network_types} - */ - public final Builder networkTypes( - Function> fn) { - return this.networkTypes(fn.apply(new ClusterNetworkTypes.Builder()).build()); - } - - /** - * Required - Contains statistics about the operating systems used by selected - * nodes. - *

- * API name: {@code os} - */ - public final Builder os(ClusterOperatingSystem value) { - this.os = value; - return this; - } - - /** - * Required - Contains statistics about the operating systems used by selected - * nodes. - *

- * API name: {@code os} - */ - public final Builder os(Function> fn) { - return this.os(fn.apply(new ClusterOperatingSystem.Builder()).build()); - } - - /** - * Required - Contains statistics about Elasticsearch distributions installed on - * selected nodes. - *

- * API name: {@code packaging_types} - *

- * Adds all elements of list to packagingTypes. - */ - public final Builder packagingTypes(List list) { - this.packagingTypes = _listAddAll(this.packagingTypes, list); - return this; - } - - /** - * Required - Contains statistics about Elasticsearch distributions installed on - * selected nodes. - *

- * API name: {@code packaging_types} - *

- * Adds one or more values to packagingTypes. - */ - public final Builder packagingTypes(NodePackagingType value, NodePackagingType... values) { - this.packagingTypes = _listAdd(this.packagingTypes, value, values); - return this; - } - - /** - * Required - Contains statistics about Elasticsearch distributions installed on - * selected nodes. - *

- * API name: {@code packaging_types} - *

- * Adds a value to packagingTypes using a builder lambda. - */ - public final Builder packagingTypes(Function> fn) { - return packagingTypes(fn.apply(new NodePackagingType.Builder()).build()); - } - - /** - * Required - Contains statistics about installed plugins and modules by - * selected nodes. If no plugins or modules are installed, this array is empty. - *

- * API name: {@code plugins} - *

- * Adds all elements of list to plugins. - */ - public final Builder plugins(List list) { - this.plugins = _listAddAll(this.plugins, list); - return this; - } - - /** - * Required - Contains statistics about installed plugins and modules by - * selected nodes. If no plugins or modules are installed, this array is empty. - *

- * API name: {@code plugins} - *

- * Adds one or more values to plugins. - */ - public final Builder plugins(PluginStats value, PluginStats... values) { - this.plugins = _listAdd(this.plugins, value, values); - return this; - } - - /** - * Required - Contains statistics about installed plugins and modules by - * selected nodes. If no plugins or modules are installed, this array is empty. - *

- * API name: {@code plugins} - *

- * Adds a value to plugins using a builder lambda. - */ - public final Builder plugins(Function> fn) { - return plugins(fn.apply(new PluginStats.Builder()).build()); - } - - /** - * Required - Contains statistics about processes used by selected nodes. - *

- * API name: {@code process} - */ - public final Builder process(ClusterProcess value) { - this.process = value; - return this; - } - - /** - * Required - Contains statistics about processes used by selected nodes. - *

- * API name: {@code process} - */ - public final Builder process(Function> fn) { - return this.process(fn.apply(new ClusterProcess.Builder()).build()); - } - - /** - * Required - Array of Elasticsearch versions used on selected nodes. - *

- * API name: {@code versions} - *

- * Adds all elements of list to versions. - */ - public final Builder versions(List list) { - this.versions = _listAddAll(this.versions, list); - return this; - } - - /** - * Required - Array of Elasticsearch versions used on selected nodes. - *

- * API name: {@code versions} - *

- * Adds one or more values to versions. - */ - public final Builder versions(String value, String... values) { - this.versions = _listAdd(this.versions, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterNodes}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterNodes build() { - _checkSingleUse(); - - return new ClusterNodes(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterNodes} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ClusterNodes::setupClusterNodesDeserializer); - - protected static void setupClusterNodesDeserializer(ObjectDeserializer op) { - - op.add(Builder::count, ClusterNodeCount._DESERIALIZER, "count"); - op.add(Builder::discoveryTypes, - JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.integerDeserializer()), "discovery_types"); - op.add(Builder::fs, ClusterFileSystem._DESERIALIZER, "fs"); - op.add(Builder::indexingPressure, IndexingPressure._DESERIALIZER, "indexing_pressure"); - op.add(Builder::ingest, ClusterIngest._DESERIALIZER, "ingest"); - op.add(Builder::jvm, ClusterJvm._DESERIALIZER, "jvm"); - op.add(Builder::networkTypes, ClusterNetworkTypes._DESERIALIZER, "network_types"); - op.add(Builder::os, ClusterOperatingSystem._DESERIALIZER, "os"); - op.add(Builder::packagingTypes, JsonpDeserializer.arrayDeserializer(NodePackagingType._DESERIALIZER), - "packaging_types"); - op.add(Builder::plugins, JsonpDeserializer.arrayDeserializer(PluginStats._DESERIALIZER), "plugins"); - op.add(Builder::process, ClusterProcess._DESERIALIZER, "process"); - op.add(Builder::versions, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "versions"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystem.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystem.java deleted file mode 100644 index 0c71cd6e5..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystem.java +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterOperatingSystem - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterOperatingSystem implements JsonpSerializable { - private final int allocatedProcessors; - - private final List architectures; - - private final int availableProcessors; - - private final OperatingSystemMemoryInfo mem; - - private final List names; - - private final List prettyNames; - - // --------------------------------------------------------------------------------------------- - - private ClusterOperatingSystem(Builder builder) { - - this.allocatedProcessors = ApiTypeHelper.requireNonNull(builder.allocatedProcessors, this, - "allocatedProcessors"); - this.architectures = ApiTypeHelper.unmodifiable(builder.architectures); - this.availableProcessors = ApiTypeHelper.requireNonNull(builder.availableProcessors, this, - "availableProcessors"); - this.mem = ApiTypeHelper.requireNonNull(builder.mem, this, "mem"); - this.names = ApiTypeHelper.unmodifiableRequired(builder.names, this, "names"); - this.prettyNames = ApiTypeHelper.unmodifiableRequired(builder.prettyNames, this, "prettyNames"); - - } - - public static ClusterOperatingSystem of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Number of processors used to calculate thread pool size across all - * selected nodes. This number can be set with the processors setting of a node - * and defaults to the number of processors reported by the operating system. In - * both cases, this number will never be larger than 32. - *

- * API name: {@code allocated_processors} - */ - public final int allocatedProcessors() { - return this.allocatedProcessors; - } - - /** - * Contains statistics about processor architectures (for example, x86_64 or - * aarch64) used by selected nodes. - *

- * API name: {@code architectures} - */ - public final List architectures() { - return this.architectures; - } - - /** - * Required - Number of processors available to JVM across all selected nodes. - *

- * API name: {@code available_processors} - */ - public final int availableProcessors() { - return this.availableProcessors; - } - - /** - * Required - Contains statistics about memory used by selected nodes. - *

- * API name: {@code mem} - */ - public final OperatingSystemMemoryInfo mem() { - return this.mem; - } - - /** - * Required - Contains statistics about operating systems used by selected - * nodes. - *

- * API name: {@code names} - */ - public final List names() { - return this.names; - } - - /** - * Required - Contains statistics about operating systems used by selected - * nodes. - *

- * API name: {@code pretty_names} - */ - public final List prettyNames() { - return this.prettyNames; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("allocated_processors"); - generator.write(this.allocatedProcessors); - - if (ApiTypeHelper.isDefined(this.architectures)) { - generator.writeKey("architectures"); - generator.writeStartArray(); - for (ClusterOperatingSystemArchitecture item0 : this.architectures) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - generator.writeKey("available_processors"); - generator.write(this.availableProcessors); - - generator.writeKey("mem"); - this.mem.serialize(generator, mapper); - - if (ApiTypeHelper.isDefined(this.names)) { - generator.writeKey("names"); - generator.writeStartArray(); - for (ClusterOperatingSystemName item0 : this.names) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.prettyNames)) { - generator.writeKey("pretty_names"); - generator.writeStartArray(); - for (ClusterOperatingSystemPrettyName item0 : this.prettyNames) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterOperatingSystem}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Integer allocatedProcessors; - - @Nullable - private List architectures; - - private Integer availableProcessors; - - private OperatingSystemMemoryInfo mem; - - private List names; - - private List prettyNames; - - /** - * Required - Number of processors used to calculate thread pool size across all - * selected nodes. This number can be set with the processors setting of a node - * and defaults to the number of processors reported by the operating system. In - * both cases, this number will never be larger than 32. - *

- * API name: {@code allocated_processors} - */ - public final Builder allocatedProcessors(int value) { - this.allocatedProcessors = value; - return this; - } - - /** - * Contains statistics about processor architectures (for example, x86_64 or - * aarch64) used by selected nodes. - *

- * API name: {@code architectures} - *

- * Adds all elements of list to architectures. - */ - public final Builder architectures(List list) { - this.architectures = _listAddAll(this.architectures, list); - return this; - } - - /** - * Contains statistics about processor architectures (for example, x86_64 or - * aarch64) used by selected nodes. - *

- * API name: {@code architectures} - *

- * Adds one or more values to architectures. - */ - public final Builder architectures(ClusterOperatingSystemArchitecture value, - ClusterOperatingSystemArchitecture... values) { - this.architectures = _listAdd(this.architectures, value, values); - return this; - } - - /** - * Contains statistics about processor architectures (for example, x86_64 or - * aarch64) used by selected nodes. - *

- * API name: {@code architectures} - *

- * Adds a value to architectures using a builder lambda. - */ - public final Builder architectures( - Function> fn) { - return architectures(fn.apply(new ClusterOperatingSystemArchitecture.Builder()).build()); - } - - /** - * Required - Number of processors available to JVM across all selected nodes. - *

- * API name: {@code available_processors} - */ - public final Builder availableProcessors(int value) { - this.availableProcessors = value; - return this; - } - - /** - * Required - Contains statistics about memory used by selected nodes. - *

- * API name: {@code mem} - */ - public final Builder mem(OperatingSystemMemoryInfo value) { - this.mem = value; - return this; - } - - /** - * Required - Contains statistics about memory used by selected nodes. - *

- * API name: {@code mem} - */ - public final Builder mem( - Function> fn) { - return this.mem(fn.apply(new OperatingSystemMemoryInfo.Builder()).build()); - } - - /** - * Required - Contains statistics about operating systems used by selected - * nodes. - *

- * API name: {@code names} - *

- * Adds all elements of list to names. - */ - public final Builder names(List list) { - this.names = _listAddAll(this.names, list); - return this; - } - - /** - * Required - Contains statistics about operating systems used by selected - * nodes. - *

- * API name: {@code names} - *

- * Adds one or more values to names. - */ - public final Builder names(ClusterOperatingSystemName value, ClusterOperatingSystemName... values) { - this.names = _listAdd(this.names, value, values); - return this; - } - - /** - * Required - Contains statistics about operating systems used by selected - * nodes. - *

- * API name: {@code names} - *

- * Adds a value to names using a builder lambda. - */ - public final Builder names( - Function> fn) { - return names(fn.apply(new ClusterOperatingSystemName.Builder()).build()); - } - - /** - * Required - Contains statistics about operating systems used by selected - * nodes. - *

- * API name: {@code pretty_names} - *

- * Adds all elements of list to prettyNames. - */ - public final Builder prettyNames(List list) { - this.prettyNames = _listAddAll(this.prettyNames, list); - return this; - } - - /** - * Required - Contains statistics about operating systems used by selected - * nodes. - *

- * API name: {@code pretty_names} - *

- * Adds one or more values to prettyNames. - */ - public final Builder prettyNames(ClusterOperatingSystemPrettyName value, - ClusterOperatingSystemPrettyName... values) { - this.prettyNames = _listAdd(this.prettyNames, value, values); - return this; - } - - /** - * Required - Contains statistics about operating systems used by selected - * nodes. - *

- * API name: {@code pretty_names} - *

- * Adds a value to prettyNames using a builder lambda. - */ - public final Builder prettyNames( - Function> fn) { - return prettyNames(fn.apply(new ClusterOperatingSystemPrettyName.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterOperatingSystem}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterOperatingSystem build() { - _checkSingleUse(); - - return new ClusterOperatingSystem(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterOperatingSystem} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ClusterOperatingSystem::setupClusterOperatingSystemDeserializer); - - protected static void setupClusterOperatingSystemDeserializer( - ObjectDeserializer op) { - - op.add(Builder::allocatedProcessors, JsonpDeserializer.integerDeserializer(), "allocated_processors"); - op.add(Builder::architectures, - JsonpDeserializer.arrayDeserializer(ClusterOperatingSystemArchitecture._DESERIALIZER), "architectures"); - op.add(Builder::availableProcessors, JsonpDeserializer.integerDeserializer(), "available_processors"); - op.add(Builder::mem, OperatingSystemMemoryInfo._DESERIALIZER, "mem"); - op.add(Builder::names, JsonpDeserializer.arrayDeserializer(ClusterOperatingSystemName._DESERIALIZER), "names"); - op.add(Builder::prettyNames, - JsonpDeserializer.arrayDeserializer(ClusterOperatingSystemPrettyName._DESERIALIZER), "pretty_names"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystemArchitecture.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystemArchitecture.java deleted file mode 100644 index e9b3da031..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystemArchitecture.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterOperatingSystemArchitecture - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterOperatingSystemArchitecture implements JsonpSerializable { - private final String arch; - - private final int count; - - // --------------------------------------------------------------------------------------------- - - private ClusterOperatingSystemArchitecture(Builder builder) { - - this.arch = ApiTypeHelper.requireNonNull(builder.arch, this, "arch"); - this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); - - } - - public static ClusterOperatingSystemArchitecture of( - Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Name of an architecture used by one or more selected nodes. - *

- * API name: {@code arch} - */ - public final String arch() { - return this.arch; - } - - /** - * Required - Number of selected nodes using the architecture. - *

- * API name: {@code count} - */ - public final int count() { - return this.count; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("arch"); - generator.write(this.arch); - - generator.writeKey("count"); - generator.write(this.count); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterOperatingSystemArchitecture}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private String arch; - - private Integer count; - - /** - * Required - Name of an architecture used by one or more selected nodes. - *

- * API name: {@code arch} - */ - public final Builder arch(String value) { - this.arch = value; - return this; - } - - /** - * Required - Number of selected nodes using the architecture. - *

- * API name: {@code count} - */ - public final Builder count(int value) { - this.count = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterOperatingSystemArchitecture}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterOperatingSystemArchitecture build() { - _checkSingleUse(); - - return new ClusterOperatingSystemArchitecture(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterOperatingSystemArchitecture} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, - ClusterOperatingSystemArchitecture::setupClusterOperatingSystemArchitectureDeserializer); - - protected static void setupClusterOperatingSystemArchitectureDeserializer( - ObjectDeserializer op) { - - op.add(Builder::arch, JsonpDeserializer.stringDeserializer(), "arch"); - op.add(Builder::count, JsonpDeserializer.integerDeserializer(), "count"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystemName.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystemName.java deleted file mode 100644 index ecf0cec5f..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystemName.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterOperatingSystemName - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterOperatingSystemName implements JsonpSerializable { - private final int count; - - private final String name; - - // --------------------------------------------------------------------------------------------- - - private ClusterOperatingSystemName(Builder builder) { - - this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - - } - - public static ClusterOperatingSystemName of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Number of selected nodes using the operating system. - *

- * API name: {@code count} - */ - public final int count() { - return this.count; - } - - /** - * Required - Name of an operating system used by one or more selected nodes. - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("count"); - generator.write(this.count); - - generator.writeKey("name"); - generator.write(this.name); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterOperatingSystemName}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Integer count; - - private String name; - - /** - * Required - Number of selected nodes using the operating system. - *

- * API name: {@code count} - */ - public final Builder count(int value) { - this.count = value; - return this; - } - - /** - * Required - Name of an operating system used by one or more selected nodes. - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterOperatingSystemName}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterOperatingSystemName build() { - _checkSingleUse(); - - return new ClusterOperatingSystemName(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterOperatingSystemName} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ClusterOperatingSystemName::setupClusterOperatingSystemNameDeserializer); - - protected static void setupClusterOperatingSystemNameDeserializer( - ObjectDeserializer op) { - - op.add(Builder::count, JsonpDeserializer.integerDeserializer(), "count"); - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystemPrettyName.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystemPrettyName.java deleted file mode 100644 index 2d3067fbd..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystemPrettyName.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterOperatingSystemPrettyName - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterOperatingSystemPrettyName implements JsonpSerializable { - private final int count; - - private final String prettyName; - - // --------------------------------------------------------------------------------------------- - - private ClusterOperatingSystemPrettyName(Builder builder) { - - this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); - this.prettyName = ApiTypeHelper.requireNonNull(builder.prettyName, this, "prettyName"); - - } - - public static ClusterOperatingSystemPrettyName of( - Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Number of selected nodes using the operating system. - *

- * API name: {@code count} - */ - public final int count() { - return this.count; - } - - /** - * Required - Human-readable name of an operating system used by one or more - * selected nodes. - *

- * API name: {@code pretty_name} - */ - public final String prettyName() { - return this.prettyName; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("count"); - generator.write(this.count); - - generator.writeKey("pretty_name"); - generator.write(this.prettyName); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterOperatingSystemPrettyName}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Integer count; - - private String prettyName; - - /** - * Required - Number of selected nodes using the operating system. - *

- * API name: {@code count} - */ - public final Builder count(int value) { - this.count = value; - return this; - } - - /** - * Required - Human-readable name of an operating system used by one or more - * selected nodes. - *

- * API name: {@code pretty_name} - */ - public final Builder prettyName(String value) { - this.prettyName = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterOperatingSystemPrettyName}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterOperatingSystemPrettyName build() { - _checkSingleUse(); - - return new ClusterOperatingSystemPrettyName(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterOperatingSystemPrettyName} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ClusterOperatingSystemPrettyName::setupClusterOperatingSystemPrettyNameDeserializer); - - protected static void setupClusterOperatingSystemPrettyNameDeserializer( - ObjectDeserializer op) { - - op.add(Builder::count, JsonpDeserializer.integerDeserializer(), "count"); - op.add(Builder::prettyName, JsonpDeserializer.stringDeserializer(), "pretty_name"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcess.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcess.java deleted file mode 100644 index 0e9e69e82..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcess.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterProcess - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterProcess implements JsonpSerializable { - private final ClusterProcessCpu cpu; - - private final ClusterProcessOpenFileDescriptors openFileDescriptors; - - // --------------------------------------------------------------------------------------------- - - private ClusterProcess(Builder builder) { - - this.cpu = ApiTypeHelper.requireNonNull(builder.cpu, this, "cpu"); - this.openFileDescriptors = ApiTypeHelper.requireNonNull(builder.openFileDescriptors, this, - "openFileDescriptors"); - - } - - public static ClusterProcess of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Contains statistics about CPU used by selected nodes. - *

- * API name: {@code cpu} - */ - public final ClusterProcessCpu cpu() { - return this.cpu; - } - - /** - * Required - Contains statistics about open file descriptors in selected nodes. - *

- * API name: {@code open_file_descriptors} - */ - public final ClusterProcessOpenFileDescriptors openFileDescriptors() { - return this.openFileDescriptors; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("cpu"); - this.cpu.serialize(generator, mapper); - - generator.writeKey("open_file_descriptors"); - this.openFileDescriptors.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterProcess}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private ClusterProcessCpu cpu; - - private ClusterProcessOpenFileDescriptors openFileDescriptors; - - /** - * Required - Contains statistics about CPU used by selected nodes. - *

- * API name: {@code cpu} - */ - public final Builder cpu(ClusterProcessCpu value) { - this.cpu = value; - return this; - } - - /** - * Required - Contains statistics about CPU used by selected nodes. - *

- * API name: {@code cpu} - */ - public final Builder cpu(Function> fn) { - return this.cpu(fn.apply(new ClusterProcessCpu.Builder()).build()); - } - - /** - * Required - Contains statistics about open file descriptors in selected nodes. - *

- * API name: {@code open_file_descriptors} - */ - public final Builder openFileDescriptors(ClusterProcessOpenFileDescriptors value) { - this.openFileDescriptors = value; - return this; - } - - /** - * Required - Contains statistics about open file descriptors in selected nodes. - *

- * API name: {@code open_file_descriptors} - */ - public final Builder openFileDescriptors( - Function> fn) { - return this.openFileDescriptors(fn.apply(new ClusterProcessOpenFileDescriptors.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterProcess}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterProcess build() { - _checkSingleUse(); - - return new ClusterProcess(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterProcess} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ClusterProcess::setupClusterProcessDeserializer); - - protected static void setupClusterProcessDeserializer(ObjectDeserializer op) { - - op.add(Builder::cpu, ClusterProcessCpu._DESERIALIZER, "cpu"); - op.add(Builder::openFileDescriptors, ClusterProcessOpenFileDescriptors._DESERIALIZER, "open_file_descriptors"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcessCpu.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcessCpu.java deleted file mode 100644 index d75ea6972..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcessCpu.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.util.Objects; -import java.util.function.Function; - -// typedef: cluster.stats.ClusterProcessCpu - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterProcessCpu implements JsonpSerializable { - private final int percent; - - // --------------------------------------------------------------------------------------------- - - private ClusterProcessCpu(Builder builder) { - - this.percent = ApiTypeHelper.requireNonNull(builder.percent, this, "percent"); - - } - - public static ClusterProcessCpu of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Percentage of CPU used across all selected nodes. Returns - * -1 if not supported. - *

- * API name: {@code percent} - */ - public final int percent() { - return this.percent; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("percent"); - generator.write(this.percent); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterProcessCpu}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Integer percent; - - /** - * Required - Percentage of CPU used across all selected nodes. Returns - * -1 if not supported. - *

- * API name: {@code percent} - */ - public final Builder percent(int value) { - this.percent = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterProcessCpu}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterProcessCpu build() { - _checkSingleUse(); - - return new ClusterProcessCpu(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterProcessCpu} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ClusterProcessCpu::setupClusterProcessCpuDeserializer); - - protected static void setupClusterProcessCpuDeserializer(ObjectDeserializer op) { - - op.add(Builder::percent, JsonpDeserializer.integerDeserializer(), "percent"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcessOpenFileDescriptors.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcessOpenFileDescriptors.java deleted file mode 100644 index 44ad87ed3..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcessOpenFileDescriptors.java +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; - -// typedef: cluster.stats.ClusterProcessOpenFileDescriptors - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterProcessOpenFileDescriptors implements JsonpSerializable { - private final long avg; - - private final long max; - - private final long min; - - // --------------------------------------------------------------------------------------------- - - private ClusterProcessOpenFileDescriptors(Builder builder) { - - this.avg = ApiTypeHelper.requireNonNull(builder.avg, this, "avg"); - this.max = ApiTypeHelper.requireNonNull(builder.max, this, "max"); - this.min = ApiTypeHelper.requireNonNull(builder.min, this, "min"); - - } - - public static ClusterProcessOpenFileDescriptors of( - Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Average number of concurrently open file descriptors. Returns - * -1 if not supported. - *

- * API name: {@code avg} - */ - public final long avg() { - return this.avg; - } - - /** - * Required - Maximum number of concurrently open file descriptors allowed - * across all selected nodes. Returns -1 if not supported. - *

- * API name: {@code max} - */ - public final long max() { - return this.max; - } - - /** - * Required - Minimum number of concurrently open file descriptors across all - * selected nodes. Returns -1 if not supported. - *

- * API name: {@code min} - */ - public final long min() { - return this.min; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("avg"); - generator.write(this.avg); - - generator.writeKey("max"); - generator.write(this.max); - - generator.writeKey("min"); - generator.write(this.min); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterProcessOpenFileDescriptors}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Long avg; - - private Long max; - - private Long min; - - /** - * Required - Average number of concurrently open file descriptors. Returns - * -1 if not supported. - *

- * API name: {@code avg} - */ - public final Builder avg(long value) { - this.avg = value; - return this; - } - - /** - * Required - Maximum number of concurrently open file descriptors allowed - * across all selected nodes. Returns -1 if not supported. - *

- * API name: {@code max} - */ - public final Builder max(long value) { - this.max = value; - return this; - } - - /** - * Required - Minimum number of concurrently open file descriptors across all - * selected nodes. Returns -1 if not supported. - *

- * API name: {@code min} - */ - public final Builder min(long value) { - this.min = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterProcessOpenFileDescriptors}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterProcessOpenFileDescriptors build() { - _checkSingleUse(); - - return new ClusterProcessOpenFileDescriptors(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterProcessOpenFileDescriptors} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ClusterProcessOpenFileDescriptors::setupClusterProcessOpenFileDescriptorsDeserializer); - - protected static void setupClusterProcessOpenFileDescriptorsDeserializer( - ObjectDeserializer op) { - - op.add(Builder::avg, JsonpDeserializer.longDeserializer(), "avg"); - op.add(Builder::max, JsonpDeserializer.longDeserializer(), "max"); - op.add(Builder::min, JsonpDeserializer.longDeserializer(), "min"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcessor.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcessor.java deleted file mode 100644 index 264875e18..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcessor.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.ClusterProcessor - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterProcessor implements JsonpSerializable { - private final long count; - - private final long current; - - private final long failed; - - @Nullable - private final Time time; - - private final long timeInMillis; - - // --------------------------------------------------------------------------------------------- - - private ClusterProcessor(Builder builder) { - - this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); - this.current = ApiTypeHelper.requireNonNull(builder.current, this, "current"); - this.failed = ApiTypeHelper.requireNonNull(builder.failed, this, "failed"); - this.time = builder.time; - this.timeInMillis = ApiTypeHelper.requireNonNull(builder.timeInMillis, this, "timeInMillis"); - - } - - public static ClusterProcessor of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code count} - */ - public final long count() { - return this.count; - } - - /** - * Required - API name: {@code current} - */ - public final long current() { - return this.current; - } - - /** - * Required - API name: {@code failed} - */ - public final long failed() { - return this.failed; - } - - /** - * API name: {@code time} - */ - @Nullable - public final Time time() { - return this.time; - } - - /** - * Required - API name: {@code time_in_millis} - */ - public final long timeInMillis() { - return this.timeInMillis; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("count"); - generator.write(this.count); - - generator.writeKey("current"); - generator.write(this.current); - - generator.writeKey("failed"); - generator.write(this.failed); - - if (this.time != null) { - generator.writeKey("time"); - this.time.serialize(generator, mapper); - - } - generator.writeKey("time_in_millis"); - generator.write(this.timeInMillis); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterProcessor}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Long count; - - private Long current; - - private Long failed; - - @Nullable - private Time time; - - private Long timeInMillis; - - /** - * Required - API name: {@code count} - */ - public final Builder count(long value) { - this.count = value; - return this; - } - - /** - * Required - API name: {@code current} - */ - public final Builder current(long value) { - this.current = value; - return this; - } - - /** - * Required - API name: {@code failed} - */ - public final Builder failed(long value) { - this.failed = value; - return this; - } - - /** - * API name: {@code time} - */ - public final Builder time(@Nullable Time value) { - this.time = value; - return this; - } - - /** - * API name: {@code time} - */ - public final Builder time(Function> fn) { - return this.time(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - API name: {@code time_in_millis} - */ - public final Builder timeInMillis(long value) { - this.timeInMillis = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterProcessor}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterProcessor build() { - _checkSingleUse(); - - return new ClusterProcessor(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterProcessor} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ClusterProcessor::setupClusterProcessorDeserializer); - - protected static void setupClusterProcessorDeserializer(ObjectDeserializer op) { - - op.add(Builder::count, JsonpDeserializer.longDeserializer(), "count"); - op.add(Builder::current, JsonpDeserializer.longDeserializer(), "current"); - op.add(Builder::failed, JsonpDeserializer.longDeserializer(), "failed"); - op.add(Builder::time, Time._DESERIALIZER, "time"); - op.add(Builder::timeInMillis, JsonpDeserializer.longDeserializer(), "time_in_millis"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterShardMetrics.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterShardMetrics.java deleted file mode 100644 index 7de8ebd93..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterShardMetrics.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Double; -import java.util.Objects; -import java.util.function.Function; - -// typedef: cluster.stats.ClusterShardMetrics - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClusterShardMetrics implements JsonpSerializable { - private final double avg; - - private final double max; - - private final double min; - - // --------------------------------------------------------------------------------------------- - - private ClusterShardMetrics(Builder builder) { - - this.avg = ApiTypeHelper.requireNonNull(builder.avg, this, "avg"); - this.max = ApiTypeHelper.requireNonNull(builder.max, this, "max"); - this.min = ApiTypeHelper.requireNonNull(builder.min, this, "min"); - - } - - public static ClusterShardMetrics of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Mean number of shards in an index, counting only shards assigned - * to selected nodes. - *

- * API name: {@code avg} - */ - public final double avg() { - return this.avg; - } - - /** - * Required - Maximum number of shards in an index, counting only shards - * assigned to selected nodes. - *

- * API name: {@code max} - */ - public final double max() { - return this.max; - } - - /** - * Required - Minimum number of shards in an index, counting only shards - * assigned to selected nodes. - *

- * API name: {@code min} - */ - public final double min() { - return this.min; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("avg"); - generator.write(this.avg); - - generator.writeKey("max"); - generator.write(this.max); - - generator.writeKey("min"); - generator.write(this.min); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClusterShardMetrics}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Double avg; - - private Double max; - - private Double min; - - /** - * Required - Mean number of shards in an index, counting only shards assigned - * to selected nodes. - *

- * API name: {@code avg} - */ - public final Builder avg(double value) { - this.avg = value; - return this; - } - - /** - * Required - Maximum number of shards in an index, counting only shards - * assigned to selected nodes. - *

- * API name: {@code max} - */ - public final Builder max(double value) { - this.max = value; - return this; - } - - /** - * Required - Minimum number of shards in an index, counting only shards - * assigned to selected nodes. - *

- * API name: {@code min} - */ - public final Builder min(double value) { - this.min = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClusterShardMetrics}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClusterShardMetrics build() { - _checkSingleUse(); - - return new ClusterShardMetrics(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClusterShardMetrics} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ClusterShardMetrics::setupClusterShardMetricsDeserializer); - - protected static void setupClusterShardMetricsDeserializer(ObjectDeserializer op) { - - op.add(Builder::avg, JsonpDeserializer.doubleDeserializer(), "avg"); - op.add(Builder::max, JsonpDeserializer.doubleDeserializer(), "max"); - op.add(Builder::min, JsonpDeserializer.doubleDeserializer(), "min"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/FieldTypes.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/FieldTypes.java deleted file mode 100644 index d850d408b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/FieldTypes.java +++ /dev/null @@ -1,343 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.FieldTypes - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class FieldTypes implements JsonpSerializable { - private final String name; - - private final int count; - - private final int indexCount; - - @Nullable - private final Long indexedVectorCount; - - @Nullable - private final Long indexedVectorDimMax; - - @Nullable - private final Long indexedVectorDimMin; - - @Nullable - private final Integer scriptCount; - - // --------------------------------------------------------------------------------------------- - - private FieldTypes(Builder builder) { - - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); - this.indexCount = ApiTypeHelper.requireNonNull(builder.indexCount, this, "indexCount"); - this.indexedVectorCount = builder.indexedVectorCount; - this.indexedVectorDimMax = builder.indexedVectorDimMax; - this.indexedVectorDimMin = builder.indexedVectorDimMin; - this.scriptCount = builder.scriptCount; - - } - - public static FieldTypes of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - The name for the field type in selected nodes. - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Required - The number of occurrences of the field type in selected nodes. - *

- * API name: {@code count} - */ - public final int count() { - return this.count; - } - - /** - * Required - The number of indices containing the field type in selected nodes. - *

- * API name: {@code index_count} - */ - public final int indexCount() { - return this.indexCount; - } - - /** - * For dense_vector field types, number of indexed vector types in selected - * nodes. - *

- * API name: {@code indexed_vector_count} - */ - @Nullable - public final Long indexedVectorCount() { - return this.indexedVectorCount; - } - - /** - * For dense_vector field types, the maximum dimension of all indexed vector - * types in selected nodes. - *

- * API name: {@code indexed_vector_dim_max} - */ - @Nullable - public final Long indexedVectorDimMax() { - return this.indexedVectorDimMax; - } - - /** - * For dense_vector field types, the minimum dimension of all indexed vector - * types in selected nodes. - *

- * API name: {@code indexed_vector_dim_min} - */ - @Nullable - public final Long indexedVectorDimMin() { - return this.indexedVectorDimMin; - } - - /** - * The number of fields that declare a script. - *

- * API name: {@code script_count} - */ - @Nullable - public final Integer scriptCount() { - return this.scriptCount; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("name"); - generator.write(this.name); - - generator.writeKey("count"); - generator.write(this.count); - - generator.writeKey("index_count"); - generator.write(this.indexCount); - - if (this.indexedVectorCount != null) { - generator.writeKey("indexed_vector_count"); - generator.write(this.indexedVectorCount); - - } - if (this.indexedVectorDimMax != null) { - generator.writeKey("indexed_vector_dim_max"); - generator.write(this.indexedVectorDimMax); - - } - if (this.indexedVectorDimMin != null) { - generator.writeKey("indexed_vector_dim_min"); - generator.write(this.indexedVectorDimMin); - - } - if (this.scriptCount != null) { - generator.writeKey("script_count"); - generator.write(this.scriptCount); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link FieldTypes}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String name; - - private Integer count; - - private Integer indexCount; - - @Nullable - private Long indexedVectorCount; - - @Nullable - private Long indexedVectorDimMax; - - @Nullable - private Long indexedVectorDimMin; - - @Nullable - private Integer scriptCount; - - /** - * Required - The name for the field type in selected nodes. - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Required - The number of occurrences of the field type in selected nodes. - *

- * API name: {@code count} - */ - public final Builder count(int value) { - this.count = value; - return this; - } - - /** - * Required - The number of indices containing the field type in selected nodes. - *

- * API name: {@code index_count} - */ - public final Builder indexCount(int value) { - this.indexCount = value; - return this; - } - - /** - * For dense_vector field types, number of indexed vector types in selected - * nodes. - *

- * API name: {@code indexed_vector_count} - */ - public final Builder indexedVectorCount(@Nullable Long value) { - this.indexedVectorCount = value; - return this; - } - - /** - * For dense_vector field types, the maximum dimension of all indexed vector - * types in selected nodes. - *

- * API name: {@code indexed_vector_dim_max} - */ - public final Builder indexedVectorDimMax(@Nullable Long value) { - this.indexedVectorDimMax = value; - return this; - } - - /** - * For dense_vector field types, the minimum dimension of all indexed vector - * types in selected nodes. - *

- * API name: {@code indexed_vector_dim_min} - */ - public final Builder indexedVectorDimMin(@Nullable Long value) { - this.indexedVectorDimMin = value; - return this; - } - - /** - * The number of fields that declare a script. - *

- * API name: {@code script_count} - */ - public final Builder scriptCount(@Nullable Integer value) { - this.scriptCount = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link FieldTypes}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public FieldTypes build() { - _checkSingleUse(); - - return new FieldTypes(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link FieldTypes} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - FieldTypes::setupFieldTypesDeserializer); - - protected static void setupFieldTypesDeserializer(ObjectDeserializer op) { - - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::count, JsonpDeserializer.integerDeserializer(), "count"); - op.add(Builder::indexCount, JsonpDeserializer.integerDeserializer(), "index_count"); - op.add(Builder::indexedVectorCount, JsonpDeserializer.longDeserializer(), "indexed_vector_count"); - op.add(Builder::indexedVectorDimMax, JsonpDeserializer.longDeserializer(), "indexed_vector_dim_max"); - op.add(Builder::indexedVectorDimMin, JsonpDeserializer.longDeserializer(), "indexed_vector_dim_min"); - op.add(Builder::scriptCount, JsonpDeserializer.integerDeserializer(), "script_count"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/FieldTypesMappings.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/FieldTypesMappings.java deleted file mode 100644 index 11049f07b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/FieldTypesMappings.java +++ /dev/null @@ -1,385 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.FieldTypesMappings - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class FieldTypesMappings implements JsonpSerializable { - private final List fieldTypes; - - private final List runtimeFieldTypes; - - @Nullable - private final Integer totalFieldCount; - - @Nullable - private final Integer totalDeduplicatedFieldCount; - - @Nullable - private final String totalDeduplicatedMappingSize; - - @Nullable - private final Long totalDeduplicatedMappingSizeInBytes; - - // --------------------------------------------------------------------------------------------- - - private FieldTypesMappings(Builder builder) { - - this.fieldTypes = ApiTypeHelper.unmodifiableRequired(builder.fieldTypes, this, "fieldTypes"); - this.runtimeFieldTypes = ApiTypeHelper.unmodifiable(builder.runtimeFieldTypes); - this.totalFieldCount = builder.totalFieldCount; - this.totalDeduplicatedFieldCount = builder.totalDeduplicatedFieldCount; - this.totalDeduplicatedMappingSize = builder.totalDeduplicatedMappingSize; - this.totalDeduplicatedMappingSizeInBytes = builder.totalDeduplicatedMappingSizeInBytes; - - } - - public static FieldTypesMappings of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Contains statistics about field data types used in selected nodes. - *

- * API name: {@code field_types} - */ - public final List fieldTypes() { - return this.fieldTypes; - } - - /** - * Contains statistics about runtime field data types used in selected nodes. - *

- * API name: {@code runtime_field_types} - */ - public final List runtimeFieldTypes() { - return this.runtimeFieldTypes; - } - - /** - * Total number of fields in all non-system indices. - *

- * API name: {@code total_field_count} - */ - @Nullable - public final Integer totalFieldCount() { - return this.totalFieldCount; - } - - /** - * Total number of fields in all non-system indices, accounting for mapping - * deduplication. - *

- * API name: {@code total_deduplicated_field_count} - */ - @Nullable - public final Integer totalDeduplicatedFieldCount() { - return this.totalDeduplicatedFieldCount; - } - - /** - * Total size of all mappings after deduplication and compression. - *

- * API name: {@code total_deduplicated_mapping_size} - */ - @Nullable - public final String totalDeduplicatedMappingSize() { - return this.totalDeduplicatedMappingSize; - } - - /** - * Total size of all mappings, in bytes, after deduplication and compression. - *

- * API name: {@code total_deduplicated_mapping_size_in_bytes} - */ - @Nullable - public final Long totalDeduplicatedMappingSizeInBytes() { - return this.totalDeduplicatedMappingSizeInBytes; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.fieldTypes)) { - generator.writeKey("field_types"); - generator.writeStartArray(); - for (FieldTypes item0 : this.fieldTypes) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.runtimeFieldTypes)) { - generator.writeKey("runtime_field_types"); - generator.writeStartArray(); - for (RuntimeFieldTypes item0 : this.runtimeFieldTypes) { - item0.serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.totalFieldCount != null) { - generator.writeKey("total_field_count"); - generator.write(this.totalFieldCount); - - } - if (this.totalDeduplicatedFieldCount != null) { - generator.writeKey("total_deduplicated_field_count"); - generator.write(this.totalDeduplicatedFieldCount); - - } - if (this.totalDeduplicatedMappingSize != null) { - generator.writeKey("total_deduplicated_mapping_size"); - generator.write(this.totalDeduplicatedMappingSize); - - } - if (this.totalDeduplicatedMappingSizeInBytes != null) { - generator.writeKey("total_deduplicated_mapping_size_in_bytes"); - generator.write(this.totalDeduplicatedMappingSizeInBytes); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link FieldTypesMappings}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private List fieldTypes; - - @Nullable - private List runtimeFieldTypes; - - @Nullable - private Integer totalFieldCount; - - @Nullable - private Integer totalDeduplicatedFieldCount; - - @Nullable - private String totalDeduplicatedMappingSize; - - @Nullable - private Long totalDeduplicatedMappingSizeInBytes; - - /** - * Required - Contains statistics about field data types used in selected nodes. - *

- * API name: {@code field_types} - *

- * Adds all elements of list to fieldTypes. - */ - public final Builder fieldTypes(List list) { - this.fieldTypes = _listAddAll(this.fieldTypes, list); - return this; - } - - /** - * Required - Contains statistics about field data types used in selected nodes. - *

- * API name: {@code field_types} - *

- * Adds one or more values to fieldTypes. - */ - public final Builder fieldTypes(FieldTypes value, FieldTypes... values) { - this.fieldTypes = _listAdd(this.fieldTypes, value, values); - return this; - } - - /** - * Required - Contains statistics about field data types used in selected nodes. - *

- * API name: {@code field_types} - *

- * Adds a value to fieldTypes using a builder lambda. - */ - public final Builder fieldTypes(Function> fn) { - return fieldTypes(fn.apply(new FieldTypes.Builder()).build()); - } - - /** - * Contains statistics about runtime field data types used in selected nodes. - *

- * API name: {@code runtime_field_types} - *

- * Adds all elements of list to runtimeFieldTypes. - */ - public final Builder runtimeFieldTypes(List list) { - this.runtimeFieldTypes = _listAddAll(this.runtimeFieldTypes, list); - return this; - } - - /** - * Contains statistics about runtime field data types used in selected nodes. - *

- * API name: {@code runtime_field_types} - *

- * Adds one or more values to runtimeFieldTypes. - */ - public final Builder runtimeFieldTypes(RuntimeFieldTypes value, RuntimeFieldTypes... values) { - this.runtimeFieldTypes = _listAdd(this.runtimeFieldTypes, value, values); - return this; - } - - /** - * Contains statistics about runtime field data types used in selected nodes. - *

- * API name: {@code runtime_field_types} - *

- * Adds a value to runtimeFieldTypes using a builder lambda. - */ - public final Builder runtimeFieldTypes( - Function> fn) { - return runtimeFieldTypes(fn.apply(new RuntimeFieldTypes.Builder()).build()); - } - - /** - * Total number of fields in all non-system indices. - *

- * API name: {@code total_field_count} - */ - public final Builder totalFieldCount(@Nullable Integer value) { - this.totalFieldCount = value; - return this; - } - - /** - * Total number of fields in all non-system indices, accounting for mapping - * deduplication. - *

- * API name: {@code total_deduplicated_field_count} - */ - public final Builder totalDeduplicatedFieldCount(@Nullable Integer value) { - this.totalDeduplicatedFieldCount = value; - return this; - } - - /** - * Total size of all mappings after deduplication and compression. - *

- * API name: {@code total_deduplicated_mapping_size} - */ - public final Builder totalDeduplicatedMappingSize(@Nullable String value) { - this.totalDeduplicatedMappingSize = value; - return this; - } - - /** - * Total size of all mappings, in bytes, after deduplication and compression. - *

- * API name: {@code total_deduplicated_mapping_size_in_bytes} - */ - public final Builder totalDeduplicatedMappingSizeInBytes(@Nullable Long value) { - this.totalDeduplicatedMappingSizeInBytes = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link FieldTypesMappings}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public FieldTypesMappings build() { - _checkSingleUse(); - - return new FieldTypesMappings(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link FieldTypesMappings} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, FieldTypesMappings::setupFieldTypesMappingsDeserializer); - - protected static void setupFieldTypesMappingsDeserializer(ObjectDeserializer op) { - - op.add(Builder::fieldTypes, JsonpDeserializer.arrayDeserializer(FieldTypes._DESERIALIZER), "field_types"); - op.add(Builder::runtimeFieldTypes, JsonpDeserializer.arrayDeserializer(RuntimeFieldTypes._DESERIALIZER), - "runtime_field_types"); - op.add(Builder::totalFieldCount, JsonpDeserializer.integerDeserializer(), "total_field_count"); - op.add(Builder::totalDeduplicatedFieldCount, JsonpDeserializer.integerDeserializer(), - "total_deduplicated_field_count"); - op.add(Builder::totalDeduplicatedMappingSize, JsonpDeserializer.stringDeserializer(), - "total_deduplicated_mapping_size"); - op.add(Builder::totalDeduplicatedMappingSizeInBytes, JsonpDeserializer.longDeserializer(), - "total_deduplicated_mapping_size_in_bytes"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndexingPressureMemory.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndexingPressureMemory.java deleted file mode 100644 index 6b711179c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndexingPressureMemory.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.IndexingPressureMemory - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexingPressureMemory implements JsonpSerializable { - private final IndexingPressureMemorySummary current; - - private final long limitInBytes; - - private final IndexingPressureMemorySummary total; - - // --------------------------------------------------------------------------------------------- - - private IndexingPressureMemory(Builder builder) { - - this.current = ApiTypeHelper.requireNonNull(builder.current, this, "current"); - this.limitInBytes = ApiTypeHelper.requireNonNull(builder.limitInBytes, this, "limitInBytes"); - this.total = ApiTypeHelper.requireNonNull(builder.total, this, "total"); - - } - - public static IndexingPressureMemory of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code current} - */ - public final IndexingPressureMemorySummary current() { - return this.current; - } - - /** - * Required - API name: {@code limit_in_bytes} - */ - public final long limitInBytes() { - return this.limitInBytes; - } - - /** - * Required - API name: {@code total} - */ - public final IndexingPressureMemorySummary total() { - return this.total; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("current"); - this.current.serialize(generator, mapper); - - generator.writeKey("limit_in_bytes"); - generator.write(this.limitInBytes); - - generator.writeKey("total"); - this.total.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexingPressureMemory}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private IndexingPressureMemorySummary current; - - private Long limitInBytes; - - private IndexingPressureMemorySummary total; - - /** - * Required - API name: {@code current} - */ - public final Builder current(IndexingPressureMemorySummary value) { - this.current = value; - return this; - } - - /** - * Required - API name: {@code current} - */ - public final Builder current( - Function> fn) { - return this.current(fn.apply(new IndexingPressureMemorySummary.Builder()).build()); - } - - /** - * Required - API name: {@code limit_in_bytes} - */ - public final Builder limitInBytes(long value) { - this.limitInBytes = value; - return this; - } - - /** - * Required - API name: {@code total} - */ - public final Builder total(IndexingPressureMemorySummary value) { - this.total = value; - return this; - } - - /** - * Required - API name: {@code total} - */ - public final Builder total( - Function> fn) { - return this.total(fn.apply(new IndexingPressureMemorySummary.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexingPressureMemory}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexingPressureMemory build() { - _checkSingleUse(); - - return new IndexingPressureMemory(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexingPressureMemory} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexingPressureMemory::setupIndexingPressureMemoryDeserializer); - - protected static void setupIndexingPressureMemoryDeserializer( - ObjectDeserializer op) { - - op.add(Builder::current, IndexingPressureMemorySummary._DESERIALIZER, "current"); - op.add(Builder::limitInBytes, JsonpDeserializer.longDeserializer(), "limit_in_bytes"); - op.add(Builder::total, IndexingPressureMemorySummary._DESERIALIZER, "total"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndexingPressureMemorySummary.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndexingPressureMemorySummary.java deleted file mode 100644 index 567cb3d24..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndexingPressureMemorySummary.java +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.IndexingPressureMemorySummary - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndexingPressureMemorySummary implements JsonpSerializable { - private final long allInBytes; - - private final long combinedCoordinatingAndPrimaryInBytes; - - private final long coordinatingInBytes; - - @Nullable - private final Long coordinatingRejections; - - private final long primaryInBytes; - - @Nullable - private final Long primaryRejections; - - private final long replicaInBytes; - - @Nullable - private final Long replicaRejections; - - // --------------------------------------------------------------------------------------------- - - private IndexingPressureMemorySummary(Builder builder) { - - this.allInBytes = ApiTypeHelper.requireNonNull(builder.allInBytes, this, "allInBytes"); - this.combinedCoordinatingAndPrimaryInBytes = ApiTypeHelper.requireNonNull( - builder.combinedCoordinatingAndPrimaryInBytes, this, "combinedCoordinatingAndPrimaryInBytes"); - this.coordinatingInBytes = ApiTypeHelper.requireNonNull(builder.coordinatingInBytes, this, - "coordinatingInBytes"); - this.coordinatingRejections = builder.coordinatingRejections; - this.primaryInBytes = ApiTypeHelper.requireNonNull(builder.primaryInBytes, this, "primaryInBytes"); - this.primaryRejections = builder.primaryRejections; - this.replicaInBytes = ApiTypeHelper.requireNonNull(builder.replicaInBytes, this, "replicaInBytes"); - this.replicaRejections = builder.replicaRejections; - - } - - public static IndexingPressureMemorySummary of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code all_in_bytes} - */ - public final long allInBytes() { - return this.allInBytes; - } - - /** - * Required - API name: {@code combined_coordinating_and_primary_in_bytes} - */ - public final long combinedCoordinatingAndPrimaryInBytes() { - return this.combinedCoordinatingAndPrimaryInBytes; - } - - /** - * Required - API name: {@code coordinating_in_bytes} - */ - public final long coordinatingInBytes() { - return this.coordinatingInBytes; - } - - /** - * API name: {@code coordinating_rejections} - */ - @Nullable - public final Long coordinatingRejections() { - return this.coordinatingRejections; - } - - /** - * Required - API name: {@code primary_in_bytes} - */ - public final long primaryInBytes() { - return this.primaryInBytes; - } - - /** - * API name: {@code primary_rejections} - */ - @Nullable - public final Long primaryRejections() { - return this.primaryRejections; - } - - /** - * Required - API name: {@code replica_in_bytes} - */ - public final long replicaInBytes() { - return this.replicaInBytes; - } - - /** - * API name: {@code replica_rejections} - */ - @Nullable - public final Long replicaRejections() { - return this.replicaRejections; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("all_in_bytes"); - generator.write(this.allInBytes); - - generator.writeKey("combined_coordinating_and_primary_in_bytes"); - generator.write(this.combinedCoordinatingAndPrimaryInBytes); - - generator.writeKey("coordinating_in_bytes"); - generator.write(this.coordinatingInBytes); - - if (this.coordinatingRejections != null) { - generator.writeKey("coordinating_rejections"); - generator.write(this.coordinatingRejections); - - } - generator.writeKey("primary_in_bytes"); - generator.write(this.primaryInBytes); - - if (this.primaryRejections != null) { - generator.writeKey("primary_rejections"); - generator.write(this.primaryRejections); - - } - generator.writeKey("replica_in_bytes"); - generator.write(this.replicaInBytes); - - if (this.replicaRejections != null) { - generator.writeKey("replica_rejections"); - generator.write(this.replicaRejections); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndexingPressureMemorySummary}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Long allInBytes; - - private Long combinedCoordinatingAndPrimaryInBytes; - - private Long coordinatingInBytes; - - @Nullable - private Long coordinatingRejections; - - private Long primaryInBytes; - - @Nullable - private Long primaryRejections; - - private Long replicaInBytes; - - @Nullable - private Long replicaRejections; - - /** - * Required - API name: {@code all_in_bytes} - */ - public final Builder allInBytes(long value) { - this.allInBytes = value; - return this; - } - - /** - * Required - API name: {@code combined_coordinating_and_primary_in_bytes} - */ - public final Builder combinedCoordinatingAndPrimaryInBytes(long value) { - this.combinedCoordinatingAndPrimaryInBytes = value; - return this; - } - - /** - * Required - API name: {@code coordinating_in_bytes} - */ - public final Builder coordinatingInBytes(long value) { - this.coordinatingInBytes = value; - return this; - } - - /** - * API name: {@code coordinating_rejections} - */ - public final Builder coordinatingRejections(@Nullable Long value) { - this.coordinatingRejections = value; - return this; - } - - /** - * Required - API name: {@code primary_in_bytes} - */ - public final Builder primaryInBytes(long value) { - this.primaryInBytes = value; - return this; - } - - /** - * API name: {@code primary_rejections} - */ - public final Builder primaryRejections(@Nullable Long value) { - this.primaryRejections = value; - return this; - } - - /** - * Required - API name: {@code replica_in_bytes} - */ - public final Builder replicaInBytes(long value) { - this.replicaInBytes = value; - return this; - } - - /** - * API name: {@code replica_rejections} - */ - public final Builder replicaRejections(@Nullable Long value) { - this.replicaRejections = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndexingPressureMemorySummary}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndexingPressureMemorySummary build() { - _checkSingleUse(); - - return new IndexingPressureMemorySummary(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndexingPressureMemorySummary} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, IndexingPressureMemorySummary::setupIndexingPressureMemorySummaryDeserializer); - - protected static void setupIndexingPressureMemorySummaryDeserializer( - ObjectDeserializer op) { - - op.add(Builder::allInBytes, JsonpDeserializer.longDeserializer(), "all_in_bytes"); - op.add(Builder::combinedCoordinatingAndPrimaryInBytes, JsonpDeserializer.longDeserializer(), - "combined_coordinating_and_primary_in_bytes"); - op.add(Builder::coordinatingInBytes, JsonpDeserializer.longDeserializer(), "coordinating_in_bytes"); - op.add(Builder::coordinatingRejections, JsonpDeserializer.longDeserializer(), "coordinating_rejections"); - op.add(Builder::primaryInBytes, JsonpDeserializer.longDeserializer(), "primary_in_bytes"); - op.add(Builder::primaryRejections, JsonpDeserializer.longDeserializer(), "primary_rejections"); - op.add(Builder::replicaInBytes, JsonpDeserializer.longDeserializer(), "replica_in_bytes"); - op.add(Builder::replicaRejections, JsonpDeserializer.longDeserializer(), "replica_rejections"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndicesVersions.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndicesVersions.java deleted file mode 100644 index 570be4ccd..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndicesVersions.java +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.IndicesVersions - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class IndicesVersions implements JsonpSerializable { - private final int indexCount; - - private final int primaryShardCount; - - private final long totalPrimaryBytes; - - private final String version; - - // --------------------------------------------------------------------------------------------- - - private IndicesVersions(Builder builder) { - - this.indexCount = ApiTypeHelper.requireNonNull(builder.indexCount, this, "indexCount"); - this.primaryShardCount = ApiTypeHelper.requireNonNull(builder.primaryShardCount, this, "primaryShardCount"); - this.totalPrimaryBytes = ApiTypeHelper.requireNonNull(builder.totalPrimaryBytes, this, "totalPrimaryBytes"); - this.version = ApiTypeHelper.requireNonNull(builder.version, this, "version"); - - } - - public static IndicesVersions of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code index_count} - */ - public final int indexCount() { - return this.indexCount; - } - - /** - * Required - API name: {@code primary_shard_count} - */ - public final int primaryShardCount() { - return this.primaryShardCount; - } - - /** - * Required - API name: {@code total_primary_bytes} - */ - public final long totalPrimaryBytes() { - return this.totalPrimaryBytes; - } - - /** - * Required - API name: {@code version} - */ - public final String version() { - return this.version; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("index_count"); - generator.write(this.indexCount); - - generator.writeKey("primary_shard_count"); - generator.write(this.primaryShardCount); - - generator.writeKey("total_primary_bytes"); - generator.write(this.totalPrimaryBytes); - - generator.writeKey("version"); - generator.write(this.version); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndicesVersions}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Integer indexCount; - - private Integer primaryShardCount; - - private Long totalPrimaryBytes; - - private String version; - - /** - * Required - API name: {@code index_count} - */ - public final Builder indexCount(int value) { - this.indexCount = value; - return this; - } - - /** - * Required - API name: {@code primary_shard_count} - */ - public final Builder primaryShardCount(int value) { - this.primaryShardCount = value; - return this; - } - - /** - * Required - API name: {@code total_primary_bytes} - */ - public final Builder totalPrimaryBytes(long value) { - this.totalPrimaryBytes = value; - return this; - } - - /** - * Required - API name: {@code version} - */ - public final Builder version(String value) { - this.version = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link IndicesVersions}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndicesVersions build() { - _checkSingleUse(); - - return new IndicesVersions(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndicesVersions} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - IndicesVersions::setupIndicesVersionsDeserializer); - - protected static void setupIndicesVersionsDeserializer(ObjectDeserializer op) { - - op.add(Builder::indexCount, JsonpDeserializer.integerDeserializer(), "index_count"); - op.add(Builder::primaryShardCount, JsonpDeserializer.integerDeserializer(), "primary_shard_count"); - op.add(Builder::totalPrimaryBytes, JsonpDeserializer.longDeserializer(), "total_primary_bytes"); - op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/NodePackagingType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/NodePackagingType.java deleted file mode 100644 index fb3866308..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/NodePackagingType.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.NodePackagingType - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class NodePackagingType implements JsonpSerializable { - private final int count; - - private final String flavor; - - private final String type; - - // --------------------------------------------------------------------------------------------- - - private NodePackagingType(Builder builder) { - - this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); - this.flavor = ApiTypeHelper.requireNonNull(builder.flavor, this, "flavor"); - this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); - - } - - public static NodePackagingType of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Number of selected nodes using the distribution flavor and file - * type. - *

- * API name: {@code count} - */ - public final int count() { - return this.count; - } - - /** - * Required - Type of Elasticsearch distribution. This is always - * default. - *

- * API name: {@code flavor} - */ - public final String flavor() { - return this.flavor; - } - - /** - * Required - File type (such as tar or zip) used for - * the distribution package. - *

- * API name: {@code type} - */ - public final String type() { - return this.type; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("count"); - generator.write(this.count); - - generator.writeKey("flavor"); - generator.write(this.flavor); - - generator.writeKey("type"); - generator.write(this.type); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link NodePackagingType}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Integer count; - - private String flavor; - - private String type; - - /** - * Required - Number of selected nodes using the distribution flavor and file - * type. - *

- * API name: {@code count} - */ - public final Builder count(int value) { - this.count = value; - return this; - } - - /** - * Required - Type of Elasticsearch distribution. This is always - * default. - *

- * API name: {@code flavor} - */ - public final Builder flavor(String value) { - this.flavor = value; - return this; - } - - /** - * Required - File type (such as tar or zip) used for - * the distribution package. - *

- * API name: {@code type} - */ - public final Builder type(String value) { - this.type = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link NodePackagingType}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public NodePackagingType build() { - _checkSingleUse(); - - return new NodePackagingType(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link NodePackagingType} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, NodePackagingType::setupNodePackagingTypeDeserializer); - - protected static void setupNodePackagingTypeDeserializer(ObjectDeserializer op) { - - op.add(Builder::count, JsonpDeserializer.integerDeserializer(), "count"); - op.add(Builder::flavor, JsonpDeserializer.stringDeserializer(), "flavor"); - op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/OperatingSystemMemoryInfo.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/OperatingSystemMemoryInfo.java deleted file mode 100644 index f9d74ee68..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/OperatingSystemMemoryInfo.java +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.Long; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.OperatingSystemMemoryInfo - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class OperatingSystemMemoryInfo implements JsonpSerializable { - @Nullable - private final Long adjustedTotalInBytes; - - private final long freeInBytes; - - private final int freePercent; - - private final long totalInBytes; - - private final long usedInBytes; - - private final int usedPercent; - - // --------------------------------------------------------------------------------------------- - - private OperatingSystemMemoryInfo(Builder builder) { - - this.adjustedTotalInBytes = builder.adjustedTotalInBytes; - this.freeInBytes = ApiTypeHelper.requireNonNull(builder.freeInBytes, this, "freeInBytes"); - this.freePercent = ApiTypeHelper.requireNonNull(builder.freePercent, this, "freePercent"); - this.totalInBytes = ApiTypeHelper.requireNonNull(builder.totalInBytes, this, "totalInBytes"); - this.usedInBytes = ApiTypeHelper.requireNonNull(builder.usedInBytes, this, "usedInBytes"); - this.usedPercent = ApiTypeHelper.requireNonNull(builder.usedPercent, this, "usedPercent"); - - } - - public static OperatingSystemMemoryInfo of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Total amount, in bytes, of memory across all selected nodes, but using the - * value specified using the es.total_memory_bytes system property - * instead of measured total memory for those nodes where that system property - * was set. - *

- * API name: {@code adjusted_total_in_bytes} - */ - @Nullable - public final Long adjustedTotalInBytes() { - return this.adjustedTotalInBytes; - } - - /** - * Required - Amount, in bytes, of free physical memory across all selected - * nodes. - *

- * API name: {@code free_in_bytes} - */ - public final long freeInBytes() { - return this.freeInBytes; - } - - /** - * Required - Percentage of free physical memory across all selected nodes. - *

- * API name: {@code free_percent} - */ - public final int freePercent() { - return this.freePercent; - } - - /** - * Required - Total amount, in bytes, of physical memory across all selected - * nodes. - *

- * API name: {@code total_in_bytes} - */ - public final long totalInBytes() { - return this.totalInBytes; - } - - /** - * Required - Amount, in bytes, of physical memory in use across all selected - * nodes. - *

- * API name: {@code used_in_bytes} - */ - public final long usedInBytes() { - return this.usedInBytes; - } - - /** - * Required - Percentage of physical memory in use across all selected nodes. - *

- * API name: {@code used_percent} - */ - public final int usedPercent() { - return this.usedPercent; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.adjustedTotalInBytes != null) { - generator.writeKey("adjusted_total_in_bytes"); - generator.write(this.adjustedTotalInBytes); - - } - generator.writeKey("free_in_bytes"); - generator.write(this.freeInBytes); - - generator.writeKey("free_percent"); - generator.write(this.freePercent); - - generator.writeKey("total_in_bytes"); - generator.write(this.totalInBytes); - - generator.writeKey("used_in_bytes"); - generator.write(this.usedInBytes); - - generator.writeKey("used_percent"); - generator.write(this.usedPercent); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link OperatingSystemMemoryInfo}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - @Nullable - private Long adjustedTotalInBytes; - - private Long freeInBytes; - - private Integer freePercent; - - private Long totalInBytes; - - private Long usedInBytes; - - private Integer usedPercent; - - /** - * Total amount, in bytes, of memory across all selected nodes, but using the - * value specified using the es.total_memory_bytes system property - * instead of measured total memory for those nodes where that system property - * was set. - *

- * API name: {@code adjusted_total_in_bytes} - */ - public final Builder adjustedTotalInBytes(@Nullable Long value) { - this.adjustedTotalInBytes = value; - return this; - } - - /** - * Required - Amount, in bytes, of free physical memory across all selected - * nodes. - *

- * API name: {@code free_in_bytes} - */ - public final Builder freeInBytes(long value) { - this.freeInBytes = value; - return this; - } - - /** - * Required - Percentage of free physical memory across all selected nodes. - *

- * API name: {@code free_percent} - */ - public final Builder freePercent(int value) { - this.freePercent = value; - return this; - } - - /** - * Required - Total amount, in bytes, of physical memory across all selected - * nodes. - *

- * API name: {@code total_in_bytes} - */ - public final Builder totalInBytes(long value) { - this.totalInBytes = value; - return this; - } - - /** - * Required - Amount, in bytes, of physical memory in use across all selected - * nodes. - *

- * API name: {@code used_in_bytes} - */ - public final Builder usedInBytes(long value) { - this.usedInBytes = value; - return this; - } - - /** - * Required - Percentage of physical memory in use across all selected nodes. - *

- * API name: {@code used_percent} - */ - public final Builder usedPercent(int value) { - this.usedPercent = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link OperatingSystemMemoryInfo}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public OperatingSystemMemoryInfo build() { - _checkSingleUse(); - - return new OperatingSystemMemoryInfo(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link OperatingSystemMemoryInfo} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, OperatingSystemMemoryInfo::setupOperatingSystemMemoryInfoDeserializer); - - protected static void setupOperatingSystemMemoryInfoDeserializer( - ObjectDeserializer op) { - - op.add(Builder::adjustedTotalInBytes, JsonpDeserializer.longDeserializer(), "adjusted_total_in_bytes"); - op.add(Builder::freeInBytes, JsonpDeserializer.longDeserializer(), "free_in_bytes"); - op.add(Builder::freePercent, JsonpDeserializer.integerDeserializer(), "free_percent"); - op.add(Builder::totalInBytes, JsonpDeserializer.longDeserializer(), "total_in_bytes"); - op.add(Builder::usedInBytes, JsonpDeserializer.longDeserializer(), "used_in_bytes"); - op.add(Builder::usedPercent, JsonpDeserializer.integerDeserializer(), "used_percent"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/RuntimeFieldTypes.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/RuntimeFieldTypes.java deleted file mode 100644 index e901b0505..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/RuntimeFieldTypes.java +++ /dev/null @@ -1,550 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.String; -import java.util.List; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.RuntimeFieldTypes - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class RuntimeFieldTypes implements JsonpSerializable { - private final int charsMax; - - private final int charsTotal; - - private final int count; - - private final int docMax; - - private final int docTotal; - - private final int indexCount; - - private final List lang; - - private final int linesMax; - - private final int linesTotal; - - private final String name; - - private final int scriptlessCount; - - private final int shadowedCount; - - private final int sourceMax; - - private final int sourceTotal; - - // --------------------------------------------------------------------------------------------- - - private RuntimeFieldTypes(Builder builder) { - - this.charsMax = ApiTypeHelper.requireNonNull(builder.charsMax, this, "charsMax"); - this.charsTotal = ApiTypeHelper.requireNonNull(builder.charsTotal, this, "charsTotal"); - this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); - this.docMax = ApiTypeHelper.requireNonNull(builder.docMax, this, "docMax"); - this.docTotal = ApiTypeHelper.requireNonNull(builder.docTotal, this, "docTotal"); - this.indexCount = ApiTypeHelper.requireNonNull(builder.indexCount, this, "indexCount"); - this.lang = ApiTypeHelper.unmodifiableRequired(builder.lang, this, "lang"); - this.linesMax = ApiTypeHelper.requireNonNull(builder.linesMax, this, "linesMax"); - this.linesTotal = ApiTypeHelper.requireNonNull(builder.linesTotal, this, "linesTotal"); - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.scriptlessCount = ApiTypeHelper.requireNonNull(builder.scriptlessCount, this, "scriptlessCount"); - this.shadowedCount = ApiTypeHelper.requireNonNull(builder.shadowedCount, this, "shadowedCount"); - this.sourceMax = ApiTypeHelper.requireNonNull(builder.sourceMax, this, "sourceMax"); - this.sourceTotal = ApiTypeHelper.requireNonNull(builder.sourceTotal, this, "sourceTotal"); - - } - - public static RuntimeFieldTypes of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Maximum number of characters for a single runtime field script. - *

- * API name: {@code chars_max} - */ - public final int charsMax() { - return this.charsMax; - } - - /** - * Required - Total number of characters for the scripts that define the current - * runtime field data type. - *

- * API name: {@code chars_total} - */ - public final int charsTotal() { - return this.charsTotal; - } - - /** - * Required - Number of runtime fields mapped to the field data type in selected - * nodes. - *

- * API name: {@code count} - */ - public final int count() { - return this.count; - } - - /** - * Required - Maximum number of accesses to doc_values for a single runtime - * field script - *

- * API name: {@code doc_max} - */ - public final int docMax() { - return this.docMax; - } - - /** - * Required - Total number of accesses to doc_values for the scripts that define - * the current runtime field data type. - *

- * API name: {@code doc_total} - */ - public final int docTotal() { - return this.docTotal; - } - - /** - * Required - Number of indices containing a mapping of the runtime field data - * type in selected nodes. - *

- * API name: {@code index_count} - */ - public final int indexCount() { - return this.indexCount; - } - - /** - * Required - Script languages used for the runtime fields scripts. - *

- * API name: {@code lang} - */ - public final List lang() { - return this.lang; - } - - /** - * Required - Maximum number of lines for a single runtime field script. - *

- * API name: {@code lines_max} - */ - public final int linesMax() { - return this.linesMax; - } - - /** - * Required - Total number of lines for the scripts that define the current - * runtime field data type. - *

- * API name: {@code lines_total} - */ - public final int linesTotal() { - return this.linesTotal; - } - - /** - * Required - Field data type used in selected nodes. - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Required - Number of runtime fields that don’t declare a script. - *

- * API name: {@code scriptless_count} - */ - public final int scriptlessCount() { - return this.scriptlessCount; - } - - /** - * Required - Number of runtime fields that shadow an indexed field. - *

- * API name: {@code shadowed_count} - */ - public final int shadowedCount() { - return this.shadowedCount; - } - - /** - * Required - Maximum number of accesses to _source for a single runtime field - * script. - *

- * API name: {@code source_max} - */ - public final int sourceMax() { - return this.sourceMax; - } - - /** - * Required - Total number of accesses to _source for the scripts that define - * the current runtime field data type. - *

- * API name: {@code source_total} - */ - public final int sourceTotal() { - return this.sourceTotal; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("chars_max"); - generator.write(this.charsMax); - - generator.writeKey("chars_total"); - generator.write(this.charsTotal); - - generator.writeKey("count"); - generator.write(this.count); - - generator.writeKey("doc_max"); - generator.write(this.docMax); - - generator.writeKey("doc_total"); - generator.write(this.docTotal); - - generator.writeKey("index_count"); - generator.write(this.indexCount); - - if (ApiTypeHelper.isDefined(this.lang)) { - generator.writeKey("lang"); - generator.writeStartArray(); - for (String item0 : this.lang) { - generator.write(item0); - - } - generator.writeEnd(); - - } - generator.writeKey("lines_max"); - generator.write(this.linesMax); - - generator.writeKey("lines_total"); - generator.write(this.linesTotal); - - generator.writeKey("name"); - generator.write(this.name); - - generator.writeKey("scriptless_count"); - generator.write(this.scriptlessCount); - - generator.writeKey("shadowed_count"); - generator.write(this.shadowedCount); - - generator.writeKey("source_max"); - generator.write(this.sourceMax); - - generator.writeKey("source_total"); - generator.write(this.sourceTotal); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RuntimeFieldTypes}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Integer charsMax; - - private Integer charsTotal; - - private Integer count; - - private Integer docMax; - - private Integer docTotal; - - private Integer indexCount; - - private List lang; - - private Integer linesMax; - - private Integer linesTotal; - - private String name; - - private Integer scriptlessCount; - - private Integer shadowedCount; - - private Integer sourceMax; - - private Integer sourceTotal; - - /** - * Required - Maximum number of characters for a single runtime field script. - *

- * API name: {@code chars_max} - */ - public final Builder charsMax(int value) { - this.charsMax = value; - return this; - } - - /** - * Required - Total number of characters for the scripts that define the current - * runtime field data type. - *

- * API name: {@code chars_total} - */ - public final Builder charsTotal(int value) { - this.charsTotal = value; - return this; - } - - /** - * Required - Number of runtime fields mapped to the field data type in selected - * nodes. - *

- * API name: {@code count} - */ - public final Builder count(int value) { - this.count = value; - return this; - } - - /** - * Required - Maximum number of accesses to doc_values for a single runtime - * field script - *

- * API name: {@code doc_max} - */ - public final Builder docMax(int value) { - this.docMax = value; - return this; - } - - /** - * Required - Total number of accesses to doc_values for the scripts that define - * the current runtime field data type. - *

- * API name: {@code doc_total} - */ - public final Builder docTotal(int value) { - this.docTotal = value; - return this; - } - - /** - * Required - Number of indices containing a mapping of the runtime field data - * type in selected nodes. - *

- * API name: {@code index_count} - */ - public final Builder indexCount(int value) { - this.indexCount = value; - return this; - } - - /** - * Required - Script languages used for the runtime fields scripts. - *

- * API name: {@code lang} - *

- * Adds all elements of list to lang. - */ - public final Builder lang(List list) { - this.lang = _listAddAll(this.lang, list); - return this; - } - - /** - * Required - Script languages used for the runtime fields scripts. - *

- * API name: {@code lang} - *

- * Adds one or more values to lang. - */ - public final Builder lang(String value, String... values) { - this.lang = _listAdd(this.lang, value, values); - return this; - } - - /** - * Required - Maximum number of lines for a single runtime field script. - *

- * API name: {@code lines_max} - */ - public final Builder linesMax(int value) { - this.linesMax = value; - return this; - } - - /** - * Required - Total number of lines for the scripts that define the current - * runtime field data type. - *

- * API name: {@code lines_total} - */ - public final Builder linesTotal(int value) { - this.linesTotal = value; - return this; - } - - /** - * Required - Field data type used in selected nodes. - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Required - Number of runtime fields that don’t declare a script. - *

- * API name: {@code scriptless_count} - */ - public final Builder scriptlessCount(int value) { - this.scriptlessCount = value; - return this; - } - - /** - * Required - Number of runtime fields that shadow an indexed field. - *

- * API name: {@code shadowed_count} - */ - public final Builder shadowedCount(int value) { - this.shadowedCount = value; - return this; - } - - /** - * Required - Maximum number of accesses to _source for a single runtime field - * script. - *

- * API name: {@code source_max} - */ - public final Builder sourceMax(int value) { - this.sourceMax = value; - return this; - } - - /** - * Required - Total number of accesses to _source for the scripts that define - * the current runtime field data type. - *

- * API name: {@code source_total} - */ - public final Builder sourceTotal(int value) { - this.sourceTotal = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link RuntimeFieldTypes}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RuntimeFieldTypes build() { - _checkSingleUse(); - - return new RuntimeFieldTypes(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link RuntimeFieldTypes} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, RuntimeFieldTypes::setupRuntimeFieldTypesDeserializer); - - protected static void setupRuntimeFieldTypesDeserializer(ObjectDeserializer op) { - - op.add(Builder::charsMax, JsonpDeserializer.integerDeserializer(), "chars_max"); - op.add(Builder::charsTotal, JsonpDeserializer.integerDeserializer(), "chars_total"); - op.add(Builder::count, JsonpDeserializer.integerDeserializer(), "count"); - op.add(Builder::docMax, JsonpDeserializer.integerDeserializer(), "doc_max"); - op.add(Builder::docTotal, JsonpDeserializer.integerDeserializer(), "doc_total"); - op.add(Builder::indexCount, JsonpDeserializer.integerDeserializer(), "index_count"); - op.add(Builder::lang, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "lang"); - op.add(Builder::linesMax, JsonpDeserializer.integerDeserializer(), "lines_max"); - op.add(Builder::linesTotal, JsonpDeserializer.integerDeserializer(), "lines_total"); - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); - op.add(Builder::scriptlessCount, JsonpDeserializer.integerDeserializer(), "scriptless_count"); - op.add(Builder::shadowedCount, JsonpDeserializer.integerDeserializer(), "shadowed_count"); - op.add(Builder::sourceMax, JsonpDeserializer.integerDeserializer(), "source_max"); - op.add(Builder::sourceTotal, JsonpDeserializer.integerDeserializer(), "source_total"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/StatsResponseBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/StatsResponseBase.java deleted file mode 100644 index dee3f021c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/StatsResponseBase.java +++ /dev/null @@ -1,273 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; - -import co.elastic.clients.elasticsearch._types.HealthStatus; -import co.elastic.clients.elasticsearch.nodes.NodesResponseBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: cluster.stats.StatsResponseBase - -/** - * - * @see API - * specification - */ - -public abstract class StatsResponseBase extends NodesResponseBase { - private final String clusterName; - - private final String clusterUuid; - - private final ClusterIndices indices; - - private final ClusterNodes nodes; - - private final HealthStatus status; - - private final long timestamp; - - // --------------------------------------------------------------------------------------------- - - protected StatsResponseBase(AbstractBuilder builder) { - super(builder); - - this.clusterName = ApiTypeHelper.requireNonNull(builder.clusterName, this, "clusterName"); - this.clusterUuid = ApiTypeHelper.requireNonNull(builder.clusterUuid, this, "clusterUuid"); - this.indices = ApiTypeHelper.requireNonNull(builder.indices, this, "indices"); - this.nodes = ApiTypeHelper.requireNonNull(builder.nodes, this, "nodes"); - this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status"); - this.timestamp = ApiTypeHelper.requireNonNull(builder.timestamp, this, "timestamp"); - - } - - /** - * Required - Name of the cluster, based on the cluster name setting. - *

- * API name: {@code cluster_name} - */ - public final String clusterName() { - return this.clusterName; - } - - /** - * Required - Unique identifier for the cluster. - *

- * API name: {@code cluster_uuid} - */ - public final String clusterUuid() { - return this.clusterUuid; - } - - /** - * Required - Contains statistics about indices with shards assigned to selected - * nodes. - *

- * API name: {@code indices} - */ - public final ClusterIndices indices() { - return this.indices; - } - - /** - * Required - Contains statistics about nodes selected by the request’s node - * filters. - *

- * API name: {@code nodes} - */ - public final ClusterNodes nodes() { - return this.nodes; - } - - /** - * Required - Health status of the cluster, based on the state of its primary - * and replica shards. - *

- * API name: {@code status} - */ - public final HealthStatus status() { - return this.status; - } - - /** - * Required - Unix timestamp, in milliseconds, for the last time the cluster - * statistics were refreshed. - *

- * API name: {@code timestamp} - */ - public final long timestamp() { - return this.timestamp; - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - super.serializeInternal(generator, mapper); - generator.writeKey("cluster_name"); - generator.write(this.clusterName); - - generator.writeKey("cluster_uuid"); - generator.write(this.clusterUuid); - - generator.writeKey("indices"); - this.indices.serialize(generator, mapper); - - generator.writeKey("nodes"); - this.nodes.serialize(generator, mapper); - - generator.writeKey("status"); - this.status.serialize(generator, mapper); - generator.writeKey("timestamp"); - generator.write(this.timestamp); - - } - - public abstract static class AbstractBuilder> - extends - NodesResponseBase.AbstractBuilder { - private String clusterName; - - private String clusterUuid; - - private ClusterIndices indices; - - private ClusterNodes nodes; - - private HealthStatus status; - - private Long timestamp; - - /** - * Required - Name of the cluster, based on the cluster name setting. - *

- * API name: {@code cluster_name} - */ - public final BuilderT clusterName(String value) { - this.clusterName = value; - return self(); - } - - /** - * Required - Unique identifier for the cluster. - *

- * API name: {@code cluster_uuid} - */ - public final BuilderT clusterUuid(String value) { - this.clusterUuid = value; - return self(); - } - - /** - * Required - Contains statistics about indices with shards assigned to selected - * nodes. - *

- * API name: {@code indices} - */ - public final BuilderT indices(ClusterIndices value) { - this.indices = value; - return self(); - } - - /** - * Required - Contains statistics about indices with shards assigned to selected - * nodes. - *

- * API name: {@code indices} - */ - public final BuilderT indices(Function> fn) { - return this.indices(fn.apply(new ClusterIndices.Builder()).build()); - } - - /** - * Required - Contains statistics about nodes selected by the request’s node - * filters. - *

- * API name: {@code nodes} - */ - public final BuilderT nodes(ClusterNodes value) { - this.nodes = value; - return self(); - } - - /** - * Required - Contains statistics about nodes selected by the request’s node - * filters. - *

- * API name: {@code nodes} - */ - public final BuilderT nodes(Function> fn) { - return this.nodes(fn.apply(new ClusterNodes.Builder()).build()); - } - - /** - * Required - Health status of the cluster, based on the state of its primary - * and replica shards. - *

- * API name: {@code status} - */ - public final BuilderT status(HealthStatus value) { - this.status = value; - return self(); - } - - /** - * Required - Unix timestamp, in milliseconds, for the last time the cluster - * statistics were refreshed. - *

- * API name: {@code timestamp} - */ - public final BuilderT timestamp(long value) { - this.timestamp = value; - return self(); - } - - } - - // --------------------------------------------------------------------------------------------- - protected static > void setupStatsResponseBaseDeserializer( - ObjectDeserializer op) { - NodesResponseBase.setupNodesResponseBaseDeserializer(op); - op.add(AbstractBuilder::clusterName, JsonpDeserializer.stringDeserializer(), "cluster_name"); - op.add(AbstractBuilder::clusterUuid, JsonpDeserializer.stringDeserializer(), "cluster_uuid"); - op.add(AbstractBuilder::indices, ClusterIndices._DESERIALIZER, "indices"); - op.add(AbstractBuilder::nodes, ClusterNodes._DESERIALIZER, "nodes"); - op.add(AbstractBuilder::status, HealthStatus._DESERIALIZER, "status"); - op.add(AbstractBuilder::timestamp, JsonpDeserializer.longDeserializer(), "timestamp"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/CreateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/CreateRequest.java index 61eb92752..7334e2749 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/CreateRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/CreateRequest.java @@ -464,7 +464,7 @@ public CreateRequest build() { * provided by the calling {@code JsonMapper}. */ public static final JsonpDeserializer> _DESERIALIZER = createCreateRequestDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.create.TDocument")); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.create.Request.TDocument")); public static JsonpDeserializer> createCreateRequestDeserializer( JsonpDeserializer tDocumentDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ExplainResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ExplainResponse.java index 65bdd1cfe..47baef4df 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ExplainResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ExplainResponse.java @@ -297,7 +297,7 @@ public static JsonpDeserializer> createEx */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createExplainResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.explain.TDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.explain.Response.TDocument"))); protected static void setupExplainResponseDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/GetResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/GetResponse.java index 7048ba143..53a68c795 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/GetResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/GetResponse.java @@ -111,7 +111,7 @@ public static JsonpDeserializer> createGetRes */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createGetResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.get.TDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.get.Response.TDocument"))); protected static void setupGetResponseDeserializer( ObjectDeserializer> op, JsonpDeserializer tDocumentDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/GetSourceResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/GetSourceResponse.java index 309eafb19..7da029922 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/GetSourceResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/GetSourceResponse.java @@ -164,7 +164,7 @@ public GetSourceResponse build() { * provided by the calling {@code JsonMapper}. */ public static final JsonpDeserializer> _DESERIALIZER = createGetSourceResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.get_source.TDocument")); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.get_source.Response.TDocument")); public static JsonpDeserializer> createGetSourceResponseDeserializer( JsonpDeserializer tDocumentDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/IndexRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/IndexRequest.java index d6ab508fc..49c561282 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/IndexRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/IndexRequest.java @@ -581,7 +581,7 @@ public IndexRequest build() { * provided by the calling {@code JsonMapper}. */ public static final JsonpDeserializer> _DESERIALIZER = createIndexRequestDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.index.TDocument")); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.index.Request.TDocument")); public static JsonpDeserializer> createIndexRequestDeserializer( JsonpDeserializer tDocumentDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MgetResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MgetResponse.java index fd8915a8f..e70bce65f 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MgetResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MgetResponse.java @@ -207,7 +207,7 @@ public static JsonpDeserializer> createMgetR */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createMgetResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.mget.TDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.mget.Response.TDocument"))); protected static void setupMgetResponseDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MsearchResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MsearchResponse.java index f099c3f95..a2c930a1f 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MsearchResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MsearchResponse.java @@ -111,7 +111,7 @@ public static JsonpDeserializer> createMs */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createMsearchResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.msearch.TDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.msearch.Response.TDocument"))); protected static void setupMsearchResponseDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MsearchTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MsearchTemplateResponse.java index 3b1da42e6..c786fee2a 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MsearchTemplateResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MsearchTemplateResponse.java @@ -111,8 +111,8 @@ public static JsonpDeserializer> * deserializers provided by the calling {@code JsonMapper}. */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer - .lazy(() -> createMsearchTemplateResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.msearch_template.TDocument"))); + .lazy(() -> createMsearchTemplateResponseDeserializer(new NamedDeserializer<>( + "co.elastic.clients:Deserializer:_global.msearch_template.Response.TDocument"))); protected static void setupMsearchTemplateResponseDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ScriptsPainlessExecuteResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ScriptsPainlessExecuteResponse.java index 8ffca225c..8375913b1 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ScriptsPainlessExecuteResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ScriptsPainlessExecuteResponse.java @@ -176,7 +176,7 @@ public static JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createScriptsPainlessExecuteResponseDeserializer(new NamedDeserializer<>( - "co.elastic.clients:Deserializer:_global.scripts_painless_execute.TResult"))); + "co.elastic.clients:Deserializer:_global.scripts_painless_execute.Response.TResult"))); protected static void setupScriptsPainlessExecuteResponseDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ScrollResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ScrollResponse.java index cc7b53c94..c4c4b9755 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ScrollResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ScrollResponse.java @@ -111,7 +111,7 @@ public static JsonpDeserializer> createScr */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createScrollResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.scroll.TDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.scroll.Response.TDocument"))); protected static void setupScrollResponseDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/SearchRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/SearchRequest.java index db9894637..b4c8000ca 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/SearchRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/SearchRequest.java @@ -22,9 +22,10 @@ import co.elastic.clients.elasticsearch._types.ErrorResponse; import co.elastic.clients.elasticsearch._types.ExpandWildcard; import co.elastic.clients.elasticsearch._types.FieldValue; -import co.elastic.clients.elasticsearch._types.KnnQuery; +import co.elastic.clients.elasticsearch._types.KnnSearch; import co.elastic.clients.elasticsearch._types.Rank; import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch._types.Retriever; import co.elastic.clients.elasticsearch._types.ScriptField; import co.elastic.clients.elasticsearch._types.SearchType; import co.elastic.clients.elasticsearch._types.SlicedScroll; @@ -154,7 +155,7 @@ public class SearchRequest extends RequestBase implements JsonpSerializable { private final List> indicesBoost; - private final List knn; + private final List knn; @Nullable private final Boolean lenient; @@ -197,6 +198,9 @@ public class SearchRequest extends RequestBase implements JsonpSerializable { private final List rescore; + @Nullable + private final Retriever retriever; + @Nullable private final String routing; @@ -286,6 +290,7 @@ private SearchRequest(Builder builder) { this.rank = builder.rank; this.requestCache = builder.requestCache; this.rescore = ApiTypeHelper.unmodifiable(builder.rescore); + this.retriever = builder.retriever; this.routing = builder.routing; this.runtimeMappings = ApiTypeHelper.unmodifiable(builder.runtimeMappings); this.scriptFields = ApiTypeHelper.unmodifiable(builder.scriptFields); @@ -561,7 +566,7 @@ public final List> indicesBoost() { *

* API name: {@code knn} */ - public final List knn() { + public final List knn() { return this.knn; } @@ -743,6 +748,18 @@ public final List rescore() { return this.rescore; } + /** + * A retriever is a specification to describe top documents returned from a + * search. A retriever replaces other elements of the search API that also + * return top documents such as query and knn. + *

+ * API name: {@code retriever} + */ + @Nullable + public final Retriever retriever() { + return this.retriever; + } + /** * Custom value used to route operations to a specific shard. *

@@ -1045,7 +1062,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (ApiTypeHelper.isDefined(this.knn)) { generator.writeKey("knn"); generator.writeStartArray(); - for (KnnQuery item0 : this.knn) { + for (KnnSearch item0 : this.knn) { item0.serialize(generator, mapper); } @@ -1091,6 +1108,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } generator.writeEnd(); + } + if (this.retriever != null) { + generator.writeKey("retriever"); + this.retriever.serialize(generator, mapper); + } if (ApiTypeHelper.isDefined(this.runtimeMappings)) { generator.writeKey("runtime_mappings"); @@ -1161,12 +1183,18 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } if (ApiTypeHelper.isDefined(this.storedFields)) { generator.writeKey("stored_fields"); - generator.writeStartArray(); - for (String item0 : this.storedFields) { - generator.write(item0); + if (this.storedFields.size() == 1) { + String singleItem = this.storedFields.get(0); + generator.write(singleItem); + } else { + generator.writeStartArray(); + for (String item0 : this.storedFields) { + generator.write(item0); + + } + generator.writeEnd(); } - generator.writeEnd(); } if (this.suggest != null) { @@ -1276,7 +1304,7 @@ public static class Builder extends RequestBase.AbstractBuilder impleme private List> indicesBoost; @Nullable - private List knn; + private List knn; @Nullable private Boolean lenient; @@ -1320,6 +1348,9 @@ public static class Builder extends RequestBase.AbstractBuilder impleme @Nullable private List rescore; + @Nullable + private Retriever retriever; + @Nullable private String routing; @@ -1806,7 +1837,7 @@ public final Builder indicesBoost(Map value, Map *

* Adds all elements of list to knn. */ - public final Builder knn(List list) { + public final Builder knn(List list) { this.knn = _listAddAll(this.knn, list); return this; } @@ -1818,7 +1849,7 @@ public final Builder knn(List list) { *

* Adds one or more values to knn. */ - public final Builder knn(KnnQuery value, KnnQuery... values) { + public final Builder knn(KnnSearch value, KnnSearch... values) { this.knn = _listAdd(this.knn, value, values); return this; } @@ -1830,8 +1861,8 @@ public final Builder knn(KnnQuery value, KnnQuery... values) { *

* Adds a value to knn using a builder lambda. */ - public final Builder knn(Function> fn) { - return knn(fn.apply(new KnnQuery.Builder()).build()); + public final Builder knn(Function> fn) { + return knn(fn.apply(new KnnSearch.Builder()).build()); } /** @@ -2081,6 +2112,29 @@ public final Builder rescore(Function> f return rescore(fn.apply(new Rescore.Builder()).build()); } + /** + * A retriever is a specification to describe top documents returned from a + * search. A retriever replaces other elements of the search API that also + * return top documents such as query and knn. + *

+ * API name: {@code retriever} + */ + public final Builder retriever(@Nullable Retriever value) { + this.retriever = value; + return this; + } + + /** + * A retriever is a specification to describe top documents returned from a + * search. A retriever replaces other elements of the search API that also + * return top documents such as query and knn. + *

+ * API name: {@code retriever} + */ + public final Builder retriever(Function> fn) { + return this.retriever(fn.apply(new Retriever.Builder()).build()); + } + /** * Custom value used to route operations to a specific shard. *

@@ -2588,7 +2642,7 @@ protected static void setupSearchRequestDeserializer(ObjectDeserializer JsonpDeserializer> createSea */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createSearchResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.search.TDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.search.Response.TDocument"))); protected static void setupSearchResponseDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/SearchTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/SearchTemplateResponse.java index f95d8e33f..c04134d0b 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/SearchTemplateResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/SearchTemplateResponse.java @@ -614,8 +614,8 @@ public static JsonpDeserializer> c * deserializers provided by the calling {@code JsonMapper}. */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer - .lazy(() -> createSearchTemplateResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.search_template.TDocument"))); + .lazy(() -> createSearchTemplateResponseDeserializer(new NamedDeserializer<>( + "co.elastic.clients:Deserializer:_global.search_template.Response.TDocument"))); protected static void setupSearchTemplateResponseDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/TermvectorsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/TermvectorsRequest.java index 7233b315e..2170c2b19 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/TermvectorsRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/TermvectorsRequest.java @@ -661,7 +661,7 @@ public static JsonpDeserializer> creat */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createTermvectorsRequestDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.termvectors.TDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.termvectors.Request.TDocument"))); protected static void setupTermvectorsRequestDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/UpdateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/UpdateRequest.java index e79316547..34a2ad78f 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/UpdateRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/UpdateRequest.java @@ -765,8 +765,9 @@ public static JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createUpdateRequestDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.update.TDocument"), - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.update.TPartialDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.update.Request.TDocument"), + new NamedDeserializer<>( + "co.elastic.clients:Deserializer:_global.update.Request.TPartialDocument"))); protected static void setupUpdateRequestDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/UpdateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/UpdateResponse.java index 87999969c..c5e1d2192 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/UpdateResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/UpdateResponse.java @@ -113,7 +113,7 @@ public static JsonpDeserializer> createUpd */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createUpdateResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.update.TDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.update.Response.TDocument"))); protected static void setupUpdateResponseDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/UpdateAction.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/UpdateAction.java index ce0fa4347..e2b71156d 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/UpdateAction.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/UpdateAction.java @@ -426,8 +426,9 @@ public static JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createUpdateActionDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.bulk.TDocument"), - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.bulk.TPartialDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.bulk.UpdateAction.TDocument"), + new NamedDeserializer<>( + "co.elastic.clients:Deserializer:_global.bulk.UpdateAction.TPartialDocument"))); protected static void setupUpdateActionDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/get/GetResult.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/get/GetResult.java index 43bbc8e8b..b82dbca4a 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/get/GetResult.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/get/GetResult.java @@ -417,7 +417,7 @@ public static JsonpDeserializer> createGetResul */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createGetResultDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.get.TDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.get.GetResult.TDocument"))); protected static > void setupGetResultDeserializer( ObjectDeserializer op, JsonpDeserializer tDocumentDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultiSearchItem.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultiSearchItem.java index 02980fd2e..01bd26855 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultiSearchItem.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultiSearchItem.java @@ -149,8 +149,8 @@ public static JsonpDeserializer> createMu * provided by the calling {@code JsonMapper}. */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer - .lazy(() -> createMultiSearchItemDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.msearch.TDocument"))); + .lazy(() -> createMultiSearchItemDeserializer(new NamedDeserializer<>( + "co.elastic.clients:Deserializer:_global.msearch.MultiSearchItem.TDocument"))); protected static void setupMultiSearchItemDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultisearchBody.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultisearchBody.java index 2eda888ed..100303892 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultisearchBody.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultisearchBody.java @@ -20,7 +20,7 @@ package co.elastic.clients.elasticsearch.core.msearch; import co.elastic.clients.elasticsearch._types.FieldValue; -import co.elastic.clients.elasticsearch._types.KnnQuery; +import co.elastic.clients.elasticsearch._types.KnnSearch; import co.elastic.clients.elasticsearch._types.ScriptField; import co.elastic.clients.elasticsearch._types.SortOptions; import co.elastic.clients.elasticsearch._types.aggregations.Aggregation; @@ -100,7 +100,7 @@ public class MultisearchBody implements JsonpSerializable { private final List docvalueFields; - private final List knn; + private final List knn; @Nullable private final Integer from; @@ -277,7 +277,7 @@ public final List docvalueFields() { *

* API name: {@code knn} */ - public final List knn() { + public final List knn() { return this.knn; } @@ -581,7 +581,7 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (ApiTypeHelper.isDefined(this.knn)) { generator.writeKey("knn"); generator.writeStartArray(); - for (KnnQuery item0 : this.knn) { + for (KnnSearch item0 : this.knn) { item0.serialize(generator, mapper); } @@ -790,7 +790,7 @@ public static class Builder extends WithJsonObjectBuilderBase implement private List docvalueFields; @Nullable - private List knn; + private List knn; @Nullable private Integer from; @@ -1034,7 +1034,7 @@ public final Builder docvalueFields(Function * Adds all elements of list to knn. */ - public final Builder knn(List list) { + public final Builder knn(List list) { this.knn = _listAddAll(this.knn, list); return this; } @@ -1046,7 +1046,7 @@ public final Builder knn(List list) { *

* Adds one or more values to knn. */ - public final Builder knn(KnnQuery value, KnnQuery... values) { + public final Builder knn(KnnSearch value, KnnSearch... values) { this.knn = _listAdd(this.knn, value, values); return this; } @@ -1058,8 +1058,8 @@ public final Builder knn(KnnQuery value, KnnQuery... values) { *

* Adds a value to knn using a builder lambda. */ - public final Builder knn(Function> fn) { - return knn(fn.apply(new KnnQuery.Builder()).build()); + public final Builder knn(Function> fn) { + return knn(fn.apply(new KnnSearch.Builder()).build()); } /** @@ -1623,7 +1623,7 @@ protected static void setupMultisearchBodyDeserializer(ObjectDeserializer * API name: {@code _id} */ + @Nullable public final String id() { return this.id; } @@ -271,9 +273,11 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey("_id"); - generator.write(this.id); + if (this.id != null) { + generator.writeKey("_id"); + generator.write(this.id); + } if (this.index != null) { generator.writeKey("_index"); generator.write(this.index); @@ -355,6 +359,7 @@ public String toString() { public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable private String id; @Nullable @@ -394,11 +399,11 @@ public static class Builder extends WithJsonObjectBuilderBase private VersionType versionType; /** - * Required - The ID of the document. + * The ID of the document. *

* API name: {@code _id} */ - public final Builder id(String value) { + public final Builder id(@Nullable String value) { this.id = value; return this; } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricDiscountedCumulativeGain.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricDiscountedCumulativeGain.java index ca192d856..e4b82bd20 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricDiscountedCumulativeGain.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricDiscountedCumulativeGain.java @@ -52,7 +52,7 @@ * Discounted cumulative gain (DCG) * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/search-rank-eval.html#_discounted_cumulative_gain_dcg">Documentation * on elastic.co * @see API diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricExpectedReciprocalRank.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricExpectedReciprocalRank.java index a27c001a4..b735e4612 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricExpectedReciprocalRank.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricExpectedReciprocalRank.java @@ -52,7 +52,7 @@ * Expected Reciprocal Rank (ERR) * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/search-rank-eval.html#_expected_reciprocal_rank_err">Documentation * on elastic.co * @see API diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricMeanReciprocalRank.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricMeanReciprocalRank.java index 0b42dc089..4251b7ab1 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricMeanReciprocalRank.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricMeanReciprocalRank.java @@ -49,7 +49,7 @@ * Mean Reciprocal Rank * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/search-rank-eval.html#_mean_reciprocal_rank">Documentation * on elastic.co * @see API diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricPrecision.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricPrecision.java index f9160cf23..bae8b3d21 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricPrecision.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricPrecision.java @@ -52,7 +52,7 @@ * Precision at K (P@k) * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/search-rank-eval.html#k-precision">Documentation * on elastic.co * @see API diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricRecall.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricRecall.java index 7732bb8aa..21a5aeb60 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricRecall.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricRecall.java @@ -49,7 +49,7 @@ * Recall at K (R@k) * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/search-rank-eval.html#k-recall">Documentation * on elastic.co * @see API diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/CompletionSuggest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/CompletionSuggest.java index a9846f94d..3671ce2a3 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/CompletionSuggest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/CompletionSuggest.java @@ -199,8 +199,8 @@ public static JsonpDeserializer> create * provided by the calling {@code JsonMapper}. */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer - .lazy(() -> createCompletionSuggestDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.search._types.TDocument"))); + .lazy(() -> createCompletionSuggestDeserializer(new NamedDeserializer<>( + "co.elastic.clients:Deserializer:_global.search._types.CompletionSuggest.TDocument"))); protected static void setupCompletionSuggestDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/CompletionSuggestOption.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/CompletionSuggestOption.java index ff2050d42..5433bbe17 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/CompletionSuggestOption.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/CompletionSuggestOption.java @@ -443,8 +443,8 @@ public static JsonpDeserializer> * deserializers provided by the calling {@code JsonMapper}. */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer - .lazy(() -> createCompletionSuggestOptionDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.search._types.TDocument"))); + .lazy(() -> createCompletionSuggestOptionDeserializer(new NamedDeserializer<>( + "co.elastic.clients:Deserializer:_global.search._types.CompletionSuggestOption.TDocument"))); protected static void setupCompletionSuggestOptionDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Context.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Context.java index 9d28c611b..048d9921b 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Context.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Context.java @@ -62,7 +62,7 @@ * document's field for the text. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/query-dsl-mlt-query.html#_document_input_parameters">Documentation * on elastic.co * @see API diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/FieldSuggester.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/FieldSuggester.java index 769fd4573..8cfb7aae5 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/FieldSuggester.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/FieldSuggester.java @@ -295,7 +295,7 @@ public String toString() { return JsonpUtils.toString(this); } - public static class Builder extends WithJsonObjectBuilderBase { + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { private Kind _kind; private Object _value; private String _customKind; @@ -391,7 +391,7 @@ public ContainerBuilder _custom(String name, Object data) { return new ContainerBuilder(); } - protected FieldSuggester build() { + public FieldSuggester build() { _checkSingleUse(); return new FieldSuggester(this); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Hit.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Hit.java index b039a2909..ec5717c81 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Hit.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Hit.java @@ -72,6 +72,7 @@ public class Hit implements JsonpSerializable { private final String index; + @Nullable private final String id; @Nullable @@ -126,7 +127,7 @@ public class Hit implements JsonpSerializable { private Hit(Builder builder) { this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); + this.id = builder.id; this.score = builder.score; this.explanation = builder.explanation; this.fields = ApiTypeHelper.unmodifiable(builder.fields); @@ -160,8 +161,9 @@ public final String index() { } /** - * Required - API name: {@code _id} + * API name: {@code _id} */ + @Nullable public final String id() { return this.id; } @@ -311,9 +313,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("_index"); generator.write(this.index); - generator.writeKey("_id"); - generator.write(this.id); + if (this.id != null) { + generator.writeKey("_id"); + generator.write(this.id); + } if (this.score != null) { generator.writeKey("_score"); JsonpUtils.serializeDoubleOrNull(generator, this.score, Double.NaN); @@ -470,6 +474,7 @@ public static class Builder extends WithJsonObjectBuilderBase> { private String index; + @Nullable private String id; @Nullable @@ -535,9 +540,9 @@ public final Builder index(String value) { } /** - * Required - API name: {@code _id} + * API name: {@code _id} */ - public final Builder id(String value) { + public final Builder id(@Nullable String value) { this.id = value; return this; } @@ -901,7 +906,7 @@ public static JsonpDeserializer> createHitDeserialize */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createHitDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.search._types.TDocument"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.search._types.Hit.TDocument"))); protected static void setupHitDeserializer(ObjectDeserializer> op, JsonpDeserializer tDocumentDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/HitsMetadata.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/HitsMetadata.java index 1f00ed4d8..002e64b5e 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/HitsMetadata.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/HitsMetadata.java @@ -280,7 +280,7 @@ public static JsonpDeserializer> createHitsMetadataDeseriali */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createHitsMetadataDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.search._types.T"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:_global.search._types.HitsMetadata.T"))); protected static void setupHitsMetadataDeserializer(ObjectDeserializer> op, JsonpDeserializer tDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/LearningToRank.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/LearningToRank.java new file mode 100644 index 000000000..38420cc9a --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/LearningToRank.java @@ -0,0 +1,222 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.core.search; + +import co.elastic.clients.json.JsonData; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _global.search._types.LearningToRank + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class LearningToRank implements RescoreVariant, JsonpSerializable { + private final String modelId; + + private final Map params; + + // --------------------------------------------------------------------------------------------- + + private LearningToRank(Builder builder) { + + this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId"); + this.params = ApiTypeHelper.unmodifiable(builder.params); + + } + + public static LearningToRank of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Rescore variant kind. + */ + @Override + public Rescore.Kind _rescoreKind() { + return Rescore.Kind.LearningToRank; + } + + /** + * Required - The unique identifier of the trained model uploaded to + * Elasticsearch + *

+ * API name: {@code model_id} + */ + public final String modelId() { + return this.modelId; + } + + /** + * Named parameters to be passed to the query templates used for feature + *

+ * API name: {@code params} + */ + public final Map params() { + return this.params; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeKey("model_id"); + generator.write(this.modelId); + + if (ApiTypeHelper.isDefined(this.params)) { + generator.writeKey("params"); + generator.writeStartObject(); + for (Map.Entry item0 : this.params.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link LearningToRank}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String modelId; + + @Nullable + private Map params; + + /** + * Required - The unique identifier of the trained model uploaded to + * Elasticsearch + *

+ * API name: {@code model_id} + */ + public final Builder modelId(String value) { + this.modelId = value; + return this; + } + + /** + * Named parameters to be passed to the query templates used for feature + *

+ * API name: {@code params} + *

+ * Adds all entries of map to params. + */ + public final Builder params(Map map) { + this.params = _mapPutAll(this.params, map); + return this; + } + + /** + * Named parameters to be passed to the query templates used for feature + *

+ * API name: {@code params} + *

+ * Adds an entry to params. + */ + public final Builder params(String key, JsonData value) { + this.params = _mapPut(this.params, key, value); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link LearningToRank}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public LearningToRank build() { + _checkSingleUse(); + + return new LearningToRank(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link LearningToRank} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + LearningToRank::setupLearningToRankDeserializer); + + protected static void setupLearningToRankDeserializer(ObjectDeserializer op) { + + op.add(Builder::modelId, JsonpDeserializer.stringDeserializer(), "model_id"); + op.add(Builder::params, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "params"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Rescore.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Rescore.java index d6e523391..2c98a221b 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Rescore.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Rescore.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch.core.search; +import co.elastic.clients.json.JsonData; +import co.elastic.clients.json.JsonEnum; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -28,9 +30,12 @@ import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.OpenTaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; import java.lang.Integer; +import java.lang.Object; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -59,17 +64,70 @@ * specification */ @JsonpDeserializable -public class Rescore implements JsonpSerializable { - private final RescoreQuery query; +public class Rescore implements OpenTaggedUnion, JsonpSerializable { + + /** + * {@link Rescore} variant kinds. + * + * @see API + * specification + */ + + public enum Kind implements JsonEnum { + Query("query"), + + LearningToRank("learning_to_rank"), + + /** A custom {@code Rescore} defined by a plugin */ + _Custom(null) + + ; + + private final String jsonValue; + + Kind(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } @Nullable private final Integer windowSize; - // --------------------------------------------------------------------------------------------- + public Rescore(RescoreVariant value) { + + this._kind = ApiTypeHelper.requireNonNull(value._rescoreKind(), this, ""); + this._value = ApiTypeHelper.requireNonNull(value, this, ""); + this._customKind = null; + + this.windowSize = null; + + } private Rescore(Builder builder) { - this.query = ApiTypeHelper.requireNonNull(builder.query, this, "query"); + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + this._customKind = builder._customKind; + this.windowSize = builder.windowSize; } @@ -79,33 +137,82 @@ public static Rescore of(Function> fn) { } /** - * Required - API name: {@code query} + * API name: {@code window_size} */ - public final RescoreQuery query() { - return this.query; + @Nullable + public final Integer windowSize() { + return this.windowSize; } /** - * API name: {@code window_size} + * Is this variant instance of kind {@code query}? + */ + public boolean isQuery() { + return _kind == Kind.Query; + } + + /** + * Get the {@code query} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code query} kind. + */ + public RescoreQuery query() { + return TaggedUnionUtils.get(this, Kind.Query); + } + + /** + * Is this variant instance of kind {@code learning_to_rank}? */ + public boolean isLearningToRank() { + return _kind == Kind.LearningToRank; + } + + /** + * Get the {@code learning_to_rank} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code learning_to_rank} + * kind. + */ + public LearningToRank learningToRank() { + return TaggedUnionUtils.get(this, Kind.LearningToRank); + } + @Nullable - public final Integer windowSize() { - return this.windowSize; + private final String _customKind; + + /** + * Is this a custom {@code Rescore} defined by a plugin? + */ + public boolean _isCustom() { + return _kind == Kind._Custom; } /** - * Serialize this object to JSON. + * Get the actual kind when {@code _kind()} equals {@link Kind#_Custom} + * (plugin-defined variant). */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); + @Nullable + public final String _customKind() { + return _customKind; } - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + /** + * Get the custom plugin-defined variant value. + * + * @throws IllegalStateException + * if the current variant is not {@link Kind#_Custom}. + */ + public JsonData _custom() { + return TaggedUnionUtils.get(this, Kind._Custom); + } - generator.writeKey("query"); - this.query.serialize(generator, mapper); + @Override + @SuppressWarnings("unchecked") + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeStartObject(); if (this.windowSize != null) { generator.writeKey("window_size"); @@ -113,6 +220,13 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } + generator.writeKey(_kind == Kind._Custom ? _customKind : _kind.jsonValue()); + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } + + generator.writeEnd(); + } @Override @@ -120,33 +234,14 @@ public String toString() { return JsonpUtils.toString(this); } - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link Rescore}. - */ - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private RescoreQuery query; + private Kind _kind; + private Object _value; + private String _customKind; @Nullable private Integer windowSize; - /** - * Required - API name: {@code query} - */ - public final Builder query(RescoreQuery value) { - this.query = value; - return this; - } - - /** - * Required - API name: {@code query} - */ - public final Builder query(Function> fn) { - return this.query(fn.apply(new RescoreQuery.Builder()).build()); - } - /** * API name: {@code window_size} */ @@ -159,33 +254,76 @@ public final Builder windowSize(@Nullable Integer value) { protected Builder self() { return this; } + public ContainerBuilder query(RescoreQuery v) { + this._kind = Kind.Query; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder query(Function> fn) { + return this.query(fn.apply(new RescoreQuery.Builder()).build()); + } + + public ContainerBuilder learningToRank(LearningToRank v) { + this._kind = Kind.LearningToRank; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder learningToRank(Function> fn) { + return this.learningToRank(fn.apply(new LearningToRank.Builder()).build()); + } /** - * Builds a {@link Rescore}. + * Define this {@code Rescore} as a plugin-defined variant. * - * @throws NullPointerException - * if some of the required fields are null. + * @param name + * the plugin-defined identifier + * @param data + * the data for this custom {@code Rescore}. It is converted + * internally to {@link JsonData}. */ + public ContainerBuilder _custom(String name, Object data) { + this._kind = Kind._Custom; + this._customKind = name; + this._value = JsonData.of(data); + return new ContainerBuilder(); + } + public Rescore build() { _checkSingleUse(); - return new Rescore(this); } - } - // --------------------------------------------------------------------------------------------- + public class ContainerBuilder implements ObjectBuilder { - /** - * Json deserializer for {@link Rescore} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - Rescore::setupRescoreDeserializer); + /** + * API name: {@code window_size} + */ + public final ContainerBuilder windowSize(@Nullable Integer value) { + Builder.this.windowSize = value; + return this; + } + + public Rescore build() { + return Builder.this.build(); + } + } + } - protected static void setupRescoreDeserializer(ObjectDeserializer op) { + protected static void setupRescoreDeserializer(ObjectDeserializer op) { - op.add(Builder::query, RescoreQuery._DESERIALIZER, "query"); op.add(Builder::windowSize, JsonpDeserializer.integerDeserializer(), "window_size"); + op.add(Builder::query, RescoreQuery._DESERIALIZER, "query"); + op.add(Builder::learningToRank, LearningToRank._DESERIALIZER, "learning_to_rank"); + + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + JsonpUtils.ensureCustomVariantsAllowed(parser, mapper); + builder._custom(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); } + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Rescore::setupRescoreDeserializer, Builder::build); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/RescoreBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/RescoreBuilders.java new file mode 100644 index 000000000..12408742f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/RescoreBuilders.java @@ -0,0 +1,81 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.core.search; + +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Builders for {@link Rescore} variants. + */ +public class RescoreBuilders { + private RescoreBuilders() { + } + + /** + * Creates a builder for the {@link RescoreQuery query} {@code Rescore} variant. + */ + public static RescoreQuery.Builder query() { + return new RescoreQuery.Builder(); + } + + /** + * Creates a Rescore of the {@link RescoreQuery query} {@code Rescore} variant. + */ + public static Rescore query(Function> fn) { + Rescore.Builder builder = new Rescore.Builder(); + builder.query(fn.apply(new RescoreQuery.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link LearningToRank learning_to_rank} + * {@code Rescore} variant. + */ + public static LearningToRank.Builder learningToRank() { + return new LearningToRank.Builder(); + } + + /** + * Creates a Rescore of the {@link LearningToRank learning_to_rank} + * {@code Rescore} variant. + */ + public static Rescore learningToRank(Function> fn) { + Rescore.Builder builder = new Rescore.Builder(); + builder.learningToRank(fn.apply(new LearningToRank.Builder()).build()); + return builder.build(); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/RescoreQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/RescoreQuery.java index fd29b30ee..0aa3cb24d 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/RescoreQuery.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/RescoreQuery.java @@ -60,7 +60,7 @@ * specification */ @JsonpDeserializable -public class RescoreQuery implements JsonpSerializable { +public class RescoreQuery implements RescoreVariant, JsonpSerializable { private final Query query; @Nullable @@ -87,6 +87,14 @@ public static RescoreQuery of(Function> fn) return fn.apply(new Builder()).build(); } + /** + * Rescore variant kind. + */ + @Override + public Rescore.Kind _rescoreKind() { + return Rescore.Kind.Query; + } + /** * Required - The query to use for rescoring. This query is only run on the * Top-K results returned by the query and post_filter diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/RescoreVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/RescoreVariant.java new file mode 100644 index 000000000..6492d3a01 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/RescoreVariant.java @@ -0,0 +1,48 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.core.search; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Base interface for {@link Rescore} variants. + */ +public interface RescoreVariant { + + Rescore.Kind _rescoreKind(); + + default Rescore _toRescore() { + return new Rescore(this); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html index 447ea84a3..e742b1b62 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html @@ -40,28 +40,28 @@ '_global.field_caps.Request': '_global/field_caps/FieldCapabilitiesRequest.ts#L25-L106', '_global.field_caps.Response': '_global/field_caps/FieldCapabilitiesResponse.ts#L24-L35', '_global.get.GetResult': '_global/get/types.ts#L25-L35', -'_global.get.Request': '_global/get/GetRequest.ts#L31-L91', +'_global.get.Request': '_global/get/GetRequest.ts#L31-L98', '_global.get.Response': '_global/get/GetResponse.ts#L23-L34', '_global.get_script.Request': '_global/get_script/GetScriptRequest.ts#L24-L41', '_global.get_script.Response': '_global/get_script/GetScriptResponse.ts#L23-L29', '_global.get_source.Request': '_global/get_source/SourceRequest.ts#L31-L86', -'_global.get_source.Response': '_global/get_source/SourceResponse.ts#L20-L22', +'_global.get_source.Response': '_global/get_source/SourceResponse.ts#L20-L23', '_global.index.Request': '_global/index/IndexRequest.ts#L35-L117', '_global.index.Response': '_global/index/IndexResponse.ts#L22-L24', '_global.info.Request': '_global/info/RootNodeInfoRequest.ts#L22-L27', '_global.info.Response': '_global/info/RootNodeInfoResponse.ts#L23-L31', '_global.mget.MultiGetError': '_global/mget/types.ts#L62-L66', '_global.mget.Operation': '_global/mget/types.ts#L32-L55', -'_global.mget.Request': '_global/mget/MultiGetRequest.ts#L25-L91', +'_global.mget.Request': '_global/mget/MultiGetRequest.ts#L25-L98', '_global.mget.Response': '_global/mget/MultiGetResponse.ts#L22-L26', '_global.mget.ResponseItem': '_global/mget/types.ts#L57-L60', -'_global.msearch.MultiSearchItem': '_global/msearch/types.ts#L214-L217', -'_global.msearch.MultiSearchResult': '_global/msearch/types.ts#L204-L207', -'_global.msearch.MultisearchBody': '_global/msearch/types.ts#L71-L202', -'_global.msearch.MultisearchHeader': '_global/msearch/types.ts#L53-L68', +'_global.msearch.MultiSearchItem': '_global/msearch/types.ts#L213-L216', +'_global.msearch.MultiSearchResult': '_global/msearch/types.ts#L203-L206', +'_global.msearch.MultisearchBody': '_global/msearch/types.ts#L70-L201', +'_global.msearch.MultisearchHeader': '_global/msearch/types.ts#L52-L67', '_global.msearch.Request': '_global/msearch/MultiSearchRequest.ts#L25-L96', '_global.msearch.Response': '_global/msearch/MultiSearchResponse.ts#L25-L27', -'_global.msearch.ResponseItem': '_global/msearch/types.ts#L209-L212', +'_global.msearch.ResponseItem': '_global/msearch/types.ts#L208-L211', '_global.msearch_template.Request': '_global/msearch_template/MultiSearchTemplateRequest.ts#L25-L70', '_global.msearch_template.Response': '_global/msearch_template/MultiSearchTemplateResponse.ts#L22-L24', '_global.msearch_template.TemplateConfig': '_global/msearch_template/types.ts#L28-L54', @@ -103,7 +103,7 @@ '_global.scripts_painless_execute.Response': '_global/scripts_painless_execute/ExecutePainlessScriptResponse.ts#L20-L24', '_global.scroll.Request': '_global/scroll/ScrollRequest.ts#L24-L59', '_global.scroll.Response': '_global/scroll/ScrollResponse.ts#L22-L24', -'_global.search.Request': '_global/search/SearchRequest.ts#L53-L506', +'_global.search.Request': '_global/search/SearchRequest.ts#L54-L520', '_global.search.Response': '_global/search/SearchResponse.ts#L34-L36', '_global.search.ResponseBody': '_global/search/SearchResponse.ts#L38-L54', '_global.search._types.AggregationBreakdown': '_global/search/_types/profile.ts#L23-L36', @@ -136,6 +136,7 @@ '_global.search._types.InnerHits': '_global/search/_types/hits.ts#L106-L140', '_global.search._types.InnerHitsResult': '_global/search/_types/hits.ts#L84-L86', '_global.search._types.LaplaceSmoothingModel': '_global/search/_types/suggester.ts#L427-L432', +'_global.search._types.LearningToRank': '_global/search/_types/rescoring.ts#L88-L97', '_global.search._types.LinearInterpolationSmoothingModel': '_global/search/_types/suggester.ts#L434-L438', '_global.search._types.NestedIdentity': '_global/search/_types/hits.ts#L88-L92', '_global.search._types.PhraseSuggest': '_global/search/_types/suggester.ts#L57-L62', @@ -149,9 +150,9 @@ '_global.search._types.QueryBreakdown': '_global/search/_types/profile.ts#L97-L116', '_global.search._types.QueryProfile': '_global/search/_types/profile.ts#L118-L124', '_global.search._types.RegexOptions': '_global/search/_types/suggester.ts#L180-L191', -'_global.search._types.Rescore': '_global/search/_types/rescoring.ts#L23-L26', -'_global.search._types.RescoreQuery': '_global/search/_types/rescoring.ts#L28-L50', -'_global.search._types.ScoreMode': '_global/search/_types/rescoring.ts#L52-L74', +'_global.search._types.Rescore': '_global/search/_types/rescoring.ts#L25-L38', +'_global.search._types.RescoreQuery': '_global/search/_types/rescoring.ts#L40-L62', +'_global.search._types.ScoreMode': '_global/search/_types/rescoring.ts#L64-L86', '_global.search._types.SearchProfile': '_global/search/_types/profile.ts#L126-L130', '_global.search._types.ShardProfile': '_global/search/_types/profile.ts#L132-L137', '_global.search._types.SmoothingModelContainer': '_global/search/_types/suggester.ts#L442-L458', @@ -173,7 +174,7 @@ '_global.search._types.TotalHitsRelation': '_global/search/_types/hits.ts#L99-L104', '_global.search._types.TrackHits': '_global/search/_types/hits.ts#L142-L150', '_global.search_mvt.Request': '_global/search_mvt/SearchMvtRequest.ts#L33-L188', -'_global.search_mvt.Response': '_global/search_mvt/SearchMvtResponse.ts#L22-L24', +'_global.search_mvt.Response': '_global/search_mvt/SearchMvtResponse.ts#L22-L25', '_global.search_mvt._types.GridAggregationType': '_global/search_mvt/_types/GridType.ts#L30-L33', '_global.search_mvt._types.GridType': '_global/search_mvt/_types/GridType.ts#L20-L28', '_global.search_template.Request': '_global/search_template/SearchTemplateRequest.ts#L32-L134', @@ -227,18 +228,23 @@ '_types.IndicesResponseBase': '_types/Base.ts#L87-L89', '_types.InlineGet': '_types/common.ts#L321-L330', '_types.InlineScript': '_types/Scripting.ts#L67-L79', -'_types.KnnQuery': '_types/Knn.ts#L27-L49', +'_types.KnnQuery': '_types/Knn.ts#L54-L67', +'_types.KnnRetriever': '_types/Retriever.ts#L58-L71', +'_types.KnnSearch': '_types/Knn.ts#L30-L52', '_types.LatLonGeoLocation': '_types/Geo.ts#L120-L129', '_types.NestedSortValue': '_types/sort.ts#L30-L35', '_types.Normalization': '_types/Similarity.ts#L52-L58', '_types.OpType': '_types/common.ts#L255-L264', -'_types.QueryVectorBuilder': '_types/Knn.ts#L51-L54', +'_types.QueryVectorBuilder': '_types/Knn.ts#L69-L72', +'_types.RRFRetriever': '_types/Retriever.ts#L73-L80', '_types.RankBase': '_types/Rank.ts#L30-L30', '_types.RankContainer': '_types/Rank.ts#L22-L28', '_types.Refresh': '_types/common.ts#L266-L273', '_types.RequestBase': '_types/Base.ts#L34-L34', '_types.Result': '_types/Result.ts#L20-L26', '_types.Retries': '_types/Retries.ts#L22-L25', +'_types.RetrieverBase': '_types/Retriever.ts#L38-L41', +'_types.RetrieverContainer': '_types/Retriever.ts#L26-L36', '_types.RrfRank': '_types/Rank.ts#L32-L37', '_types.ScoreSort': '_types/sort.ts#L55-L57', '_types.Script': '_types/Scripting.ts#L88-L89', @@ -257,10 +263,11 @@ '_types.SortMode': '_types/sort.ts#L103-L112', '_types.SortOptions': '_types/sort.ts#L82-L91', '_types.SortOrder': '_types/sort.ts#L114-L123', +'_types.StandardRetriever': '_types/Retriever.ts#L43-L56', '_types.StoredScript': '_types/Scripting.ts#L47-L57', '_types.StoredScriptId': '_types/Scripting.ts#L81-L86', '_types.SuggestMode': '_types/common.ts#L282-L295', -'_types.TextEmbedding': '_types/Knn.ts#L56-L59', +'_types.TextEmbedding': '_types/Knn.ts#L74-L77', '_types.TimeUnit': '_types/Time.ts#L69-L77', '_types.TopLeftBottomRightGeoBounds': '_types/Geo.ts#L161-L164', '_types.TopRightBottomLeftGeoBounds': '_types/Geo.ts#L166-L169', @@ -270,22 +277,22 @@ '_types.WktGeoBounds': '_types/Geo.ts#L150-L152', '_types.WriteResponseBase': '_types/Base.ts#L36-L45', '_types.aggregations.AdjacencyMatrixAggregate': '_types/aggregations/Aggregate.ts#L573-L575', -'_types.aggregations.AdjacencyMatrixAggregation': '_types/aggregations/bucket.ts#L57-L63', +'_types.aggregations.AdjacencyMatrixAggregation': '_types/aggregations/bucket.ts#L55-L65', '_types.aggregations.AdjacencyMatrixBucket': '_types/aggregations/Aggregate.ts#L577-L579', '_types.aggregations.Aggregate': '_types/aggregations/Aggregate.ts#L38-L123', '_types.aggregations.AggregateBase': '_types/aggregations/Aggregate.ts#L134-L136', -'_types.aggregations.Aggregation': '_types/aggregations/Aggregation.ts#L22-L25', -'_types.aggregations.AggregationContainer': '_types/aggregations/AggregationContainer.ts#L106-L515', -'_types.aggregations.AggregationRange': '_types/aggregations/bucket.ts#L672-L685', +'_types.aggregations.Aggregation': '_types/aggregations/Aggregation.ts#L20-L20', +'_types.aggregations.AggregationContainer': '_types/aggregations/AggregationContainer.ts#L105-L514', +'_types.aggregations.AggregationRange': '_types/aggregations/bucket.ts#L674-L687', '_types.aggregations.ArrayPercentilesItem': '_types/aggregations/Aggregate.ts#L160-L164', '_types.aggregations.AutoDateHistogramAggregate': '_types/aggregations/Aggregate.ts#L356-L360', -'_types.aggregations.AutoDateHistogramAggregation': '_types/aggregations/bucket.ts#L65-L100', +'_types.aggregations.AutoDateHistogramAggregation': '_types/aggregations/bucket.ts#L67-L102', '_types.aggregations.AverageAggregation': '_types/aggregations/metric.ts#L55-L55', '_types.aggregations.AverageBucketAggregation': '_types/aggregations/pipeline.ts#L78-L78', '_types.aggregations.AvgAggregate': '_types/aggregations/Aggregate.ts#L209-L210', '_types.aggregations.BoxPlotAggregate': '_types/aggregations/Aggregate.ts#L706-L722', '_types.aggregations.BoxplotAggregation': '_types/aggregations/metric.ts#L57-L62', -'_types.aggregations.BucketAggregationBase': '_types/aggregations/bucket.ts#L50-L55', +'_types.aggregations.BucketAggregationBase': '_types/aggregations/bucket.ts#L48-L53', '_types.aggregations.BucketCorrelationAggregation': '_types/aggregations/pipeline.ts#L129-L135', '_types.aggregations.BucketCorrelationFunction': '_types/aggregations/pipeline.ts#L137-L142', '_types.aggregations.BucketCorrelationFunctionCountCorrelation': '_types/aggregations/pipeline.ts#L144-L147', @@ -298,66 +305,66 @@ '_types.aggregations.BucketSortAggregation': '_types/aggregations/pipeline.ts#L169-L190', '_types.aggregations.Buckets': '_types/aggregations/Aggregate.ts#L316-L325', '_types.aggregations.BucketsPath': '_types/aggregations/pipeline.ts#L53-L59', -'_types.aggregations.CalendarInterval': '_types/aggregations/bucket.ts#L249-L266', +'_types.aggregations.CalendarInterval': '_types/aggregations/bucket.ts#L251-L268', '_types.aggregations.CardinalityAggregate': '_types/aggregations/Aggregate.ts#L138-L141', '_types.aggregations.CardinalityAggregation': '_types/aggregations/metric.ts#L87-L99', '_types.aggregations.CardinalityExecutionMode': '_types/aggregations/metric.ts#L64-L85', -'_types.aggregations.CategorizeTextAggregation': '_types/aggregations/bucket.ts#L1037-L1101', -'_types.aggregations.CategorizeTextAnalyzer': '_types/aggregations/bucket.ts#L1103-L1106', -'_types.aggregations.ChiSquareHeuristic': '_types/aggregations/bucket.ts#L735-L744', +'_types.aggregations.CategorizeTextAggregation': '_types/aggregations/bucket.ts#L1045-L1109', +'_types.aggregations.CategorizeTextAnalyzer': '_types/aggregations/bucket.ts#L1111-L1114', +'_types.aggregations.ChiSquareHeuristic': '_types/aggregations/bucket.ts#L737-L746', '_types.aggregations.ChildrenAggregate': '_types/aggregations/Aggregate.ts#L776-L777', -'_types.aggregations.ChildrenAggregation': '_types/aggregations/bucket.ts#L111-L116', +'_types.aggregations.ChildrenAggregation': '_types/aggregations/bucket.ts#L113-L118', '_types.aggregations.CompositeAggregate': '_types/aggregations/Aggregate.ts#L618-L623', -'_types.aggregations.CompositeAggregation': '_types/aggregations/bucket.ts#L120-L136', -'_types.aggregations.CompositeAggregationBase': '_types/aggregations/bucket.ts#L157-L166', -'_types.aggregations.CompositeAggregationSource': '_types/aggregations/bucket.ts#L138-L155', +'_types.aggregations.CompositeAggregation': '_types/aggregations/bucket.ts#L122-L138', +'_types.aggregations.CompositeAggregationBase': '_types/aggregations/bucket.ts#L159-L168', +'_types.aggregations.CompositeAggregationSource': '_types/aggregations/bucket.ts#L140-L157', '_types.aggregations.CompositeBucket': '_types/aggregations/Aggregate.ts#L625-L627', -'_types.aggregations.CompositeDateHistogramAggregation': '_types/aggregations/bucket.ts#L174-L182', -'_types.aggregations.CompositeGeoTileGridAggregation': '_types/aggregations/bucket.ts#L184-L187', -'_types.aggregations.CompositeHistogramAggregation': '_types/aggregations/bucket.ts#L170-L172', -'_types.aggregations.CompositeTermsAggregation': '_types/aggregations/bucket.ts#L168-L168', +'_types.aggregations.CompositeDateHistogramAggregation': '_types/aggregations/bucket.ts#L176-L184', +'_types.aggregations.CompositeGeoTileGridAggregation': '_types/aggregations/bucket.ts#L186-L189', +'_types.aggregations.CompositeHistogramAggregation': '_types/aggregations/bucket.ts#L172-L174', +'_types.aggregations.CompositeTermsAggregation': '_types/aggregations/bucket.ts#L170-L170', '_types.aggregations.CumulativeCardinalityAggregate': '_types/aggregations/Aggregate.ts#L747-L755', '_types.aggregations.CumulativeCardinalityAggregation': '_types/aggregations/pipeline.ts#L192-L192', '_types.aggregations.CumulativeSumAggregation': '_types/aggregations/pipeline.ts#L194-L194', -'_types.aggregations.CustomCategorizeTextAnalyzer': '_types/aggregations/bucket.ts#L1108-L1112', +'_types.aggregations.CustomCategorizeTextAnalyzer': '_types/aggregations/bucket.ts#L1116-L1120', '_types.aggregations.DateHistogramAggregate': '_types/aggregations/Aggregate.ts#L348-L349', -'_types.aggregations.DateHistogramAggregation': '_types/aggregations/bucket.ts#L189-L247', +'_types.aggregations.DateHistogramAggregation': '_types/aggregations/bucket.ts#L191-L249', '_types.aggregations.DateHistogramBucket': '_types/aggregations/Aggregate.ts#L351-L354', '_types.aggregations.DateRangeAggregate': '_types/aggregations/Aggregate.ts#L543-L548', -'_types.aggregations.DateRangeAggregation': '_types/aggregations/bucket.ts#L268-L294', -'_types.aggregations.DateRangeExpression': '_types/aggregations/bucket.ts#L305-L318', +'_types.aggregations.DateRangeAggregation': '_types/aggregations/bucket.ts#L270-L296', +'_types.aggregations.DateRangeExpression': '_types/aggregations/bucket.ts#L307-L320', '_types.aggregations.DerivativeAggregate': '_types/aggregations/Aggregate.ts#L227-L231', '_types.aggregations.DerivativeAggregation': '_types/aggregations/pipeline.ts#L196-L196', -'_types.aggregations.DiversifiedSamplerAggregation': '_types/aggregations/bucket.ts#L320-L341', +'_types.aggregations.DiversifiedSamplerAggregation': '_types/aggregations/bucket.ts#L322-L343', '_types.aggregations.DoubleTermsAggregate': '_types/aggregations/Aggregate.ts#L411-L416', '_types.aggregations.DoubleTermsBucket': '_types/aggregations/Aggregate.ts#L418-L421', '_types.aggregations.EwmaModelSettings': '_types/aggregations/pipeline.ts#L267-L269', '_types.aggregations.EwmaMovingAverageAggregation': '_types/aggregations/pipeline.ts#L252-L255', -'_types.aggregations.ExtendedBounds': '_types/aggregations/bucket.ts#L489-L498', +'_types.aggregations.ExtendedBounds': '_types/aggregations/bucket.ts#L491-L500', '_types.aggregations.ExtendedStatsAggregate': '_types/aggregations/Aggregate.ts#L278-L296', '_types.aggregations.ExtendedStatsAggregation': '_types/aggregations/metric.ts#L101-L106', '_types.aggregations.ExtendedStatsBucketAggregate': '_types/aggregations/Aggregate.ts#L298-L299', '_types.aggregations.ExtendedStatsBucketAggregation': '_types/aggregations/pipeline.ts#L198-L203', -'_types.aggregations.FieldDateMath': '_types/aggregations/bucket.ts#L296-L303', +'_types.aggregations.FieldDateMath': '_types/aggregations/bucket.ts#L298-L305', '_types.aggregations.FilterAggregate': '_types/aggregations/Aggregate.ts#L495-L496', '_types.aggregations.FiltersAggregate': '_types/aggregations/Aggregate.ts#L568-L569', -'_types.aggregations.FiltersAggregation': '_types/aggregations/bucket.ts#L358-L378', +'_types.aggregations.FiltersAggregation': '_types/aggregations/bucket.ts#L360-L380', '_types.aggregations.FiltersBucket': '_types/aggregations/Aggregate.ts#L571-L571', '_types.aggregations.FormatMetricAggregationBase': '_types/aggregations/metric.ts#L47-L49', '_types.aggregations.FormattableMetricAggregation': '_types/aggregations/metric.ts#L51-L53', '_types.aggregations.FrequentItemSetsAggregate': '_types/aggregations/Aggregate.ts#L639-L640', -'_types.aggregations.FrequentItemSetsAggregation': '_types/aggregations/bucket.ts#L1159-L1183', +'_types.aggregations.FrequentItemSetsAggregation': '_types/aggregations/bucket.ts#L1167-L1191', '_types.aggregations.FrequentItemSetsBucket': '_types/aggregations/Aggregate.ts#L642-L645', -'_types.aggregations.FrequentItemSetsField': '_types/aggregations/bucket.ts#L1145-L1157', +'_types.aggregations.FrequentItemSetsField': '_types/aggregations/bucket.ts#L1153-L1165', '_types.aggregations.GapPolicy': '_types/aggregations/pipeline.ts#L61-L76', '_types.aggregations.GeoBoundsAggregate': '_types/aggregations/Aggregate.ts#L303-L306', '_types.aggregations.GeoBoundsAggregation': '_types/aggregations/metric.ts#L108-L114', '_types.aggregations.GeoCentroidAggregate': '_types/aggregations/Aggregate.ts#L308-L312', '_types.aggregations.GeoCentroidAggregation': '_types/aggregations/metric.ts#L116-L119', '_types.aggregations.GeoDistanceAggregate': '_types/aggregations/Aggregate.ts#L550-L554', -'_types.aggregations.GeoDistanceAggregation': '_types/aggregations/bucket.ts#L380-L403', +'_types.aggregations.GeoDistanceAggregation': '_types/aggregations/bucket.ts#L382-L405', '_types.aggregations.GeoHashGridAggregate': '_types/aggregations/Aggregate.ts#L506-L508', -'_types.aggregations.GeoHashGridAggregation': '_types/aggregations/bucket.ts#L405-L430', +'_types.aggregations.GeoHashGridAggregation': '_types/aggregations/bucket.ts#L407-L432', '_types.aggregations.GeoHashGridBucket': '_types/aggregations/Aggregate.ts#L510-L512', '_types.aggregations.GeoHexGridAggregate': '_types/aggregations/Aggregate.ts#L522-L523', '_types.aggregations.GeoHexGridBucket': '_types/aggregations/Aggregate.ts#L525-L527', @@ -366,17 +373,17 @@ '_types.aggregations.GeoLinePoint': '_types/aggregations/metric.ts#L155-L160', '_types.aggregations.GeoLineSort': '_types/aggregations/metric.ts#L148-L153', '_types.aggregations.GeoTileGridAggregate': '_types/aggregations/Aggregate.ts#L514-L516', -'_types.aggregations.GeoTileGridAggregation': '_types/aggregations/bucket.ts#L432-L458', +'_types.aggregations.GeoTileGridAggregation': '_types/aggregations/bucket.ts#L434-L460', '_types.aggregations.GeoTileGridBucket': '_types/aggregations/Aggregate.ts#L518-L520', -'_types.aggregations.GeohexGridAggregation': '_types/aggregations/bucket.ts#L460-L485', +'_types.aggregations.GeohexGridAggregation': '_types/aggregations/bucket.ts#L462-L487', '_types.aggregations.GlobalAggregate': '_types/aggregations/Aggregate.ts#L492-L493', -'_types.aggregations.GlobalAggregation': '_types/aggregations/bucket.ts#L487-L487', -'_types.aggregations.GoogleNormalizedDistanceHeuristic': '_types/aggregations/bucket.ts#L746-L751', +'_types.aggregations.GlobalAggregation': '_types/aggregations/bucket.ts#L489-L489', +'_types.aggregations.GoogleNormalizedDistanceHeuristic': '_types/aggregations/bucket.ts#L748-L753', '_types.aggregations.HdrMethod': '_types/aggregations/metric.ts#L216-L221', '_types.aggregations.HdrPercentileRanksAggregate': '_types/aggregations/Aggregate.ts#L169-L170', '_types.aggregations.HdrPercentilesAggregate': '_types/aggregations/Aggregate.ts#L166-L167', '_types.aggregations.HistogramAggregate': '_types/aggregations/Aggregate.ts#L340-L341', -'_types.aggregations.HistogramAggregation': '_types/aggregations/bucket.ts#L500-L546', +'_types.aggregations.HistogramAggregation': '_types/aggregations/bucket.ts#L502-L548', '_types.aggregations.HistogramBucket': '_types/aggregations/Aggregate.ts#L343-L346', '_types.aggregations.HoltLinearModelSettings': '_types/aggregations/pipeline.ts#L271-L274', '_types.aggregations.HoltMovingAverageAggregation': '_types/aggregations/pipeline.ts#L257-L260', @@ -390,11 +397,11 @@ '_types.aggregations.InferenceFeatureImportance': '_types/aggregations/Aggregate.ts#L678-L682', '_types.aggregations.InferenceTopClassEntry': '_types/aggregations/Aggregate.ts#L672-L676', '_types.aggregations.IpPrefixAggregate': '_types/aggregations/Aggregate.ts#L629-L630', -'_types.aggregations.IpPrefixAggregation': '_types/aggregations/bucket.ts#L1114-L1143', +'_types.aggregations.IpPrefixAggregation': '_types/aggregations/bucket.ts#L1122-L1151', '_types.aggregations.IpPrefixBucket': '_types/aggregations/Aggregate.ts#L632-L637', '_types.aggregations.IpRangeAggregate': '_types/aggregations/Aggregate.ts#L556-L558', -'_types.aggregations.IpRangeAggregation': '_types/aggregations/bucket.ts#L548-L557', -'_types.aggregations.IpRangeAggregationRange': '_types/aggregations/bucket.ts#L559-L572', +'_types.aggregations.IpRangeAggregation': '_types/aggregations/bucket.ts#L550-L559', +'_types.aggregations.IpRangeAggregationRange': '_types/aggregations/bucket.ts#L561-L574', '_types.aggregations.IpRangeBucket': '_types/aggregations/Aggregate.ts#L560-L564', '_types.aggregations.LinearMovingAverageAggregation': '_types/aggregations/pipeline.ts#L242-L245', '_types.aggregations.LongRareTermsAggregate': '_types/aggregations/Aggregate.ts#L431-L436', @@ -414,28 +421,28 @@ '_types.aggregations.MinAggregate': '_types/aggregations/Aggregate.ts#L197-L198', '_types.aggregations.MinAggregation': '_types/aggregations/metric.ts#L172-L172', '_types.aggregations.MinBucketAggregation': '_types/aggregations/pipeline.ts#L226-L226', -'_types.aggregations.MinimumInterval': '_types/aggregations/bucket.ts#L102-L109', +'_types.aggregations.MinimumInterval': '_types/aggregations/bucket.ts#L104-L111', '_types.aggregations.MissingAggregate': '_types/aggregations/Aggregate.ts#L483-L484', -'_types.aggregations.MissingAggregation': '_types/aggregations/bucket.ts#L574-L580', -'_types.aggregations.MissingOrder': '_types/aggregations/AggregationContainer.ts#L518-L522', +'_types.aggregations.MissingAggregation': '_types/aggregations/bucket.ts#L576-L582', +'_types.aggregations.MissingOrder': '_types/aggregations/AggregationContainer.ts#L517-L521', '_types.aggregations.MovingAverageAggregation': '_types/aggregations/pipeline.ts#L228-L234', '_types.aggregations.MovingAverageAggregationBase': '_types/aggregations/pipeline.ts#L236-L240', '_types.aggregations.MovingFunctionAggregation': '_types/aggregations/pipeline.ts#L288-L303', '_types.aggregations.MovingPercentilesAggregation': '_types/aggregations/pipeline.ts#L305-L317', '_types.aggregations.MultiBucketAggregateBase': '_types/aggregations/Aggregate.ts#L327-L329', '_types.aggregations.MultiBucketBase': '_types/aggregations/Aggregate.ts#L331-L338', -'_types.aggregations.MultiTermLookup': '_types/aggregations/bucket.ts#L624-L634', +'_types.aggregations.MultiTermLookup': '_types/aggregations/bucket.ts#L626-L636', '_types.aggregations.MultiTermsAggregate': '_types/aggregations/Aggregate.ts#L461-L463', -'_types.aggregations.MultiTermsAggregation': '_types/aggregations/bucket.ts#L582-L622', +'_types.aggregations.MultiTermsAggregation': '_types/aggregations/bucket.ts#L584-L624', '_types.aggregations.MultiTermsBucket': '_types/aggregations/Aggregate.ts#L465-L469', -'_types.aggregations.MutualInformationHeuristic': '_types/aggregations/bucket.ts#L753-L762', +'_types.aggregations.MutualInformationHeuristic': '_types/aggregations/bucket.ts#L755-L764', '_types.aggregations.NestedAggregate': '_types/aggregations/Aggregate.ts#L486-L487', -'_types.aggregations.NestedAggregation': '_types/aggregations/bucket.ts#L636-L641', +'_types.aggregations.NestedAggregation': '_types/aggregations/bucket.ts#L638-L643', '_types.aggregations.NormalizeAggregation': '_types/aggregations/pipeline.ts#L319-L324', '_types.aggregations.NormalizeMethod': '_types/aggregations/pipeline.ts#L326-L352', '_types.aggregations.ParentAggregate': '_types/aggregations/Aggregate.ts#L779-L780', -'_types.aggregations.ParentAggregation': '_types/aggregations/bucket.ts#L643-L648', -'_types.aggregations.PercentageScoreHeuristic': '_types/aggregations/bucket.ts#L764-L764', +'_types.aggregations.ParentAggregation': '_types/aggregations/bucket.ts#L645-L650', +'_types.aggregations.PercentageScoreHeuristic': '_types/aggregations/bucket.ts#L766-L766', '_types.aggregations.PercentileRanksAggregation': '_types/aggregations/metric.ts#L174-L193', '_types.aggregations.Percentiles': '_types/aggregations/Aggregate.ts#L150-L151', '_types.aggregations.PercentilesAggregateBase': '_types/aggregations/Aggregate.ts#L146-L148', @@ -444,18 +451,18 @@ '_types.aggregations.PercentilesBucketAggregation': '_types/aggregations/pipeline.ts#L354-L359', '_types.aggregations.PipelineAggregationBase': '_types/aggregations/pipeline.ts#L39-L51', '_types.aggregations.RangeAggregate': '_types/aggregations/Aggregate.ts#L531-L532', -'_types.aggregations.RangeAggregation': '_types/aggregations/bucket.ts#L650-L670', +'_types.aggregations.RangeAggregation': '_types/aggregations/bucket.ts#L652-L672', '_types.aggregations.RangeBucket': '_types/aggregations/Aggregate.ts#L534-L541', -'_types.aggregations.RareTermsAggregation': '_types/aggregations/bucket.ts#L687-L717', +'_types.aggregations.RareTermsAggregation': '_types/aggregations/bucket.ts#L689-L719', '_types.aggregations.RateAggregate': '_types/aggregations/Aggregate.ts#L741-L745', '_types.aggregations.RateAggregation': '_types/aggregations/metric.ts#L230-L241', '_types.aggregations.RateMode': '_types/aggregations/metric.ts#L243-L252', '_types.aggregations.ReverseNestedAggregate': '_types/aggregations/Aggregate.ts#L489-L490', -'_types.aggregations.ReverseNestedAggregation': '_types/aggregations/bucket.ts#L719-L725', +'_types.aggregations.ReverseNestedAggregation': '_types/aggregations/bucket.ts#L721-L727', '_types.aggregations.SamplerAggregate': '_types/aggregations/Aggregate.ts#L498-L499', -'_types.aggregations.SamplerAggregation': '_types/aggregations/bucket.ts#L727-L733', -'_types.aggregations.SamplerAggregationExecutionHint': '_types/aggregations/bucket.ts#L343-L356', -'_types.aggregations.ScriptedHeuristic': '_types/aggregations/bucket.ts#L766-L768', +'_types.aggregations.SamplerAggregation': '_types/aggregations/bucket.ts#L729-L735', +'_types.aggregations.SamplerAggregationExecutionHint': '_types/aggregations/bucket.ts#L345-L358', +'_types.aggregations.ScriptedHeuristic': '_types/aggregations/bucket.ts#L768-L770', '_types.aggregations.ScriptedMetricAggregate': '_types/aggregations/Aggregate.ts#L649-L652', '_types.aggregations.ScriptedMetricAggregation': '_types/aggregations/metric.ts#L254-L280', '_types.aggregations.SerialDifferencingAggregation': '_types/aggregations/pipeline.ts#L361-L367', @@ -464,9 +471,9 @@ '_types.aggregations.SignificantStringTermsAggregate': '_types/aggregations/Aggregate.ts#L602-L604', '_types.aggregations.SignificantStringTermsBucket': '_types/aggregations/Aggregate.ts#L606-L608', '_types.aggregations.SignificantTermsAggregateBase': '_types/aggregations/Aggregate.ts#L581-L586', -'_types.aggregations.SignificantTermsAggregation': '_types/aggregations/bucket.ts#L770-L834', +'_types.aggregations.SignificantTermsAggregation': '_types/aggregations/bucket.ts#L772-L836', '_types.aggregations.SignificantTermsBucketBase': '_types/aggregations/Aggregate.ts#L592-L595', -'_types.aggregations.SignificantTextAggregation': '_types/aggregations/bucket.ts#L836-L908', +'_types.aggregations.SignificantTextAggregation': '_types/aggregations/bucket.ts#L838-L910', '_types.aggregations.SimpleMovingAverageAggregation': '_types/aggregations/pipeline.ts#L247-L250', '_types.aggregations.SimpleValueAggregate': '_types/aggregations/Aggregate.ts#L224-L225', '_types.aggregations.SingleBucketAggregateBase': '_types/aggregations/Aggregate.ts#L473-L481', @@ -493,42 +500,42 @@ '_types.aggregations.TTestAggregation': '_types/aggregations/metric.ts#L294-L308', '_types.aggregations.TTestType': '_types/aggregations/metric.ts#L322-L335', '_types.aggregations.TermsAggregateBase': '_types/aggregations/Aggregate.ts#L377-L382', -'_types.aggregations.TermsAggregation': '_types/aggregations/bucket.ts#L910-L970', -'_types.aggregations.TermsAggregationCollectMode': '_types/aggregations/bucket.ts#L980-L989', -'_types.aggregations.TermsAggregationExecutionHint': '_types/aggregations/bucket.ts#L991-L996', +'_types.aggregations.TermsAggregation': '_types/aggregations/bucket.ts#L912-L977', +'_types.aggregations.TermsAggregationCollectMode': '_types/aggregations/bucket.ts#L987-L996', +'_types.aggregations.TermsAggregationExecutionHint': '_types/aggregations/bucket.ts#L998-L1003', '_types.aggregations.TermsBucketBase': '_types/aggregations/Aggregate.ts#L391-L393', -'_types.aggregations.TermsExclude': '_types/aggregations/bucket.ts#L1001-L1002', -'_types.aggregations.TermsInclude': '_types/aggregations/bucket.ts#L998-L999', -'_types.aggregations.TermsPartition': '_types/aggregations/bucket.ts#L1004-L1013', +'_types.aggregations.TermsExclude': '_types/aggregations/bucket.ts#L1008-L1009', +'_types.aggregations.TermsInclude': '_types/aggregations/bucket.ts#L1005-L1006', +'_types.aggregations.TermsPartition': '_types/aggregations/bucket.ts#L1011-L1020', '_types.aggregations.TestPopulation': '_types/aggregations/metric.ts#L310-L320', '_types.aggregations.TopHitsAggregate': '_types/aggregations/Aggregate.ts#L654-L657', -'_types.aggregations.TopHitsAggregation': '_types/aggregations/metric.ts#L337-L392', +'_types.aggregations.TopHitsAggregation': '_types/aggregations/metric.ts#L337-L397', '_types.aggregations.TopMetrics': '_types/aggregations/Aggregate.ts#L729-L733', '_types.aggregations.TopMetricsAggregate': '_types/aggregations/Aggregate.ts#L724-L727', -'_types.aggregations.TopMetricsAggregation': '_types/aggregations/metric.ts#L394-L408', -'_types.aggregations.TopMetricsValue': '_types/aggregations/metric.ts#L410-L415', +'_types.aggregations.TopMetricsAggregation': '_types/aggregations/metric.ts#L399-L413', +'_types.aggregations.TopMetricsValue': '_types/aggregations/metric.ts#L415-L420', '_types.aggregations.UnmappedRareTermsAggregate': '_types/aggregations/Aggregate.ts#L453-L459', '_types.aggregations.UnmappedSamplerAggregate': '_types/aggregations/Aggregate.ts#L501-L502', '_types.aggregations.UnmappedSignificantTermsAggregate': '_types/aggregations/Aggregate.ts#L610-L616', '_types.aggregations.UnmappedTermsAggregate': '_types/aggregations/Aggregate.ts#L423-L429', '_types.aggregations.ValueCountAggregate': '_types/aggregations/Aggregate.ts#L218-L222', -'_types.aggregations.ValueCountAggregation': '_types/aggregations/metric.ts#L417-L417', -'_types.aggregations.ValueType': '_types/aggregations/metric.ts#L419-L430', +'_types.aggregations.ValueCountAggregation': '_types/aggregations/metric.ts#L422-L422', +'_types.aggregations.ValueType': '_types/aggregations/metric.ts#L424-L435', '_types.aggregations.VariableWidthHistogramAggregate': '_types/aggregations/Aggregate.ts#L362-L364', -'_types.aggregations.VariableWidthHistogramAggregation': '_types/aggregations/bucket.ts#L1015-L1035', +'_types.aggregations.VariableWidthHistogramAggregation': '_types/aggregations/bucket.ts#L1022-L1043', '_types.aggregations.VariableWidthHistogramBucket': '_types/aggregations/Aggregate.ts#L366-L373', -'_types.aggregations.WeightedAverageAggregation': '_types/aggregations/metric.ts#L432-L446', -'_types.aggregations.WeightedAverageValue': '_types/aggregations/metric.ts#L448-L458', +'_types.aggregations.WeightedAverageAggregation': '_types/aggregations/metric.ts#L437-L451', +'_types.aggregations.WeightedAverageValue': '_types/aggregations/metric.ts#L453-L463', '_types.aggregations.WeightedAvgAggregate': '_types/aggregations/Aggregate.ts#L212-L216', '_types.analysis.Analyzer': '_types/analysis/analyzers.ts#L113-L131', -'_types.analysis.AsciiFoldingTokenFilter': '_types/analysis/token_filters.ts#L168-L171', +'_types.analysis.AsciiFoldingTokenFilter': '_types/analysis/token_filters.ts#L170-L173', '_types.analysis.CharFilter': '_types/analysis/char_filters.ts#L28-L30', '_types.analysis.CharFilterBase': '_types/analysis/char_filters.ts#L24-L26', '_types.analysis.CharFilterDefinition': '_types/analysis/char_filters.ts#L32-L41', '_types.analysis.CharGroupTokenizer': '_types/analysis/tokenizers.ts#L56-L60', -'_types.analysis.CommonGramsTokenFilter': '_types/analysis/token_filters.ts#L173-L179', +'_types.analysis.CommonGramsTokenFilter': '_types/analysis/token_filters.ts#L175-L181', '_types.analysis.CompoundWordTokenFilterBase': '_types/analysis/token_filters.ts#L44-L52', -'_types.analysis.ConditionTokenFilter': '_types/analysis/token_filters.ts#L181-L185', +'_types.analysis.ConditionTokenFilter': '_types/analysis/token_filters.ts#L183-L187', '_types.analysis.CustomAnalyzer': '_types/analysis/analyzers.ts#L28-L35', '_types.analysis.CustomNormalizer': '_types/analysis/normalizers.ts#L30-L34', '_types.analysis.DelimitedPayloadEncoding': '_types/analysis/token_filters.ts#L62-L66', @@ -538,11 +545,11 @@ '_types.analysis.EdgeNGramSide': '_types/analysis/token_filters.ts#L74-L77', '_types.analysis.EdgeNGramTokenFilter': '_types/analysis/token_filters.ts#L79-L85', '_types.analysis.EdgeNGramTokenizer': '_types/analysis/tokenizers.ts#L31-L37', -'_types.analysis.ElisionTokenFilter': '_types/analysis/token_filters.ts#L187-L192', +'_types.analysis.ElisionTokenFilter': '_types/analysis/token_filters.ts#L189-L194', '_types.analysis.FingerprintAnalyzer': '_types/analysis/analyzers.ts#L37-L45', -'_types.analysis.FingerprintTokenFilter': '_types/analysis/token_filters.ts#L194-L198', -'_types.analysis.HtmlStripCharFilter': '_types/analysis/char_filters.ts#L43-L45', -'_types.analysis.HunspellTokenFilter': '_types/analysis/token_filters.ts#L200-L206', +'_types.analysis.FingerprintTokenFilter': '_types/analysis/token_filters.ts#L196-L200', +'_types.analysis.HtmlStripCharFilter': '_types/analysis/char_filters.ts#L43-L46', +'_types.analysis.HunspellTokenFilter': '_types/analysis/token_filters.ts#L202-L208', '_types.analysis.HyphenationDecompounderTokenFilter': '_types/analysis/token_filters.ts#L58-L60', '_types.analysis.IcuAnalyzer': '_types/analysis/icu-plugin.ts#L67-L71', '_types.analysis.IcuCollationAlternate': '_types/analysis/icu-plugin.ts#L89-L92', @@ -558,12 +565,12 @@ '_types.analysis.IcuTokenizer': '_types/analysis/icu-plugin.ts#L30-L33', '_types.analysis.IcuTransformDirection': '_types/analysis/icu-plugin.ts#L73-L76', '_types.analysis.IcuTransformTokenFilter': '_types/analysis/icu-plugin.ts#L24-L28', -'_types.analysis.KStemTokenFilter': '_types/analysis/token_filters.ts#L239-L241', -'_types.analysis.KeepTypesMode': '_types/analysis/token_filters.ts#L213-L216', -'_types.analysis.KeepTypesTokenFilter': '_types/analysis/token_filters.ts#L218-L222', -'_types.analysis.KeepWordsTokenFilter': '_types/analysis/token_filters.ts#L224-L229', +'_types.analysis.KStemTokenFilter': '_types/analysis/token_filters.ts#L241-L243', +'_types.analysis.KeepTypesMode': '_types/analysis/token_filters.ts#L215-L218', +'_types.analysis.KeepTypesTokenFilter': '_types/analysis/token_filters.ts#L220-L224', +'_types.analysis.KeepWordsTokenFilter': '_types/analysis/token_filters.ts#L226-L231', '_types.analysis.KeywordAnalyzer': '_types/analysis/analyzers.ts#L47-L50', -'_types.analysis.KeywordMarkerTokenFilter': '_types/analysis/token_filters.ts#L231-L237', +'_types.analysis.KeywordMarkerTokenFilter': '_types/analysis/token_filters.ts#L233-L239', '_types.analysis.KeywordTokenizer': '_types/analysis/tokenizers.ts#L62-L65', '_types.analysis.KuromojiAnalyzer': '_types/analysis/kuromoji-plugin.ts#L25-L29', '_types.analysis.KuromojiIterationMarkCharFilter': '_types/analysis/kuromoji-plugin.ts#L31-L35', @@ -574,150 +581,152 @@ '_types.analysis.KuromojiTokenizer': '_types/analysis/kuromoji-plugin.ts#L58-L67', '_types.analysis.Language': '_types/analysis/languages.ts#L20-L55', '_types.analysis.LanguageAnalyzer': '_types/analysis/analyzers.ts#L52-L59', -'_types.analysis.LengthTokenFilter': '_types/analysis/token_filters.ts#L243-L247', +'_types.analysis.LengthTokenFilter': '_types/analysis/token_filters.ts#L245-L249', '_types.analysis.LetterTokenizer': '_types/analysis/tokenizers.ts#L67-L69', -'_types.analysis.LimitTokenCountTokenFilter': '_types/analysis/token_filters.ts#L249-L253', +'_types.analysis.LimitTokenCountTokenFilter': '_types/analysis/token_filters.ts#L251-L255', '_types.analysis.LowercaseNormalizer': '_types/analysis/normalizers.ts#L26-L28', -'_types.analysis.LowercaseTokenFilter': '_types/analysis/token_filters.ts#L255-L258', +'_types.analysis.LowercaseTokenFilter': '_types/analysis/token_filters.ts#L257-L260', '_types.analysis.LowercaseTokenizer': '_types/analysis/tokenizers.ts#L71-L73', -'_types.analysis.MappingCharFilter': '_types/analysis/char_filters.ts#L47-L51', -'_types.analysis.MultiplexerTokenFilter': '_types/analysis/token_filters.ts#L260-L264', -'_types.analysis.NGramTokenFilter': '_types/analysis/token_filters.ts#L266-L271', +'_types.analysis.MappingCharFilter': '_types/analysis/char_filters.ts#L48-L52', +'_types.analysis.MultiplexerTokenFilter': '_types/analysis/token_filters.ts#L262-L266', +'_types.analysis.NGramTokenFilter': '_types/analysis/token_filters.ts#L268-L273', '_types.analysis.NGramTokenizer': '_types/analysis/tokenizers.ts#L39-L45', '_types.analysis.NoriAnalyzer': '_types/analysis/analyzers.ts#L66-L72', '_types.analysis.NoriDecompoundMode': '_types/analysis/tokenizers.ts#L75-L79', -'_types.analysis.NoriPartOfSpeechTokenFilter': '_types/analysis/token_filters.ts#L273-L276', +'_types.analysis.NoriPartOfSpeechTokenFilter': '_types/analysis/token_filters.ts#L275-L278', '_types.analysis.NoriTokenizer': '_types/analysis/tokenizers.ts#L81-L87', '_types.analysis.Normalizer': '_types/analysis/normalizers.ts#L20-L24', '_types.analysis.PathHierarchyTokenizer': '_types/analysis/tokenizers.ts#L89-L96', '_types.analysis.PatternAnalyzer': '_types/analysis/analyzers.ts#L74-L81', -'_types.analysis.PatternCaptureTokenFilter': '_types/analysis/token_filters.ts#L278-L282', -'_types.analysis.PatternReplaceCharFilter': '_types/analysis/char_filters.ts#L53-L58', -'_types.analysis.PatternReplaceTokenFilter': '_types/analysis/token_filters.ts#L284-L290', +'_types.analysis.PatternCaptureTokenFilter': '_types/analysis/token_filters.ts#L280-L284', +'_types.analysis.PatternReplaceCharFilter': '_types/analysis/char_filters.ts#L54-L59', +'_types.analysis.PatternReplaceTokenFilter': '_types/analysis/token_filters.ts#L286-L292', '_types.analysis.PatternTokenizer': '_types/analysis/tokenizers.ts#L98-L103', '_types.analysis.PhoneticEncoder': '_types/analysis/phonetic-plugin.ts#L23-L36', '_types.analysis.PhoneticLanguage': '_types/analysis/phonetic-plugin.ts#L38-L51', '_types.analysis.PhoneticNameType': '_types/analysis/phonetic-plugin.ts#L53-L57', '_types.analysis.PhoneticRuleType': '_types/analysis/phonetic-plugin.ts#L59-L62', '_types.analysis.PhoneticTokenFilter': '_types/analysis/phonetic-plugin.ts#L64-L72', -'_types.analysis.PorterStemTokenFilter': '_types/analysis/token_filters.ts#L292-L294', -'_types.analysis.PredicateTokenFilter': '_types/analysis/token_filters.ts#L296-L299', -'_types.analysis.RemoveDuplicatesTokenFilter': '_types/analysis/token_filters.ts#L301-L303', -'_types.analysis.ReverseTokenFilter': '_types/analysis/token_filters.ts#L305-L307', +'_types.analysis.PorterStemTokenFilter': '_types/analysis/token_filters.ts#L294-L296', +'_types.analysis.PredicateTokenFilter': '_types/analysis/token_filters.ts#L298-L301', +'_types.analysis.RemoveDuplicatesTokenFilter': '_types/analysis/token_filters.ts#L303-L305', +'_types.analysis.ReverseTokenFilter': '_types/analysis/token_filters.ts#L307-L309', '_types.analysis.ShingleTokenFilter': '_types/analysis/token_filters.ts#L87-L95', '_types.analysis.SimpleAnalyzer': '_types/analysis/analyzers.ts#L83-L86', '_types.analysis.SnowballAnalyzer': '_types/analysis/analyzers.ts#L88-L93', '_types.analysis.SnowballLanguage': '_types/analysis/languages.ts#L57-L80', -'_types.analysis.SnowballTokenFilter': '_types/analysis/token_filters.ts#L309-L312', +'_types.analysis.SnowballTokenFilter': '_types/analysis/token_filters.ts#L311-L314', '_types.analysis.StandardAnalyzer': '_types/analysis/analyzers.ts#L95-L99', '_types.analysis.StandardTokenizer': '_types/analysis/tokenizers.ts#L105-L108', -'_types.analysis.StemmerOverrideTokenFilter': '_types/analysis/token_filters.ts#L314-L318', -'_types.analysis.StemmerTokenFilter': '_types/analysis/token_filters.ts#L320-L324', +'_types.analysis.StemmerOverrideTokenFilter': '_types/analysis/token_filters.ts#L316-L320', +'_types.analysis.StemmerTokenFilter': '_types/analysis/token_filters.ts#L322-L326', '_types.analysis.StopAnalyzer': '_types/analysis/analyzers.ts#L101-L106', '_types.analysis.StopTokenFilter': '_types/analysis/token_filters.ts#L97-L103', '_types.analysis.SynonymFormat': '_types/analysis/token_filters.ts#L105-L108', -'_types.analysis.SynonymGraphTokenFilter': '_types/analysis/token_filters.ts#L110-L119', -'_types.analysis.SynonymTokenFilter': '_types/analysis/token_filters.ts#L121-L130', +'_types.analysis.SynonymGraphTokenFilter': '_types/analysis/token_filters.ts#L110-L120', +'_types.analysis.SynonymTokenFilter': '_types/analysis/token_filters.ts#L122-L132', '_types.analysis.TokenChar': '_types/analysis/tokenizers.ts#L47-L54', -'_types.analysis.TokenFilter': '_types/analysis/token_filters.ts#L344-L346', +'_types.analysis.TokenFilter': '_types/analysis/token_filters.ts#L346-L348', '_types.analysis.TokenFilterBase': '_types/analysis/token_filters.ts#L40-L42', -'_types.analysis.TokenFilterDefinition': '_types/analysis/token_filters.ts#L348-L400', +'_types.analysis.TokenFilterDefinition': '_types/analysis/token_filters.ts#L350-L402', '_types.analysis.Tokenizer': '_types/analysis/tokenizers.ts#L120-L122', '_types.analysis.TokenizerBase': '_types/analysis/tokenizers.ts#L27-L29', '_types.analysis.TokenizerDefinition': '_types/analysis/tokenizers.ts#L124-L142', -'_types.analysis.TrimTokenFilter': '_types/analysis/token_filters.ts#L326-L328', -'_types.analysis.TruncateTokenFilter': '_types/analysis/token_filters.ts#L330-L333', +'_types.analysis.TrimTokenFilter': '_types/analysis/token_filters.ts#L328-L330', +'_types.analysis.TruncateTokenFilter': '_types/analysis/token_filters.ts#L332-L335', '_types.analysis.UaxEmailUrlTokenizer': '_types/analysis/tokenizers.ts#L110-L113', -'_types.analysis.UniqueTokenFilter': '_types/analysis/token_filters.ts#L335-L338', -'_types.analysis.UppercaseTokenFilter': '_types/analysis/token_filters.ts#L340-L342', +'_types.analysis.UniqueTokenFilter': '_types/analysis/token_filters.ts#L337-L340', +'_types.analysis.UppercaseTokenFilter': '_types/analysis/token_filters.ts#L342-L344', '_types.analysis.WhitespaceAnalyzer': '_types/analysis/analyzers.ts#L108-L111', '_types.analysis.WhitespaceTokenizer': '_types/analysis/tokenizers.ts#L115-L118', -'_types.analysis.WordDelimiterGraphTokenFilter': '_types/analysis/token_filters.ts#L149-L166', -'_types.analysis.WordDelimiterTokenFilter': '_types/analysis/token_filters.ts#L132-L147', -'_types.mapping.AggregateMetricDoubleProperty': '_types/mapping/complex.ts#L59-L64', +'_types.analysis.WordDelimiterGraphTokenFilter': '_types/analysis/token_filters.ts#L151-L168', +'_types.analysis.WordDelimiterTokenFilter': '_types/analysis/token_filters.ts#L134-L149', +'_types.mapping.AggregateMetricDoubleProperty': '_types/mapping/complex.ts#L61-L66', '_types.mapping.AllField': '_types/mapping/meta-fields.ts#L29-L40', -'_types.mapping.BinaryProperty': '_types/mapping/core.ts#L49-L51', -'_types.mapping.BooleanProperty': '_types/mapping/core.ts#L53-L59', -'_types.mapping.ByteNumberProperty': '_types/mapping/core.ts#L164-L167', -'_types.mapping.CompletionProperty': '_types/mapping/specialized.ts#L27-L35', -'_types.mapping.ConstantKeywordProperty': '_types/mapping/specialized.ts#L44-L47', -'_types.mapping.CorePropertyBase': '_types/mapping/core.ts#L39-L43', -'_types.mapping.DataStreamTimestamp': '_types/mapping/TypeMapping.ts#L58-L60', -'_types.mapping.DateNanosProperty': '_types/mapping/core.ts#L73-L81', -'_types.mapping.DateProperty': '_types/mapping/core.ts#L61-L71', +'_types.mapping.BinaryProperty': '_types/mapping/core.ts#L55-L57', +'_types.mapping.BooleanProperty': '_types/mapping/core.ts#L59-L65', +'_types.mapping.ByteNumberProperty': '_types/mapping/core.ts#L172-L175', +'_types.mapping.CompletionProperty': '_types/mapping/specialized.ts#L33-L41', +'_types.mapping.ConstantKeywordProperty': '_types/mapping/specialized.ts#L50-L53', +'_types.mapping.CorePropertyBase': '_types/mapping/core.ts#L45-L49', +'_types.mapping.DataStreamTimestamp': '_types/mapping/TypeMapping.ts#L59-L61', +'_types.mapping.DateNanosProperty': '_types/mapping/core.ts#L79-L87', +'_types.mapping.DateProperty': '_types/mapping/core.ts#L67-L77', '_types.mapping.DateRangeProperty': '_types/mapping/range.ts#L29-L32', '_types.mapping.DenseVectorIndexOptions': '_types/mapping/DenseVectorIndexOptions.ts#L22-L26', -'_types.mapping.DenseVectorProperty': '_types/mapping/complex.ts#L51-L57', -'_types.mapping.DocValuesPropertyBase': '_types/mapping/core.ts#L45-L47', -'_types.mapping.DoubleNumberProperty': '_types/mapping/core.ts#L144-L147', +'_types.mapping.DenseVectorProperty': '_types/mapping/complex.ts#L52-L59', +'_types.mapping.DocValuesPropertyBase': '_types/mapping/core.ts#L51-L53', +'_types.mapping.DoubleNumberProperty': '_types/mapping/core.ts#L152-L155', '_types.mapping.DoubleRangeProperty': '_types/mapping/range.ts#L34-L36', -'_types.mapping.DynamicMapping': '_types/mapping/dynamic-template.ts#L37-L46', -'_types.mapping.DynamicProperty': '_types/mapping/core.ts#L286-L317', -'_types.mapping.DynamicTemplate': '_types/mapping/dynamic-template.ts#L22-L30', -'_types.mapping.FieldAliasProperty': '_types/mapping/specialized.ts#L49-L52', +'_types.mapping.DynamicMapping': '_types/mapping/dynamic-template.ts#L49-L58', +'_types.mapping.DynamicProperty': '_types/mapping/core.ts#L300-L331', +'_types.mapping.DynamicTemplate': '_types/mapping/dynamic-template.ts#L22-L42', +'_types.mapping.FieldAliasProperty': '_types/mapping/specialized.ts#L55-L58', '_types.mapping.FieldNamesField': '_types/mapping/meta-fields.ts#L42-L44', -'_types.mapping.FieldType': '_types/mapping/Property.ts#L160-L204', +'_types.mapping.FieldType': '_types/mapping/Property.ts#L166-L213', '_types.mapping.FlattenedProperty': '_types/mapping/complex.ts#L26-L37', -'_types.mapping.FloatNumberProperty': '_types/mapping/core.ts#L134-L137', +'_types.mapping.FloatNumberProperty': '_types/mapping/core.ts#L142-L145', '_types.mapping.FloatRangeProperty': '_types/mapping/range.ts#L38-L40', '_types.mapping.GeoOrientation': '_types/mapping/geo.ts#L34-L39', '_types.mapping.GeoPointProperty': '_types/mapping/geo.ts#L24-L32', '_types.mapping.GeoShapeProperty': '_types/mapping/geo.ts#L41-L54', '_types.mapping.GeoStrategy': '_types/mapping/geo.ts#L56-L59', -'_types.mapping.HalfFloatNumberProperty': '_types/mapping/core.ts#L139-L142', -'_types.mapping.HistogramProperty': '_types/mapping/specialized.ts#L54-L57', +'_types.mapping.HalfFloatNumberProperty': '_types/mapping/core.ts#L147-L150', +'_types.mapping.HistogramProperty': '_types/mapping/specialized.ts#L60-L63', +'_types.mapping.IcuCollationProperty': '_types/mapping/specialized.ts#L94-L118', '_types.mapping.IndexField': '_types/mapping/meta-fields.ts#L46-L48', -'_types.mapping.IndexOptions': '_types/mapping/core.ts#L243-L248', -'_types.mapping.IntegerNumberProperty': '_types/mapping/core.ts#L149-L152', +'_types.mapping.IndexOptions': '_types/mapping/core.ts#L257-L262', +'_types.mapping.IntegerNumberProperty': '_types/mapping/core.ts#L157-L160', '_types.mapping.IntegerRangeProperty': '_types/mapping/range.ts#L42-L44', -'_types.mapping.IpProperty': '_types/mapping/specialized.ts#L59-L73', +'_types.mapping.IpProperty': '_types/mapping/specialized.ts#L65-L79', '_types.mapping.IpRangeProperty': '_types/mapping/range.ts#L46-L48', -'_types.mapping.JoinProperty': '_types/mapping/core.ts#L83-L87', -'_types.mapping.KeywordProperty': '_types/mapping/core.ts#L89-L105', -'_types.mapping.LongNumberProperty': '_types/mapping/core.ts#L154-L157', +'_types.mapping.JoinProperty': '_types/mapping/core.ts#L89-L93', +'_types.mapping.KeywordProperty': '_types/mapping/core.ts#L95-L113', +'_types.mapping.LongNumberProperty': '_types/mapping/core.ts#L162-L165', '_types.mapping.LongRangeProperty': '_types/mapping/range.ts#L50-L52', -'_types.mapping.MatchOnlyTextProperty': '_types/mapping/core.ts#L216-L241', -'_types.mapping.MatchType': '_types/mapping/dynamic-template.ts#L32-L35', -'_types.mapping.Murmur3HashProperty': '_types/mapping/specialized.ts#L75-L77', +'_types.mapping.MatchOnlyTextProperty': '_types/mapping/core.ts#L230-L255', +'_types.mapping.MatchType': '_types/mapping/dynamic-template.ts#L44-L47', +'_types.mapping.Murmur3HashProperty': '_types/mapping/specialized.ts#L81-L83', '_types.mapping.NestedProperty': '_types/mapping/complex.ts#L39-L44', -'_types.mapping.NumberPropertyBase': '_types/mapping/core.ts#L107-L127', -'_types.mapping.ObjectProperty': '_types/mapping/complex.ts#L46-L49', -'_types.mapping.OnScriptError': '_types/mapping/core.ts#L129-L132', -'_types.mapping.PercolatorProperty': '_types/mapping/core.ts#L180-L182', +'_types.mapping.NumberPropertyBase': '_types/mapping/core.ts#L115-L135', +'_types.mapping.ObjectProperty': '_types/mapping/complex.ts#L46-L50', +'_types.mapping.OnScriptError': '_types/mapping/core.ts#L137-L140', +'_types.mapping.PercolatorProperty': '_types/mapping/core.ts#L188-L190', '_types.mapping.PointProperty': '_types/mapping/geo.ts#L66-L71', -'_types.mapping.Property': '_types/mapping/Property.ts#L94-L158', -'_types.mapping.PropertyBase': '_types/mapping/Property.ts#L82-L92', +'_types.mapping.Property': '_types/mapping/Property.ts#L96-L164', +'_types.mapping.PropertyBase': '_types/mapping/Property.ts#L84-L94', '_types.mapping.RangePropertyBase': '_types/mapping/range.ts#L23-L27', -'_types.mapping.RankFeatureProperty': '_types/mapping/core.ts#L184-L187', -'_types.mapping.RankFeaturesProperty': '_types/mapping/core.ts#L189-L192', +'_types.mapping.RankFeatureProperty': '_types/mapping/core.ts#L192-L195', +'_types.mapping.RankFeaturesProperty': '_types/mapping/core.ts#L197-L200', '_types.mapping.RoutingField': '_types/mapping/meta-fields.ts#L50-L52', '_types.mapping.RuntimeField': '_types/mapping/RuntimeFields.ts#L26-L48', '_types.mapping.RuntimeFieldFetchFields': '_types/mapping/RuntimeFields.ts#L50-L54', -'_types.mapping.RuntimeFieldType': '_types/mapping/RuntimeFields.ts#L56-L65', -'_types.mapping.ScaledFloatNumberProperty': '_types/mapping/core.ts#L174-L178', -'_types.mapping.SearchAsYouTypeProperty': '_types/mapping/core.ts#L198-L208', +'_types.mapping.RuntimeFieldType': '_types/mapping/RuntimeFields.ts#L56-L66', +'_types.mapping.ScaledFloatNumberProperty': '_types/mapping/core.ts#L182-L186', +'_types.mapping.SearchAsYouTypeProperty': '_types/mapping/core.ts#L212-L222', +'_types.mapping.SemanticTextProperty': '_types/mapping/core.ts#L206-L210', '_types.mapping.ShapeProperty': '_types/mapping/geo.ts#L73-L85', -'_types.mapping.ShortNumberProperty': '_types/mapping/core.ts#L159-L162', +'_types.mapping.ShortNumberProperty': '_types/mapping/core.ts#L167-L170', '_types.mapping.SizeField': '_types/mapping/meta-fields.ts#L54-L56', '_types.mapping.SourceField': '_types/mapping/meta-fields.ts#L58-L65', '_types.mapping.SourceFieldMode': '_types/mapping/meta-fields.ts#L67-L75', -'_types.mapping.SparseVectorProperty': '_types/mapping/core.ts#L194-L196', -'_types.mapping.SuggestContext': '_types/mapping/specialized.ts#L37-L42', +'_types.mapping.SparseVectorProperty': '_types/mapping/core.ts#L202-L204', +'_types.mapping.SuggestContext': '_types/mapping/specialized.ts#L43-L48', '_types.mapping.TermVectorOption': '_types/mapping/TermVectorOption.ts#L20-L28', -'_types.mapping.TextIndexPrefixes': '_types/mapping/core.ts#L250-L253', -'_types.mapping.TextProperty': '_types/mapping/core.ts#L255-L271', +'_types.mapping.TextIndexPrefixes': '_types/mapping/core.ts#L264-L267', +'_types.mapping.TextProperty': '_types/mapping/core.ts#L269-L285', '_types.mapping.TimeSeriesMetricType': '_types/mapping/TimeSeriesMetricType.ts#L20-L26', -'_types.mapping.TokenCountProperty': '_types/mapping/specialized.ts#L79-L86', -'_types.mapping.TypeMapping': '_types/mapping/TypeMapping.ts#L34-L56', -'_types.mapping.UnsignedLongNumberProperty': '_types/mapping/core.ts#L169-L172', -'_types.mapping.VersionProperty': '_types/mapping/core.ts#L273-L275', -'_types.mapping.WildcardProperty': '_types/mapping/core.ts#L277-L284', +'_types.mapping.TokenCountProperty': '_types/mapping/specialized.ts#L85-L92', +'_types.mapping.TypeMapping': '_types/mapping/TypeMapping.ts#L34-L57', +'_types.mapping.UnsignedLongNumberProperty': '_types/mapping/core.ts#L177-L180', +'_types.mapping.VersionProperty': '_types/mapping/core.ts#L287-L289', +'_types.mapping.WildcardProperty': '_types/mapping/core.ts#L291-L298', '_types.query_dsl.BoolQuery': '_types/query_dsl/compound.ts#L28-L52', '_types.query_dsl.BoostingQuery': '_types/query_dsl/compound.ts#L54-L67', '_types.query_dsl.ChildScoreMode': '_types/query_dsl/joining.ts#L25-L39', -'_types.query_dsl.CombinedFieldsOperator': '_types/query_dsl/abstractions.ts#L489-L492', -'_types.query_dsl.CombinedFieldsQuery': '_types/query_dsl/abstractions.ts#L445-L479', -'_types.query_dsl.CombinedFieldsZeroTerms': '_types/query_dsl/abstractions.ts#L494-L503', +'_types.query_dsl.CombinedFieldsOperator': '_types/query_dsl/abstractions.ts#L509-L512', +'_types.query_dsl.CombinedFieldsQuery': '_types/query_dsl/abstractions.ts#L465-L499', +'_types.query_dsl.CombinedFieldsZeroTerms': '_types/query_dsl/abstractions.ts#L514-L523', '_types.query_dsl.CommonTermsQuery': '_types/query_dsl/fulltext.ts#L34-L44', '_types.query_dsl.ConstantScoreQuery': '_types/query_dsl/compound.ts#L69-L76', '_types.query_dsl.DecayFunction': '_types/query_dsl/compound.ts#L194-L199', @@ -726,8 +735,8 @@ '_types.query_dsl.DisMaxQuery': '_types/query_dsl/compound.ts#L78-L90', '_types.query_dsl.DistanceFeatureQuery': '_types/query_dsl/specialized.ts#L40-L60', '_types.query_dsl.ExistsQuery': '_types/query_dsl/term.ts#L36-L41', -'_types.query_dsl.FieldAndFormat': '_types/query_dsl/abstractions.ts#L505-L519', -'_types.query_dsl.FieldLookup': '_types/query_dsl/abstractions.ts#L409-L426', +'_types.query_dsl.FieldAndFormat': '_types/query_dsl/abstractions.ts#L525-L539', +'_types.query_dsl.FieldLookup': '_types/query_dsl/abstractions.ts#L429-L446', '_types.query_dsl.FieldValueFactorModifier': '_types/query_dsl/compound.ts#L298-L341', '_types.query_dsl.FieldValueFactorScoreFunction': '_types/query_dsl/compound.ts#L132-L151', '_types.query_dsl.FunctionBoostMode': '_types/query_dsl/compound.ts#L270-L296', @@ -756,14 +765,14 @@ '_types.query_dsl.IntervalsQuery': '_types/query_dsl/fulltext.ts#L235-L263', '_types.query_dsl.IntervalsWildcard': '_types/query_dsl/fulltext.ts#L265-L280', '_types.query_dsl.Like': '_types/query_dsl/specialized.ts#L186-L191', -'_types.query_dsl.LikeDocument': '_types/query_dsl/specialized.ts#L165-L184', +'_types.query_dsl.LikeDocument': '_types/query_dsl/specialized.ts#L162-L184', '_types.query_dsl.MatchAllQuery': '_types/query_dsl/MatchAllQuery.ts#L22-L22', '_types.query_dsl.MatchBoolPrefixQuery': '_types/query_dsl/fulltext.ts#L349-L403', '_types.query_dsl.MatchNoneQuery': '_types/query_dsl/MatchNoneQuery.ts#L22-L22', '_types.query_dsl.MatchPhrasePrefixQuery': '_types/query_dsl/fulltext.ts#L428-L454', '_types.query_dsl.MatchPhraseQuery': '_types/query_dsl/fulltext.ts#L405-L426', '_types.query_dsl.MatchQuery': '_types/query_dsl/fulltext.ts#L282-L347', -'_types.query_dsl.MoreLikeThisQuery': '_types/query_dsl/specialized.ts#L78-L163', +'_types.query_dsl.MoreLikeThisQuery': '_types/query_dsl/specialized.ts#L78-L160', '_types.query_dsl.MultiMatchQuery': '_types/query_dsl/fulltext.ts#L456-L539', '_types.query_dsl.MultiValueMode': '_types/query_dsl/compound.ts#L343-L360', '_types.query_dsl.NestedQuery': '_types/query_dsl/joining.ts#L106-L130', @@ -773,24 +782,25 @@ '_types.query_dsl.PinnedDoc': '_types/query_dsl/specialized.ts#L253-L262', '_types.query_dsl.PinnedQuery': '_types/query_dsl/specialized.ts#L232-L251', '_types.query_dsl.PrefixQuery': '_types/query_dsl/term.ts#L87-L106', -'_types.query_dsl.QueryBase': '_types/query_dsl/abstractions.ts#L432-L443', -'_types.query_dsl.QueryContainer': '_types/query_dsl/abstractions.ts#L100-L407', +'_types.query_dsl.QueryBase': '_types/query_dsl/abstractions.ts#L452-L463', +'_types.query_dsl.QueryContainer': '_types/query_dsl/abstractions.ts#L102-L427', '_types.query_dsl.QueryStringQuery': '_types/query_dsl/fulltext.ts#L580-L700', '_types.query_dsl.RandomScoreFunction': '_types/query_dsl/compound.ts#L127-L130', '_types.query_dsl.RangeQuery': '_types/query_dsl/term.ts#L116-L143', '_types.query_dsl.RangeQueryBase': '_types/query_dsl/term.ts#L108-L114', -'_types.query_dsl.RangeRelation': '_types/query_dsl/term.ts#L170-L183', +'_types.query_dsl.RangeRelation': '_types/query_dsl/term.ts#L191-L204', '_types.query_dsl.RankFeatureFunction': '_types/query_dsl/specialized.ts#L264-L264', '_types.query_dsl.RankFeatureFunctionLinear': '_types/query_dsl/specialized.ts#L266-L266', '_types.query_dsl.RankFeatureFunctionLogarithm': '_types/query_dsl/specialized.ts#L268-L273', '_types.query_dsl.RankFeatureFunctionSaturation': '_types/query_dsl/specialized.ts#L275-L280', '_types.query_dsl.RankFeatureFunctionSigmoid': '_types/query_dsl/specialized.ts#L282-L291', '_types.query_dsl.RankFeatureQuery': '_types/query_dsl/specialized.ts#L293-L316', -'_types.query_dsl.RegexpQuery': '_types/query_dsl/term.ts#L185-L215', +'_types.query_dsl.RegexpQuery': '_types/query_dsl/term.ts#L206-L236', '_types.query_dsl.RuleQuery': '_types/query_dsl/specialized.ts#L369-L373', '_types.query_dsl.ScriptQuery': '_types/query_dsl/specialized.ts#L318-L324', '_types.query_dsl.ScriptScoreFunction': '_types/query_dsl/compound.ts#L120-L125', '_types.query_dsl.ScriptScoreQuery': '_types/query_dsl/specialized.ts#L326-L340', +'_types.query_dsl.SemanticQuery': '_types/query_dsl/SemanticQuery.ts#L22-L27', '_types.query_dsl.ShapeFieldQuery': '_types/query_dsl/specialized.ts#L354-L367', '_types.query_dsl.ShapeQuery': '_types/query_dsl/specialized.ts#L344-L352', '_types.query_dsl.SimpleQueryStringFlag': '_types/query_dsl/fulltext.ts#L708-L763', @@ -802,21 +812,22 @@ '_types.query_dsl.SpanNearQuery': '_types/query_dsl/span.ts#L65-L78', '_types.query_dsl.SpanNotQuery': '_types/query_dsl/span.ts#L80-L104', '_types.query_dsl.SpanOrQuery': '_types/query_dsl/span.ts#L106-L111', -'_types.query_dsl.SpanQuery': '_types/query_dsl/span.ts#L131-L170', +'_types.query_dsl.SpanQuery': '_types/query_dsl/span.ts#L131-L173', '_types.query_dsl.SpanTermQuery': '_types/query_dsl/span.ts#L113-L116', '_types.query_dsl.SpanWithinQuery': '_types/query_dsl/span.ts#L118-L129', -'_types.query_dsl.TermQuery': '_types/query_dsl/term.ts#L217-L231', -'_types.query_dsl.TermsLookup': '_types/query_dsl/term.ts#L242-L247', -'_types.query_dsl.TermsQuery': '_types/query_dsl/term.ts#L233-L235', -'_types.query_dsl.TermsQueryField': '_types/query_dsl/term.ts#L237-L240', -'_types.query_dsl.TermsSetQuery': '_types/query_dsl/term.ts#L249-L262', +'_types.query_dsl.SparseVectorQuery': '_types/query_dsl/SparseVectorQuery.ts#L26-L79', +'_types.query_dsl.TermQuery': '_types/query_dsl/term.ts#L238-L252', +'_types.query_dsl.TermsLookup': '_types/query_dsl/term.ts#L263-L268', +'_types.query_dsl.TermsQuery': '_types/query_dsl/term.ts#L254-L256', +'_types.query_dsl.TermsQueryField': '_types/query_dsl/term.ts#L258-L261', +'_types.query_dsl.TermsSetQuery': '_types/query_dsl/term.ts#L270-L283', '_types.query_dsl.TextExpansionQuery': '_types/query_dsl/TextExpansionQuery.ts#L23-L33', '_types.query_dsl.TextQueryType': '_types/query_dsl/fulltext.ts#L541-L567', '_types.query_dsl.TokenPruningConfig': '_types/query_dsl/TokenPruningConfig.ts#L22-L35', -'_types.query_dsl.TypeQuery': '_types/query_dsl/term.ts#L264-L266', +'_types.query_dsl.TypeQuery': '_types/query_dsl/term.ts#L285-L287', '_types.query_dsl.WeightedTokensQuery': '_types/query_dsl/WeightedTokensQuery.ts#L27-L32', -'_types.query_dsl.WildcardQuery': '_types/query_dsl/term.ts#L268-L285', -'_types.query_dsl.WrapperQuery': '_types/query_dsl/abstractions.ts#L481-L487', +'_types.query_dsl.WildcardQuery': '_types/query_dsl/term.ts#L289-L306', +'_types.query_dsl.WrapperQuery': '_types/query_dsl/abstractions.ts#L501-L507', '_types.query_dsl.ZeroTermsQuery': '_types/query_dsl/fulltext.ts#L569-L578', 'async_search._types.AsyncSearch': 'async_search/_types/AsyncSearch.ts#L30-L56', 'async_search._types.AsyncSearchDocumentResponseBase': 'async_search/_types/AsyncSearchResponseBase.ts#L50-L54', @@ -825,7 +836,7 @@ 'async_search.delete.Response': 'async_search/delete/AsyncSearchDeleteResponse.ts#L22-L24', 'async_search.get.Request': 'async_search/get/AsyncSearchGetRequest.ts#L24-L54', 'async_search.get.Response': 'async_search/get/AsyncSearchGetResponse.ts#L22-L24', -'async_search.status.Request': 'async_search/status/AsyncSearchStatusRequest.ts#L23-L36', +'async_search.status.Request': 'async_search/status/AsyncSearchStatusRequest.ts#L23-L37', 'async_search.status.Response': 'async_search/status/AsyncSearchStatusResponse.ts#L39-L41', 'async_search.status.StatusResponseBase': 'async_search/status/AsyncSearchStatusResponse.ts#L24-L38', 'async_search.submit.Request': 'async_search/submit/AsyncSearchSubmitRequest.ts#L55-L286', @@ -876,7 +887,7 @@ 'cluster.get_component_template.Response': 'cluster/get_component_template/ClusterGetComponentTemplateResponse.ts#L22-L24', 'cluster.info.Request': 'cluster/info/ClusterInfoRequest.ts#L23-L34', 'cluster.info.Response': 'cluster/info/ClusterInfoResponse.ts#L26-L34', -'cluster.put_component_template.Request': 'cluster/put_component_template/ClusterPutComponentTemplateRequest.ts#L29-L99', +'cluster.put_component_template.Request': 'cluster/put_component_template/ClusterPutComponentTemplateRequest.ts#L25-L93', 'cluster.put_component_template.Response': 'cluster/put_component_template/ClusterPutComponentTemplateResponse.ts#L22-L24', 'enrich._types.Policy': 'enrich/_types/Policy.ts#L34-L41', 'enrich._types.PolicyType': 'enrich/_types/Policy.ts#L28-L32', @@ -909,6 +920,8 @@ 'eql.search.Request': 'eql/search/EqlSearchRequest.ts#L28-L118', 'eql.search.Response': 'eql/search/EqlSearchResponse.ts#L22-L24', 'eql.search.ResultPosition': 'eql/search/types.ts#L20-L32', +'esql.query.Request': 'esql/query/QueryRequest.ts#L24-L65', +'esql.query.Response': 'esql/query/QueryResponse.ts#L22-L25', 'graph._types.Connection': 'graph/_types/Connection.ts#L22-L27', 'graph._types.ExploreControls': 'graph/_types/ExploreControls.ts#L24-L49', 'graph._types.Hop': 'graph/_types/Hop.ts#L23-L36', @@ -920,7 +933,7 @@ 'graph.explore.Response': 'graph/explore/GraphExploreResponse.ts#L25-L33', 'indices._types.Alias': 'indices/_types/Alias.ts#L23-L53', 'indices._types.AliasDefinition': 'indices/_types/AliasDefinition.ts#L22-L54', -'indices._types.CacheQueries': 'indices/_types/IndexSettings.ts#L401-L403', +'indices._types.CacheQueries': 'indices/_types/IndexSettings.ts#L405-L407', 'indices._types.DataStream': 'indices/_types/DataStream.ts#L39-L112', 'indices._types.DataStreamIndex': 'indices/_types/DataStream.ts#L121-L142', 'indices._types.DataStreamLifecycle': 'indices/_types/DataStreamLifecycle.ts#L25-L31', @@ -932,7 +945,7 @@ 'indices._types.DownsampleConfig': 'indices/_types/Downsample.ts#L22-L27', 'indices._types.DownsamplingRound': 'indices/_types/DownsamplingRound.ts#L23-L32', 'indices._types.FielddataFrequencyFilter': 'indices/_types/FielddataFrequencyFilter.ts#L22-L26', -'indices._types.IndexCheckOnStartup': 'indices/_types/IndexSettings.ts#L256-L263', +'indices._types.IndexCheckOnStartup': 'indices/_types/IndexSettings.ts#L260-L267', 'indices._types.IndexRouting': 'indices/_types/IndexRouting.ts#L22-L25', 'indices._types.IndexRoutingAllocation': 'indices/_types/IndexRouting.ts#L27-L32', 'indices._types.IndexRoutingAllocationDisk': 'indices/_types/IndexRouting.ts#L62-L64', @@ -942,60 +955,61 @@ 'indices._types.IndexRoutingRebalance': 'indices/_types/IndexRouting.ts#L34-L36', 'indices._types.IndexRoutingRebalanceOptions': 'indices/_types/IndexRouting.ts#L45-L50', 'indices._types.IndexSegmentSort': 'indices/_types/IndexSegmentSort.ts#L22-L27', -'indices._types.IndexSettingBlocks': 'indices/_types/IndexSettings.ts#L248-L254', +'indices._types.IndexSettingBlocks': 'indices/_types/IndexSettings.ts#L252-L258', 'indices._types.IndexSettings': 'indices/_types/IndexSettings.ts#L69-L167', -'indices._types.IndexSettingsAnalysis': 'indices/_types/IndexSettings.ts#L313-L319', -'indices._types.IndexSettingsLifecycle': 'indices/_types/IndexSettings.ts#L270-L303', -'indices._types.IndexSettingsLifecycleStep': 'indices/_types/IndexSettings.ts#L305-L311', -'indices._types.IndexSettingsTimeSeries': 'indices/_types/IndexSettings.ts#L321-L324', +'indices._types.IndexSettingsAnalysis': 'indices/_types/IndexSettings.ts#L317-L323', +'indices._types.IndexSettingsLifecycle': 'indices/_types/IndexSettings.ts#L274-L307', +'indices._types.IndexSettingsLifecycleStep': 'indices/_types/IndexSettings.ts#L309-L315', +'indices._types.IndexSettingsTimeSeries': 'indices/_types/IndexSettings.ts#L325-L328', 'indices._types.IndexState': 'indices/_types/IndexState.ts#L27-L40', 'indices._types.IndexTemplate': 'indices/_types/IndexTemplate.ts#L31-L70', 'indices._types.IndexTemplateDataStreamConfiguration': 'indices/_types/IndexTemplate.ts#L72-L83', 'indices._types.IndexTemplateSummary': 'indices/_types/IndexTemplate.ts#L85-L107', -'indices._types.IndexVersioning': 'indices/_types/IndexSettings.ts#L265-L268', -'indices._types.IndexingPressure': 'indices/_types/IndexSettings.ts#L537-L539', -'indices._types.IndexingPressureMemory': 'indices/_types/IndexSettings.ts#L541-L548', -'indices._types.IndexingSlowlogSettings': 'indices/_types/IndexSettings.ts#L550-L555', -'indices._types.IndexingSlowlogTresholds': 'indices/_types/IndexSettings.ts#L557-L564', +'indices._types.IndexVersioning': 'indices/_types/IndexSettings.ts#L269-L272', +'indices._types.IndexingPressure': 'indices/_types/IndexSettings.ts#L548-L550', +'indices._types.IndexingPressureMemory': 'indices/_types/IndexSettings.ts#L552-L559', +'indices._types.IndexingSlowlogSettings': 'indices/_types/IndexSettings.ts#L561-L566', +'indices._types.IndexingSlowlogTresholds': 'indices/_types/IndexSettings.ts#L568-L575', 'indices._types.ManagedBy': 'indices/_types/DataStream.ts#L32-L37', -'indices._types.MappingLimitSettings': 'indices/_types/IndexSettings.ts#L405-L418', -'indices._types.MappingLimitSettingsDepth': 'indices/_types/IndexSettings.ts#L430-L437', -'indices._types.MappingLimitSettingsDimensionFields': 'indices/_types/IndexSettings.ts#L467-L473', -'indices._types.MappingLimitSettingsFieldNameLength': 'indices/_types/IndexSettings.ts#L458-L465', -'indices._types.MappingLimitSettingsNestedFields': 'indices/_types/IndexSettings.ts#L439-L447', -'indices._types.MappingLimitSettingsNestedObjects': 'indices/_types/IndexSettings.ts#L449-L456', -'indices._types.MappingLimitSettingsTotalFields': 'indices/_types/IndexSettings.ts#L420-L428', -'indices._types.Merge': 'indices/_types/IndexSettings.ts#L326-L328', -'indices._types.MergeScheduler': 'indices/_types/IndexSettings.ts#L330-L333', +'indices._types.MappingLimitSettings': 'indices/_types/IndexSettings.ts#L409-L422', +'indices._types.MappingLimitSettingsDepth': 'indices/_types/IndexSettings.ts#L443-L450', +'indices._types.MappingLimitSettingsDimensionFields': 'indices/_types/IndexSettings.ts#L480-L486', +'indices._types.MappingLimitSettingsFieldNameLength': 'indices/_types/IndexSettings.ts#L471-L478', +'indices._types.MappingLimitSettingsNestedFields': 'indices/_types/IndexSettings.ts#L452-L460', +'indices._types.MappingLimitSettingsNestedObjects': 'indices/_types/IndexSettings.ts#L462-L469', +'indices._types.MappingLimitSettingsTotalFields': 'indices/_types/IndexSettings.ts#L424-L441', +'indices._types.Merge': 'indices/_types/IndexSettings.ts#L330-L332', +'indices._types.MergeScheduler': 'indices/_types/IndexSettings.ts#L334-L337', 'indices._types.NumericFielddata': 'indices/_types/NumericFielddata.ts#L22-L24', 'indices._types.NumericFielddataFormat': 'indices/_types/NumericFielddataFormat.ts#L20-L23', -'indices._types.Queries': 'indices/_types/IndexSettings.ts#L397-L399', +'indices._types.Queries': 'indices/_types/IndexSettings.ts#L401-L403', 'indices._types.RetentionLease': 'indices/_types/IndexSettings.ts#L65-L67', -'indices._types.SearchIdle': 'indices/_types/IndexSettings.ts#L239-L242', +'indices._types.SearchIdle': 'indices/_types/IndexSettings.ts#L243-L246', 'indices._types.SegmentSortMissing': 'indices/_types/IndexSegmentSort.ts#L43-L46', 'indices._types.SegmentSortMode': 'indices/_types/IndexSegmentSort.ts#L36-L41', 'indices._types.SegmentSortOrder': 'indices/_types/IndexSegmentSort.ts#L29-L34', -'indices._types.SettingsAnalyze': 'indices/_types/IndexSettings.ts#L229-L232', -'indices._types.SettingsHighlight': 'indices/_types/IndexSettings.ts#L224-L227', -'indices._types.SettingsQueryString': 'indices/_types/IndexSettings.ts#L244-L246', -'indices._types.SettingsSearch': 'indices/_types/IndexSettings.ts#L234-L237', -'indices._types.SettingsSimilarity': 'indices/_types/IndexSettings.ts#L169-L181', -'indices._types.SettingsSimilarityBm25': 'indices/_types/IndexSettings.ts#L183-L188', -'indices._types.SettingsSimilarityDfi': 'indices/_types/IndexSettings.ts#L190-L193', -'indices._types.SettingsSimilarityDfr': 'indices/_types/IndexSettings.ts#L195-L200', -'indices._types.SettingsSimilarityIb': 'indices/_types/IndexSettings.ts#L202-L207', -'indices._types.SettingsSimilarityLmd': 'indices/_types/IndexSettings.ts#L209-L212', -'indices._types.SettingsSimilarityLmj': 'indices/_types/IndexSettings.ts#L214-L217', -'indices._types.SettingsSimilarityScriptedTfidf': 'indices/_types/IndexSettings.ts#L219-L222', -'indices._types.SlowlogSettings': 'indices/_types/IndexSettings.ts#L475-L480', -'indices._types.SlowlogTresholdLevels': 'indices/_types/IndexSettings.ts#L487-L492', -'indices._types.SlowlogTresholds': 'indices/_types/IndexSettings.ts#L482-L485', +'indices._types.SettingsAnalyze': 'indices/_types/IndexSettings.ts#L233-L236', +'indices._types.SettingsHighlight': 'indices/_types/IndexSettings.ts#L228-L231', +'indices._types.SettingsQueryString': 'indices/_types/IndexSettings.ts#L248-L250', +'indices._types.SettingsSearch': 'indices/_types/IndexSettings.ts#L238-L241', +'indices._types.SettingsSimilarity': 'indices/_types/IndexSettings.ts#L169-L180', +'indices._types.SettingsSimilarityBm25': 'indices/_types/IndexSettings.ts#L186-L191', +'indices._types.SettingsSimilarityBoolean': 'indices/_types/IndexSettings.ts#L182-L184', +'indices._types.SettingsSimilarityDfi': 'indices/_types/IndexSettings.ts#L193-L196', +'indices._types.SettingsSimilarityDfr': 'indices/_types/IndexSettings.ts#L198-L203', +'indices._types.SettingsSimilarityIb': 'indices/_types/IndexSettings.ts#L205-L210', +'indices._types.SettingsSimilarityLmd': 'indices/_types/IndexSettings.ts#L212-L215', +'indices._types.SettingsSimilarityLmj': 'indices/_types/IndexSettings.ts#L217-L220', +'indices._types.SettingsSimilarityScripted': 'indices/_types/IndexSettings.ts#L222-L226', +'indices._types.SlowlogSettings': 'indices/_types/IndexSettings.ts#L488-L493', +'indices._types.SlowlogTresholdLevels': 'indices/_types/IndexSettings.ts#L500-L505', +'indices._types.SlowlogTresholds': 'indices/_types/IndexSettings.ts#L495-L498', 'indices._types.SoftDeletes': 'indices/_types/IndexSettings.ts#L50-L63', -'indices._types.Storage': 'indices/_types/IndexSettings.ts#L494-L503', -'indices._types.StorageType': 'indices/_types/IndexSettings.ts#L505-L535', -'indices._types.Translog': 'indices/_types/IndexSettings.ts#L335-L357', -'indices._types.TranslogDurability': 'indices/_types/IndexSettings.ts#L359-L374', -'indices._types.TranslogRetention': 'indices/_types/IndexSettings.ts#L376-L395', +'indices._types.Storage': 'indices/_types/IndexSettings.ts#L507-L516', +'indices._types.StorageType': 'indices/_types/IndexSettings.ts#L518-L546', +'indices._types.Translog': 'indices/_types/IndexSettings.ts#L339-L361', +'indices._types.TranslogDurability': 'indices/_types/IndexSettings.ts#L363-L378', +'indices._types.TranslogRetention': 'indices/_types/IndexSettings.ts#L380-L399', 'indices.add_block.IndicesBlockOptions': 'indices/add_block/IndicesAddBlockRequest.ts#L43-L48', 'indices.add_block.IndicesBlockStatus': 'indices/add_block/IndicesAddBlockResponse.ts#L30-L33', 'indices.add_block.Request': 'indices/add_block/IndicesAddBlockRequest.ts#L24-L41', @@ -1033,10 +1047,10 @@ 'indices.explain_data_lifecycle.Response': 'indices/explain_data_lifecycle/IndicesExplainDataLifecycleResponse.ts#L25-L29', 'indices.get.Feature': 'indices/get/IndicesGetRequest.ts#L90-L94', 'indices.get.Request': 'indices/get/IndicesGetRequest.ts#L24-L88', -'indices.get.Response': 'indices/get/IndicesGetResponse.ts#L24-L26', -'indices.get_alias.IndexAliases': 'indices/get_alias/IndicesGetAliasResponse.ts#L36-L38', +'indices.get.Response': 'indices/get/IndicesGetResponse.ts#L24-L27', +'indices.get_alias.IndexAliases': 'indices/get_alias/IndicesGetAliasResponse.ts#L37-L39', 'indices.get_alias.Request': 'indices/get_alias/IndicesGetAliasRequest.ts#L23-L70', -'indices.get_alias.Response': 'indices/get_alias/IndicesGetAliasResponse.ts#L26-L34', +'indices.get_alias.Response': 'indices/get_alias/IndicesGetAliasResponse.ts#L26-L35', 'indices.get_data_lifecycle.DataStreamWithLifecycle': 'indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts#L27-L30', 'indices.get_data_lifecycle.Request': 'indices/get_data_lifecycle/IndicesGetDataLifecycleRequest.ts#L23-L52', 'indices.get_data_lifecycle.Response': 'indices/get_data_lifecycle/IndicesGetDataLifecycleResponse.ts#L23-L25', @@ -1045,11 +1059,11 @@ 'indices.get_index_template.IndexTemplateItem': 'indices/get_index_template/IndicesGetIndexTemplateResponse.ts#L29-L32', 'indices.get_index_template.Request': 'indices/get_index_template/IndicesGetIndexTemplateRequest.ts#L24-L60', 'indices.get_index_template.Response': 'indices/get_index_template/IndicesGetIndexTemplateResponse.ts#L23-L27', -'indices.get_mapping.IndexMappingRecord': 'indices/get_mapping/IndicesGetMappingResponse.ts#L28-L31', +'indices.get_mapping.IndexMappingRecord': 'indices/get_mapping/IndicesGetMappingResponse.ts#L29-L32', 'indices.get_mapping.Request': 'indices/get_mapping/IndicesGetMappingRequest.ts#L24-L72', -'indices.get_mapping.Response': 'indices/get_mapping/IndicesGetMappingResponse.ts#L24-L26', +'indices.get_mapping.Response': 'indices/get_mapping/IndicesGetMappingResponse.ts#L24-L27', 'indices.get_settings.Request': 'indices/get_settings/IndicesGetSettingsRequest.ts#L24-L91', -'indices.get_settings.Response': 'indices/get_settings/IndicesGetSettingsResponse.ts#L24-L26', +'indices.get_settings.Response': 'indices/get_settings/IndicesGetSettingsResponse.ts#L24-L27', 'indices.migrate_to_data_stream.Request': 'indices/migrate_to_data_stream/IndicesMigrateToDataStreamRequest.ts#L23-L44', 'indices.migrate_to_data_stream.Response': 'indices/migrate_to_data_stream/IndicesMigrateToDataStreamResponse.ts#L22-L24', 'indices.modify_data_stream.Action': 'indices/modify_data_stream/types.ts#L22-L37', @@ -1060,14 +1074,14 @@ 'indices.put_alias.Response': 'indices/put_alias/IndicesPutAliasResponse.ts#L22-L24', 'indices.put_data_lifecycle.Request': 'indices/put_data_lifecycle/IndicesPutDataLifecycleRequest.ts#L25-L75', 'indices.put_data_lifecycle.Response': 'indices/put_data_lifecycle/IndicesPutDataLifecycleResponse.ts#L22-L24', -'indices.put_index_template.IndexTemplateMapping': 'indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L97-L119', -'indices.put_index_template.Request': 'indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L36-L95', +'indices.put_index_template.IndexTemplateMapping': 'indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L121-L143', +'indices.put_index_template.Request': 'indices/put_index_template/IndicesPutIndexTemplateRequest.ts#L37-L119', 'indices.put_index_template.Response': 'indices/put_index_template/IndicesPutIndexTemplateResponse.ts#L22-L24', 'indices.put_mapping.Request': 'indices/put_mapping/IndicesPutMappingRequest.ts#L42-L149', 'indices.put_mapping.Response': 'indices/put_mapping/IndicesPutMappingResponse.ts#L22-L24', 'indices.put_settings.Request': 'indices/put_settings/IndicesPutSettingsRequest.ts#L25-L92', 'indices.put_settings.Response': 'indices/put_settings/IndicesPutSettingsResponse.ts#L22-L24', -'indices.put_template.Request': 'indices/put_template/IndicesPutTemplateRequest.ts#L29-L105', +'indices.put_template.Request': 'indices/put_template/IndicesPutTemplateRequest.ts#L29-L95', 'indices.put_template.Response': 'indices/put_template/IndicesPutTemplateResponse.ts#L22-L24', 'indices.refresh.Request': 'indices/refresh/IndicesRefreshRequest.ts#L23-L60', 'indices.refresh.Response': 'indices/refresh/IndicesRefreshResponse.ts#L22-L24', @@ -1081,10 +1095,10 @@ 'indices.rollover.Request': 'indices/rollover/IndicesRolloverRequest.ts#L29-L99', 'indices.rollover.Response': 'indices/rollover/IndicesRolloverResponse.ts#L22-L32', 'indices.rollover.RolloverConditions': 'indices/rollover/types.ts#L24-L40', -'indices.simulate_index_template.Request': 'indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts#L33-L115', -'indices.simulate_index_template.Response': 'indices/simulate_index_template/IndicesSimulateIndexTemplateResponse.ts#L20-L22', +'indices.simulate_index_template.Request': 'indices/simulate_index_template/IndicesSimulateIndexTemplateRequest.ts#L24-L49', +'indices.simulate_index_template.Response': 'indices/simulate_index_template/IndicesSimulateIndexTemplateResponse.ts#L25-L30', 'indices.simulate_template.Overlapping': 'indices/simulate_template/IndicesSimulateTemplateResponse.ts#L39-L42', -'indices.simulate_template.Request': 'indices/simulate_template/IndicesSimulateTemplateRequest.ts#L25-L61', +'indices.simulate_template.Request': 'indices/simulate_template/IndicesSimulateTemplateRequest.ts#L27-L119', 'indices.simulate_template.Response': 'indices/simulate_template/IndicesSimulateTemplateResponse.ts#L26-L31', 'indices.simulate_template.Template': 'indices/simulate_template/IndicesSimulateTemplateResponse.ts#L33-L37', 'indices.update_aliases.Action': 'indices/update_aliases/types.ts#L23-L39', @@ -1096,21 +1110,24 @@ 'indices.validate_query.IndicesValidationExplanation': 'indices/validate_query/IndicesValidateQueryResponse.ts#L32-L37', 'indices.validate_query.Request': 'indices/validate_query/IndicesValidateQueryRequest.ts#L25-L111', 'indices.validate_query.Response': 'indices/validate_query/IndicesValidateQueryResponse.ts#L23-L30', -'inference._types.InferenceResult': 'inference/_types/Results.ts#L59-L67', -'inference._types.ModelConfig': 'inference/_types/Services.ts#L23-L39', -'inference._types.ModelConfigContainer': 'inference/_types/Services.ts#L41-L53', -'inference._types.SparseEmbeddingResult': 'inference/_types/Results.ts#L35-L37', -'inference._types.TaskType': 'inference/_types/TaskType.ts#L20-L26', -'inference._types.TextEmbeddingByteResult': 'inference/_types/Results.ts#L45-L50', -'inference._types.TextEmbeddingResult': 'inference/_types/Results.ts#L52-L57', -'inference.delete_model.Request': 'inference/delete_model/DeleteModelRequest.ts#L24-L41', -'inference.delete_model.Response': 'inference/delete_model/DeleteModelResponse.ts#L22-L24', -'inference.get_model.Request': 'inference/get_model/GetModelRequest.ts#L24-L41', -'inference.get_model.Response': 'inference/get_model/GetModelResponse.ts#L22-L26', -'inference.inference.Request': 'inference/inference/InferenceRequest.ts#L25-L53', +'inference._types.CompletionResult': 'inference/_types/Results.ts#L60-L65', +'inference._types.DeleteInferenceEndpointResult': 'inference/_types/Results.ts#L91-L96', +'inference._types.InferenceEndpoint': 'inference/_types/Services.ts#L23-L39', +'inference._types.InferenceEndpointInfo': 'inference/_types/Services.ts#L41-L53', +'inference._types.InferenceResult': 'inference/_types/Results.ts#L79-L89', +'inference._types.RankedDocument': 'inference/_types/Results.ts#L67-L77', +'inference._types.SparseEmbeddingResult': 'inference/_types/Results.ts#L36-L38', +'inference._types.TaskType': 'inference/_types/TaskType.ts#L20-L28', +'inference._types.TextEmbeddingByteResult': 'inference/_types/Results.ts#L46-L51', +'inference._types.TextEmbeddingResult': 'inference/_types/Results.ts#L53-L58', +'inference.delete.Request': 'inference/delete/DeleteRequest.ts#L24-L55', +'inference.delete.Response': 'inference/delete/DeleteResponse.ts#L22-L24', +'inference.get.Request': 'inference/get/GetRequest.ts#L24-L41', +'inference.get.Response': 'inference/get/GetResponse.ts#L22-L26', +'inference.inference.Request': 'inference/inference/InferenceRequest.ts#L26-L66', 'inference.inference.Response': 'inference/inference/InferenceResponse.ts#L22-L24', -'inference.put_model.Request': 'inference/put_model/PutModelRequest.ts#L25-L44', -'inference.put_model.Response': 'inference/put_model/PutModelResponse.ts#L22-L24', +'inference.put.Request': 'inference/put/PutRequest.ts#L25-L44', +'inference.put.Response': 'inference/put/PutResponse.ts#L22-L24', 'ingest._types.AppendProcessor': 'ingest/_types/Processors.ts#L279-L294', 'ingest._types.AttachmentProcessor': 'ingest/_types/Processors.ts#L296-L337', 'ingest._types.BytesProcessor': 'ingest/_types/Processors.ts#L392-L408', @@ -1142,24 +1159,24 @@ 'ingest._types.PipelineProcessor': 'ingest/_types/Processors.ts#L928-L939', 'ingest._types.ProcessorBase': 'ingest/_types/Processors.ts#L241-L264', 'ingest._types.ProcessorContainer': 'ingest/_types/Processors.ts#L27-L239', -'ingest._types.RemoveProcessor': 'ingest/_types/Processors.ts#L941-L951', -'ingest._types.RenameProcessor': 'ingest/_types/Processors.ts#L953-L969', -'ingest._types.RerouteProcessor': 'ingest/_types/Processors.ts#L971-L999', -'ingest._types.ScriptProcessor': 'ingest/_types/Processors.ts#L1001-L1021', -'ingest._types.SetProcessor': 'ingest/_types/Processors.ts#L1023-L1057', -'ingest._types.SetSecurityUserProcessor': 'ingest/_types/Processors.ts#L1059-L1068', -'ingest._types.ShapeType': 'ingest/_types/Processors.ts#L1070-L1073', -'ingest._types.SortProcessor': 'ingest/_types/Processors.ts#L1075-L1091', -'ingest._types.SplitProcessor': 'ingest/_types/Processors.ts#L1093-L1118', -'ingest._types.TrimProcessor': 'ingest/_types/Processors.ts#L1120-L1136', -'ingest._types.UppercaseProcessor': 'ingest/_types/Processors.ts#L1138-L1154', -'ingest._types.UrlDecodeProcessor': 'ingest/_types/Processors.ts#L1156-L1172', +'ingest._types.RemoveProcessor': 'ingest/_types/Processors.ts#L941-L955', +'ingest._types.RenameProcessor': 'ingest/_types/Processors.ts#L957-L973', +'ingest._types.RerouteProcessor': 'ingest/_types/Processors.ts#L975-L1003', +'ingest._types.ScriptProcessor': 'ingest/_types/Processors.ts#L1005-L1025', +'ingest._types.SetProcessor': 'ingest/_types/Processors.ts#L1027-L1061', +'ingest._types.SetSecurityUserProcessor': 'ingest/_types/Processors.ts#L1063-L1072', +'ingest._types.ShapeType': 'ingest/_types/Processors.ts#L1074-L1077', +'ingest._types.SortProcessor': 'ingest/_types/Processors.ts#L1079-L1095', +'ingest._types.SplitProcessor': 'ingest/_types/Processors.ts#L1097-L1122', +'ingest._types.TrimProcessor': 'ingest/_types/Processors.ts#L1124-L1140', +'ingest._types.UppercaseProcessor': 'ingest/_types/Processors.ts#L1142-L1158', +'ingest._types.UrlDecodeProcessor': 'ingest/_types/Processors.ts#L1160-L1176', 'ingest._types.UserAgentProcessor': 'ingest/_types/Processors.ts#L370-L390', 'ingest._types.UserAgentProperty': 'ingest/_types/Processors.ts#L266-L277', 'ingest.delete_pipeline.Request': 'ingest/delete_pipeline/DeletePipelineRequest.ts#L24-L52', 'ingest.delete_pipeline.Response': 'ingest/delete_pipeline/DeletePipelineResponse.ts#L22-L24', 'ingest.get_pipeline.Request': 'ingest/get_pipeline/GetPipelineRequest.ts#L24-L50', -'ingest.get_pipeline.Response': 'ingest/get_pipeline/GetPipelineResponse.ts#L23-L25', +'ingest.get_pipeline.Response': 'ingest/get_pipeline/GetPipelineResponse.ts#L23-L26', 'ingest.processor_grok.Request': 'ingest/processor_grok/GrokProcessorPatternsRequest.ts#L22-L31', 'ingest.processor_grok.Response': 'ingest/processor_grok/GrokProcessorPatternsResponse.ts#L22-L24', 'ingest.put_pipeline.Request': 'ingest/put_pipeline/PutPipelineRequest.ts#L25-L77', @@ -1180,7 +1197,7 @@ 'logstash._types.PipelineSettings': 'logstash/_types/Pipeline.ts#L28-L59', 'logstash.delete_pipeline.Request': 'logstash/delete_pipeline/LogstashDeletePipelineRequest.ts#L23-L37', 'logstash.get_pipeline.Request': 'logstash/get_pipeline/LogstashGetPipelineRequest.ts#L23-L37', -'logstash.get_pipeline.Response': 'logstash/get_pipeline/LogstashGetPipelineResponse.ts#L24-L26', +'logstash.get_pipeline.Response': 'logstash/get_pipeline/LogstashGetPipelineResponse.ts#L24-L27', 'logstash.put_pipeline.Request': 'logstash/put_pipeline/LogstashPutPipelineRequest.ts#L24-L39', 'ml._types.AnalysisConfig': 'ml/_types/Analysis.ts#L29-L77', 'ml._types.AnalysisConfigRead': 'ml/_types/Analysis.ts#L79-L148', @@ -1192,19 +1209,19 @@ 'ml._types.CategorizationAnalyzer': 'ml/_types/Analysis.ts#L181-L182', 'ml._types.CategorizationAnalyzerDefinition': 'ml/_types/Analysis.ts#L184-L197', 'ml._types.CategorizationStatus': 'ml/_types/Model.ts#L83-L86', -'ml._types.ChunkingConfig': 'ml/_types/Datafeed.ts#L239-L252', -'ml._types.ChunkingMode': 'ml/_types/Datafeed.ts#L233-L237', +'ml._types.ChunkingConfig': 'ml/_types/Datafeed.ts#L238-L251', +'ml._types.ChunkingMode': 'ml/_types/Datafeed.ts#L232-L236', 'ml._types.ClassificationInferenceOptions': 'ml/_types/inference.ts#L93-L108', 'ml._types.ConditionOperator': 'ml/_types/Rule.ts#L74-L79', 'ml._types.DataCounts': 'ml/_types/Job.ts#L352-L372', 'ml._types.DataDescription': 'ml/_types/Job.ts#L374-L390', -'ml._types.Datafeed': 'ml/_types/Datafeed.ts#L37-L58', +'ml._types.Datafeed': 'ml/_types/Datafeed.ts#L36-L57', 'ml._types.DatafeedAuthorization': 'ml/_types/Authorization.ts#L31-L43', -'ml._types.DatafeedConfig': 'ml/_types/Datafeed.ts#L60-L117', -'ml._types.DatafeedRunningState': 'ml/_types/Datafeed.ts#L198-L212', -'ml._types.DatafeedState': 'ml/_types/Datafeed.ts#L133-L138', -'ml._types.DatafeedStats': 'ml/_types/Datafeed.ts#L140-L169', -'ml._types.DatafeedTimingStats': 'ml/_types/Datafeed.ts#L171-L196', +'ml._types.DatafeedConfig': 'ml/_types/Datafeed.ts#L59-L116', +'ml._types.DatafeedRunningState': 'ml/_types/Datafeed.ts#L197-L211', +'ml._types.DatafeedState': 'ml/_types/Datafeed.ts#L132-L137', +'ml._types.DatafeedStats': 'ml/_types/Datafeed.ts#L139-L168', +'ml._types.DatafeedTimingStats': 'ml/_types/Datafeed.ts#L170-L195', 'ml._types.DataframeAnalysis': 'ml/_types/DataframeAnalytics.ts#L134-L213', 'ml._types.DataframeAnalysisAnalyzedFields': 'ml/_types/DataframeAnalytics.ts#L238-L244', 'ml._types.DataframeAnalysisClassification': 'ml/_types/DataframeAnalytics.ts#L227-L236', @@ -1240,7 +1257,7 @@ 'ml._types.DataframeEvaluationRegressionMetricsHuber': 'ml/_types/DataframeEvaluation.ts#L117-L120', 'ml._types.DataframeEvaluationRegressionMetricsMsle': 'ml/_types/DataframeEvaluation.ts#L112-L115', 'ml._types.DataframeState': 'ml/_types/Dataframe.ts#L20-L26', -'ml._types.DelayedDataCheckConfig': 'ml/_types/Datafeed.ts#L119-L130', +'ml._types.DelayedDataCheckConfig': 'ml/_types/Datafeed.ts#L118-L129', 'ml._types.DeploymentAllocationState': 'ml/_types/TrainedModel.ts#L289-L302', 'ml._types.DeploymentAssignmentState': 'ml/_types/TrainedModel.ts#L304-L309', 'ml._types.DeploymentState': 'ml/_types/TrainedModel.ts#L274-L287', @@ -1289,7 +1306,7 @@ 'ml._types.RoutingState': 'ml/_types/TrainedModel.ts#L351-L372', 'ml._types.RuleAction': 'ml/_types/Rule.ts#L41-L50', 'ml._types.RuleCondition': 'ml/_types/Rule.ts#L52-L65', -'ml._types.RunningStateSearchInterval': 'ml/_types/Datafeed.ts#L214-L231', +'ml._types.RunningStateSearchInterval': 'ml/_types/Datafeed.ts#L213-L230', 'ml._types.TextClassificationInferenceOptions': 'ml/_types/inference.ts#L189-L199', 'ml._types.TextClassificationInferenceUpdateOptions': 'ml/_types/inference.ts#L363-L372', 'ml._types.TextEmbeddingInferenceOptions': 'ml/_types/inference.ts#L237-L245', @@ -1389,7 +1406,7 @@ 'ml.get_jobs.Response': 'ml/get_jobs/MlGetJobsResponse.ts#L23-L28', 'ml.get_overall_buckets.Request': 'ml/get_overall_buckets/MlGetOverallBucketsRequest.ts#L25-L143', 'ml.get_overall_buckets.Response': 'ml/get_overall_buckets/MlGetOverallBucketsResponse.ts#L23-L29', -'ml.get_trained_models.Request': 'ml/get_trained_models/MlGetTrainedModelRequest.ts#L25-L87', +'ml.get_trained_models.Request': 'ml/get_trained_models/MlGetTrainedModelRequest.ts#L25-L91', 'ml.get_trained_models.Response': 'ml/get_trained_models/MlGetTrainedModelResponse.ts#L23-L34', 'ml.get_trained_models_stats.Request': 'ml/get_trained_models_stats/MlGetTrainedModelStatsRequest.ts#L24-L64', 'ml.get_trained_models_stats.Response': 'ml/get_trained_models_stats/MlGetTrainedModelStatsResponse.ts#L23-L33', @@ -1403,7 +1420,7 @@ 'ml.preview_data_frame_analytics.Request': 'ml/preview_data_frame_analytics/MlPreviewDataFrameAnalyticsRequest.ts#L24-L47', 'ml.preview_data_frame_analytics.Response': 'ml/preview_data_frame_analytics/MlPreviewDataFrameAnalyticsResponse.ts#L23-L28', 'ml.preview_datafeed.Request': 'ml/preview_datafeed/MlPreviewDatafeedRequest.ts#L26-L69', -'ml.preview_datafeed.Response': 'ml/preview_datafeed/MlPreviewDatafeedResponse.ts#L20-L22', +'ml.preview_datafeed.Response': 'ml/preview_datafeed/MlPreviewDatafeedResponse.ts#L20-L23', 'ml.put_calendar.Request': 'ml/put_calendar/MlPutCalendarRequest.ts#L23-L43', 'ml.put_calendar.Response': 'ml/put_calendar/MlPutCalendarResponse.ts#L22-L31', 'ml.put_calendar_job.Request': 'ml/put_calendar_job/MlPutCalendarJobRequest.ts#L23-L37', @@ -1423,7 +1440,7 @@ 'ml.put_trained_model.Input': 'ml/put_trained_model/types.ts#L56-L58', 'ml.put_trained_model.OneHotEncodingPreprocessor': 'ml/put_trained_model/types.ts#L44-L47', 'ml.put_trained_model.Preprocessor': 'ml/put_trained_model/types.ts#L31-L36', -'ml.put_trained_model.Request': 'ml/put_trained_model/MlPutTrainedModelRequest.ts#L28-L106', +'ml.put_trained_model.Request': 'ml/put_trained_model/MlPutTrainedModelRequest.ts#L29-L124', 'ml.put_trained_model.Response': 'ml/put_trained_model/MlPutTrainedModelResponse.ts#L22-L24', 'ml.put_trained_model.TargetMeanEncodingPreprocessor': 'ml/put_trained_model/types.ts#L49-L54', 'ml.put_trained_model.TrainedModel': 'ml/put_trained_model/types.ts#L60-L72', @@ -1458,6 +1475,8 @@ 'ml.update_filter.Response': 'ml/update_filter/MlUpdateFilterResponse.ts#L22-L28', 'ml.update_job.Request': 'ml/update_job/MlUpdateJobRequest.ts#L33-L138', 'ml.update_job.Response': 'ml/update_job/MlUpdateJobResponse.ts#L29-L53', +'ml.update_trained_model_deployment.Request': 'ml/update_trained_model_deployment/MlUpdateTrainedModelDeploymentRequest.ts#L24-L62', +'ml.update_trained_model_deployment.Response': 'ml/update_trained_model_deployment/MlUpdateTrainedModelDeploymentResponse.ts#L22-L26', 'nodes._types.Client': 'nodes/_types/Stats.ts#L649-L696', 'nodes._types.Context': 'nodes/_types/Stats.ts#L997-L1002', 'nodes._types.Http': 'nodes/_types/Stats.ts#L633-L647', @@ -1467,17 +1486,23 @@ 'nodes._types.Processor': 'nodes/_types/Stats.ts#L384-L401', 'nodes._types.Scripting': 'nodes/_types/Stats.ts#L977-L995', 'nodes._types.ThreadCount': 'nodes/_types/Stats.ts#L1004-L1029', +'query_rule.delete.Request': 'query_rule/delete/QueryRuleDeleteRequest.ts#L22-L40', +'query_rule.delete.Response': 'query_rule/delete/QueryRuleDeleteResponse.ts#L22-L24', +'query_rule.get.Request': 'query_rule/get/QueryRuleGetRequest.ts#L22-L40', +'query_rule.get.Response': 'query_rule/get/QueryRuleGetResponse.ts#L22-L24', +'query_rule.put.Request': 'query_rule/put/QueryRulePutRequest.ts#L27-L54', +'query_rule.put.Response': 'query_rule/put/QueryRulePutResponse.ts#L22-L26', 'query_ruleset._types.QueryRule': 'query_ruleset/_types/QueryRuleset.ts#L37-L42', -'query_ruleset._types.QueryRuleActions': 'query_ruleset/_types/QueryRuleset.ts#L67-L70', +'query_ruleset._types.QueryRuleActions': 'query_ruleset/_types/QueryRuleset.ts#L68-L71', 'query_ruleset._types.QueryRuleCriteria': 'query_ruleset/_types/QueryRuleset.ts#L48-L52', -'query_ruleset._types.QueryRuleCriteriaType': 'query_ruleset/_types/QueryRuleset.ts#L54-L65', +'query_ruleset._types.QueryRuleCriteriaType': 'query_ruleset/_types/QueryRuleset.ts#L54-L66', 'query_ruleset._types.QueryRuleType': 'query_ruleset/_types/QueryRuleset.ts#L44-L46', 'query_ruleset._types.QueryRuleset': 'query_ruleset/_types/QueryRuleset.ts#L26-L35', 'query_ruleset.delete.Request': 'query_ruleset/delete/QueryRulesetDeleteRequest.ts#L22-L35', 'query_ruleset.delete.Response': 'query_ruleset/delete/QueryRulesetDeleteResponse.ts#L22-L24', 'query_ruleset.get.Request': 'query_ruleset/get/QueryRulesetGetRequest.ts#L22-L35', 'query_ruleset.get.Response': 'query_ruleset/get/QueryRulesetGetResponse.ts#L22-L24', -'query_ruleset.list.QueryRulesetListItem': 'query_ruleset/list/types.ts#L22-L31', +'query_ruleset.list.QueryRulesetListItem': 'query_ruleset/list/types.ts#L23-L37', 'query_ruleset.list.Request': 'query_ruleset/list/QueryRulesetListRequest.ts#L22-L39', 'query_ruleset.list.Response': 'query_ruleset/list/QueryRulesetListResponse.ts#L23-L28', 'query_ruleset.put.Request': 'query_ruleset/put/QueryRulesetPutRequest.ts#L23-L43', @@ -1493,7 +1518,7 @@ 'search_application.get.Request': 'search_application/get/SearchApplicationsGetRequest.ts#L22-L35', 'search_application.get.Response': 'search_application/get/SearchApplicationsGetResponse.ts#L22-L24', 'search_application.get_behavioral_analytics.Request': 'search_application/get_behavioral_analytics/BehavioralAnalyticsGetRequest.ts#L22-L35', -'search_application.get_behavioral_analytics.Response': 'search_application/get_behavioral_analytics/BehavioralAnalyticsGetResponse.ts#L24-L26', +'search_application.get_behavioral_analytics.Response': 'search_application/get_behavioral_analytics/BehavioralAnalyticsGetResponse.ts#L24-L27', 'search_application.list.Request': 'search_application/list/SearchApplicationsListRequest.ts#L22-L44', 'search_application.list.Response': 'search_application/list/SearchApplicationsListResponse.ts#L24-L29', 'search_application.list.SearchApplicationListItem': 'search_application/list/SearchApplicationsListResponse.ts#L31-L48', @@ -1502,28 +1527,28 @@ 'search_application.put_behavioral_analytics.AnalyticsAcknowledgeResponseBase': 'search_application/put_behavioral_analytics/BehavioralAnalyticsPutResponse.ts#L28-L33', 'search_application.put_behavioral_analytics.Request': 'search_application/put_behavioral_analytics/BehavioralAnalyticsPutRequest.ts#L22-L35', 'search_application.put_behavioral_analytics.Response': 'search_application/put_behavioral_analytics/BehavioralAnalyticsPutResponse.ts#L24-L26', -'search_application.search.Request': 'search_application/search/SearchApplicationsSearchRequest.ts#L24-L43', +'search_application.search.Request': 'search_application/search/SearchApplicationsSearchRequest.ts#L24-L52', 'search_application.search.Response': 'search_application/search/SearchApplicationsSearchResponse.ts#L23-L25', -'security._types.ApiKey': 'security/_types/ApiKey.ts#L27-L77', -'security._types.ApplicationGlobalUserPrivileges': 'security/_types/Privileges.ts#L193-L195', +'security._types.ApiKey': 'security/_types/ApiKey.ts#L27-L89', +'security._types.ApplicationGlobalUserPrivileges': 'security/_types/Privileges.ts#L333-L335', 'security._types.ApplicationPrivileges': 'security/_types/Privileges.ts#L26-L39', -'security._types.ClusterPrivilege': 'security/_types/Privileges.ts#L41-L80', +'security._types.ClusterPrivilege': 'security/_types/Privileges.ts#L41-L198', 'security._types.FieldSecurity': 'security/_types/FieldSecurity.ts#L22-L25', -'security._types.GlobalPrivilege': 'security/_types/Privileges.ts#L189-L191', -'security._types.IndexPrivilege': 'security/_types/Privileges.ts#L166-L187', -'security._types.IndicesPrivileges': 'security/_types/Privileges.ts#L82-L105', -'security._types.ManageUserPrivileges': 'security/_types/Privileges.ts#L197-L199', +'security._types.GlobalPrivilege': 'security/_types/Privileges.ts#L329-L331', +'security._types.IndexPrivilege': 'security/_types/Privileges.ts#L285-L327', +'security._types.IndicesPrivileges': 'security/_types/Privileges.ts#L200-L224', +'security._types.ManageUserPrivileges': 'security/_types/Privileges.ts#L337-L339', 'security._types.RealmInfo': 'security/_types/RealmInfo.ts#L22-L25', 'security._types.RoleDescriptor': 'security/_types/RoleDescriptor.ts#L28-L56', -'security._types.RoleTemplateInlineQuery': 'security/_types/Privileges.ts#L160-L161', -'security._types.RoleTemplateInlineScript': 'security/_types/Privileges.ts#L153-L158', -'security._types.RoleTemplateScript': 'security/_types/Privileges.ts#L163-L164', +'security._types.RoleTemplateInlineQuery': 'security/_types/Privileges.ts#L279-L280', +'security._types.RoleTemplateInlineScript': 'security/_types/Privileges.ts#L272-L277', +'security._types.RoleTemplateScript': 'security/_types/Privileges.ts#L282-L283', 'security.authenticate.Request': 'security/authenticate/SecurityAuthenticateRequest.ts#L22-L30', 'security.authenticate.Response': 'security/authenticate/SecurityAuthenticateResponse.ts#L25-L43', 'security.authenticate.Token': 'security/authenticate/types.ts#L22-L29', 'security.create_api_key.Request': 'security/create_api_key/SecurityCreateApiKeyRequest.ts#L26-L58', 'security.create_api_key.Response': 'security/create_api_key/SecurityCreateApiKeyResponse.ts#L23-L50', -'security.get_api_key.Request': 'security/get_api_key/SecurityGetApiKeyRequest.ts#L23-L79', +'security.get_api_key.Request': 'security/get_api_key/SecurityGetApiKeyRequest.ts#L23-L86', 'security.get_api_key.Response': 'security/get_api_key/SecurityGetApiKeyResponse.ts#L22-L24', 'security.has_privileges.ApplicationPrivilegesCheck': 'security/has_privileges/types.ts#L24-L31', 'security.has_privileges.IndexPrivilegesCheck': 'security/has_privileges/types.ts#L33-L44', @@ -1531,8 +1556,12 @@ 'security.has_privileges.Response': 'security/has_privileges/SecurityHasPrivilegesResponse.ts#L24-L32', 'security.invalidate_api_key.Request': 'security/invalidate_api_key/SecurityInvalidateApiKeyRequest.ts#L23-L66', 'security.invalidate_api_key.Response': 'security/invalidate_api_key/SecurityInvalidateApiKeyResponse.ts#L23-L30', -'security.query_api_keys.Request': 'security/query_api_keys/QueryApiKeysRequest.ts#L25-L74', -'security.query_api_keys.Response': 'security/query_api_keys/QueryApiKeysResponse.ts#L23-L38', +'security.query_api_keys.ApiKeyAggregate': 'security/query_api_keys/types.ts#L123-L140', +'security.query_api_keys.ApiKeyAggregationContainer': 'security/query_api_keys/types.ts#L64-L121', +'security.query_api_keys.ApiKeyFiltersAggregation': 'security/query_api_keys/types.ts#L208-L228', +'security.query_api_keys.ApiKeyQueryContainer': 'security/query_api_keys/types.ts#L142-L206', +'security.query_api_keys.Request': 'security/query_api_keys/QueryApiKeysRequest.ts#L26-L99', +'security.query_api_keys.Response': 'security/query_api_keys/QueryApiKeysResponse.ts#L26-L45', 'security.update_api_key.Request': 'security/update_api_key/Request.ts#L26-L65', 'security.update_api_key.Response': 'security/update_api_key/Response.ts#L20-L28', 'sql.Column': 'sql/types.ts#L23-L26', @@ -1563,7 +1592,7 @@ 'synonyms.get_synonyms_sets.Response': 'synonyms/get_synonyms_sets/SynonymsSetsGetResponse.ts#L23-L28', 'synonyms.get_synonyms_sets.SynonymsSetItem': 'synonyms/get_synonyms_sets/SynonymsSetsGetResponse.ts#L30-L39', 'synonyms.put_synonym.Request': 'synonyms/put_synonym/SynonymsPutRequest.ts#L23-L42', -'synonyms.put_synonym.Response': 'synonyms/put_synonym/SynonymsPutResponse.ts#L24-L29', +'synonyms.put_synonym.Response': 'synonyms/put_synonym/SynonymsPutResponse.ts#L23-L28', 'synonyms.put_synonym_rule.Request': 'synonyms/put_synonym_rule/SynonymRulePutRequest.ts#L23-L47', 'synonyms.put_synonym_rule.Response': 'synonyms/put_synonym_rule/SynonymRulePutResponse.ts#L22-L24', 'tasks._types.TaskInfo': 'tasks/_types/TaskInfo.ts#L32-L47', @@ -1612,10 +1641,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/0a63a19b96834d9bcaad0738cb0c6850dd326d20/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/21b532fe17fbe3d4dbcd224a54dd8c5e3670d56c/specification/" + (paths[hash] || ""); - Please see the Elasticsearch API specification. + Please see the Elasticsearch API specification. diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichAsyncClient.java index 905edb9c1..93027966e 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichAsyncClient.java @@ -104,7 +104,7 @@ public final CompletableFuture deletePolicy( * Creates the enrich index for an existing enrich policy. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/execute-enrich-policy-api.html">Documentation * on elastic.co */ @@ -122,7 +122,7 @@ public CompletableFuture executePolicy(ExecutePolicyReque * a function that initializes a builder to create the * {@link ExecutePolicyRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/execute-enrich-policy-api.html">Documentation * on elastic.co */ @@ -134,7 +134,7 @@ public final CompletableFuture executePolicy( // ----- Endpoint: enrich.get_policy /** - * Gets information about an enrich policy. + * Returns information about an enrich policy. * * @see Documentation @@ -149,7 +149,7 @@ public CompletableFuture getPolicy(GetPolicyRequest request) } /** - * Gets information about an enrich policy. + * Returns information about an enrich policy. * * @param fn * a function that initializes a builder to create the @@ -165,7 +165,7 @@ public final CompletableFuture getPolicy( } /** - * Gets information about an enrich policy. + * Returns information about an enrich policy. * * @see Documentation @@ -180,10 +180,10 @@ public CompletableFuture getPolicy() { // ----- Endpoint: enrich.put_policy /** - * Creates a new enrich policy. + * Creates an enrich policy. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/put-enrich-policy-api.html">Documentation * on elastic.co */ @@ -195,13 +195,13 @@ public CompletableFuture putPolicy(PutPolicyRequest request) } /** - * Creates a new enrich policy. + * Creates an enrich policy. * * @param fn * a function that initializes a builder to create the * {@link PutPolicyRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/put-enrich-policy-api.html">Documentation * on elastic.co */ @@ -213,8 +213,8 @@ public final CompletableFuture putPolicy( // ----- Endpoint: enrich.stats /** - * Gets enrich coordinator statistics and information about enrich policies that - * are currently executing. + * Returns enrich coordinator statistics and information about enrich policies + * that are currently executing. * * @see Documentation diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichClient.java index b82240929..f0780f16a 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichClient.java @@ -105,7 +105,7 @@ public final DeletePolicyResponse deletePolicy( * Creates the enrich index for an existing enrich policy. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/execute-enrich-policy-api.html">Documentation * on elastic.co */ @@ -124,7 +124,7 @@ public ExecutePolicyResponse executePolicy(ExecutePolicyRequest request) * a function that initializes a builder to create the * {@link ExecutePolicyRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/execute-enrich-policy-api.html">Documentation * on elastic.co */ @@ -137,7 +137,7 @@ public final ExecutePolicyResponse executePolicy( // ----- Endpoint: enrich.get_policy /** - * Gets information about an enrich policy. + * Returns information about an enrich policy. * * @see Documentation @@ -152,7 +152,7 @@ public GetPolicyResponse getPolicy(GetPolicyRequest request) throws IOException, } /** - * Gets information about an enrich policy. + * Returns information about an enrich policy. * * @param fn * a function that initializes a builder to create the @@ -168,7 +168,7 @@ public final GetPolicyResponse getPolicy(FunctionDocumentation @@ -183,10 +183,10 @@ public GetPolicyResponse getPolicy() throws IOException, ElasticsearchException // ----- Endpoint: enrich.put_policy /** - * Creates a new enrich policy. + * Creates an enrich policy. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/put-enrich-policy-api.html">Documentation * on elastic.co */ @@ -198,13 +198,13 @@ public PutPolicyResponse putPolicy(PutPolicyRequest request) throws IOException, } /** - * Creates a new enrich policy. + * Creates an enrich policy. * * @param fn * a function that initializes a builder to create the * {@link PutPolicyRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/put-enrich-policy-api.html">Documentation * on elastic.co */ @@ -216,8 +216,8 @@ public final PutPolicyResponse putPolicy(FunctionDocumentation diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/ElasticsearchEqlAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/ElasticsearchEqlAsyncClient.java index 0a561f27b..9af457c16 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/ElasticsearchEqlAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/ElasticsearchEqlAsyncClient.java @@ -69,8 +69,8 @@ public ElasticsearchEqlAsyncClient withTransportOptions(@Nullable TransportOptio // ----- Endpoint: eql.delete /** - * Deletes an async EQL search by ID. If the search is still running, the search - * request will be cancelled. Otherwise, the saved search results are deleted. + * Deletes an async EQL search or a stored synchronous EQL search. The API also + * deletes results for the search. * * @see Documentation @@ -85,8 +85,8 @@ public CompletableFuture delete(EqlDeleteRequest request) { } /** - * Deletes an async EQL search by ID. If the search is still running, the search - * request will be cancelled. Otherwise, the saved search results are deleted. + * Deletes an async EQL search or a stored synchronous EQL search. The API also + * deletes results for the search. * * @param fn * a function that initializes a builder to create the @@ -104,32 +104,32 @@ public final CompletableFuture delete( // ----- Endpoint: eql.get /** - * Returns async results from previously executed Event Query Language (EQL) - * search + * Returns the current status and available results for an async EQL search or a + * stored synchronous EQL search. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/get-async-eql-search-api.html">Documentation * on elastic.co */ public CompletableFuture> get(EqlGetRequest request, Class tEventClass) { @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlGetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, "co.elastic.clients:Deserializer:eql.get.TEvent", - getDeserializer(tEventClass)); + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:eql.get.Response.TEvent", getDeserializer(tEventClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Returns async results from previously executed Event Query Language (EQL) - * search + * Returns the current status and available results for an async EQL search or a + * stored synchronous EQL search. * * @param fn * a function that initializes a builder to create the * {@link EqlGetRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/get-async-eql-search-api.html">Documentation * on elastic.co */ @@ -139,32 +139,32 @@ public final CompletableFuture> get( } /** - * Returns async results from previously executed Event Query Language (EQL) - * search + * Returns the current status and available results for an async EQL search or a + * stored synchronous EQL search. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/get-async-eql-search-api.html">Documentation * on elastic.co */ public CompletableFuture> get(EqlGetRequest request, Type tEventType) { @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlGetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, "co.elastic.clients:Deserializer:eql.get.TEvent", - getDeserializer(tEventType)); + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:eql.get.Response.TEvent", getDeserializer(tEventType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Returns async results from previously executed Event Query Language (EQL) - * search + * Returns the current status and available results for an async EQL search or a + * stored synchronous EQL search. * * @param fn * a function that initializes a builder to create the * {@link EqlGetRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/get-async-eql-search-api.html">Documentation * on elastic.co */ @@ -176,11 +176,11 @@ public final CompletableFuture> get( // ----- Endpoint: eql.get_status /** - * Returns the status of a previously submitted async or stored Event Query - * Language (EQL) search + * Returns the current status for an async EQL search or a stored synchronous + * EQL search without returning results. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/get-async-eql-status-api.html">Documentation * on elastic.co */ @@ -192,14 +192,14 @@ public CompletableFuture getStatus(GetEqlStatusRequest req } /** - * Returns the status of a previously submitted async or stored Event Query - * Language (EQL) search + * Returns the current status for an async EQL search or a stored synchronous + * EQL search without returning results. * * @param fn * a function that initializes a builder to create the * {@link GetEqlStatusRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/get-async-eql-status-api.html">Documentation * on elastic.co */ @@ -222,8 +222,8 @@ public CompletableFuture> search(EqlSearchReq Class tEventClass) { @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlSearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, "co.elastic.clients:Deserializer:eql.search.TEvent", - getDeserializer(tEventClass)); + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:eql.search.Response.TEvent", getDeserializer(tEventClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } @@ -255,8 +255,8 @@ public final CompletableFuture> search( public CompletableFuture> search(EqlSearchRequest request, Type tEventType) { @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlSearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, "co.elastic.clients:Deserializer:eql.search.TEvent", - getDeserializer(tEventType)); + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:eql.search.Response.TEvent", getDeserializer(tEventType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/ElasticsearchEqlClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/ElasticsearchEqlClient.java index 08061f61f..5de6aa5b6 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/ElasticsearchEqlClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/ElasticsearchEqlClient.java @@ -70,8 +70,8 @@ public ElasticsearchEqlClient withTransportOptions(@Nullable TransportOptions tr // ----- Endpoint: eql.delete /** - * Deletes an async EQL search by ID. If the search is still running, the search - * request will be cancelled. Otherwise, the saved search results are deleted. + * Deletes an async EQL search or a stored synchronous EQL search. The API also + * deletes results for the search. * * @see Documentation @@ -86,8 +86,8 @@ public EqlDeleteResponse delete(EqlDeleteRequest request) throws IOException, El } /** - * Deletes an async EQL search by ID. If the search is still running, the search - * request will be cancelled. Otherwise, the saved search results are deleted. + * Deletes an async EQL search or a stored synchronous EQL search. The API also + * deletes results for the search. * * @param fn * a function that initializes a builder to create the @@ -105,11 +105,11 @@ public final EqlDeleteResponse delete(FunctionDocumentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/get-async-eql-search-api.html">Documentation * on elastic.co */ @@ -117,21 +117,21 @@ public EqlGetResponse get(EqlGetRequest request, Class throws IOException, ElasticsearchException { @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlGetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, "co.elastic.clients:Deserializer:eql.get.TEvent", - getDeserializer(tEventClass)); + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:eql.get.Response.TEvent", getDeserializer(tEventClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Returns async results from previously executed Event Query Language (EQL) - * search + * Returns the current status and available results for an async EQL search or a + * stored synchronous EQL search. * * @param fn * a function that initializes a builder to create the * {@link EqlGetRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/get-async-eql-search-api.html">Documentation * on elastic.co */ @@ -141,11 +141,11 @@ public final EqlGetResponse get(FunctionDocumentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/get-async-eql-search-api.html">Documentation * on elastic.co */ @@ -153,21 +153,21 @@ public EqlGetResponse get(EqlGetRequest request, Type tEventTyp throws IOException, ElasticsearchException { @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlGetRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, "co.elastic.clients:Deserializer:eql.get.TEvent", - getDeserializer(tEventType)); + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:eql.get.Response.TEvent", getDeserializer(tEventType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Returns async results from previously executed Event Query Language (EQL) - * search + * Returns the current status and available results for an async EQL search or a + * stored synchronous EQL search. * * @param fn * a function that initializes a builder to create the * {@link EqlGetRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/get-async-eql-search-api.html">Documentation * on elastic.co */ @@ -179,11 +179,11 @@ public final EqlGetResponse get(FunctionDocumentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/get-async-eql-status-api.html">Documentation * on elastic.co */ @@ -195,14 +195,14 @@ public GetEqlStatusResponse getStatus(GetEqlStatusRequest request) throws IOExce } /** - * Returns the status of a previously submitted async or stored Event Query - * Language (EQL) search + * Returns the current status for an async EQL search or a stored synchronous + * EQL search without returning results. * * @param fn * a function that initializes a builder to create the * {@link GetEqlStatusRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/get-async-eql-status-api.html">Documentation * on elastic.co */ @@ -226,8 +226,8 @@ public EqlSearchResponse search(EqlSearchRequest request, Class throws IOException, ElasticsearchException { @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlSearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, "co.elastic.clients:Deserializer:eql.search.TEvent", - getDeserializer(tEventClass)); + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:eql.search.Response.TEvent", getDeserializer(tEventClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } @@ -261,8 +261,8 @@ public EqlSearchResponse search(EqlSearchRequest request, Type throws IOException, ElasticsearchException { @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) EqlSearchRequest._ENDPOINT; - endpoint = new EndpointWithResponseMapperAttr<>(endpoint, "co.elastic.clients:Deserializer:eql.search.TEvent", - getDeserializer(tEventType)); + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:eql.search.Response.TEvent", getDeserializer(tEventType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlGetResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlGetResponse.java index 2dbca78e1..e06025629 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlGetResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlGetResponse.java @@ -110,7 +110,7 @@ public static JsonpDeserializer> createEqlGetRes */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createEqlGetResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:eql.get.TEvent"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:eql.get.Response.TEvent"))); protected static void setupEqlGetResponseDeserializer( ObjectDeserializer> op, JsonpDeserializer tEventDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlHits.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlHits.java index d206b8365..b1731fb74 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlHits.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlHits.java @@ -323,7 +323,7 @@ public static JsonpDeserializer> createEqlHitsDeseriali */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createEqlHitsDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:eql._types.TEvent"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:eql._types.EqlHits.TEvent"))); protected static void setupEqlHitsDeserializer(ObjectDeserializer> op, JsonpDeserializer tEventDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchResponse.java index 48fbe74d6..0ad7f4b8d 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/EqlSearchResponse.java @@ -110,7 +110,7 @@ public static JsonpDeserializer> createEqlSea */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createEqlSearchResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:eql.search.TEvent"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:eql.search.Response.TEvent"))); protected static void setupEqlSearchResponseDeserializer( ObjectDeserializer> op, JsonpDeserializer tEventDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/HitsEvent.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/HitsEvent.java index 5c35e261e..e71f4302a 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/HitsEvent.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/HitsEvent.java @@ -289,7 +289,7 @@ public static JsonpDeserializer> createHitsEventDeser */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createHitsEventDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:eql._types.TEvent"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:eql._types.HitsEvent.TEvent"))); protected static void setupHitsEventDeserializer(ObjectDeserializer> op, JsonpDeserializer tEventDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/HitsSequence.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/HitsSequence.java index d5b5a3a5c..9dada98f8 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/HitsSequence.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/eql/HitsSequence.java @@ -267,7 +267,7 @@ public static JsonpDeserializer> createHitsSequenc */ public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer .lazy(() -> createHitsSequenceDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:eql._types.TEvent"))); + new NamedDeserializer<>("co.elastic.clients:Deserializer:eql._types.HitsSequence.TEvent"))); protected static void setupHitsSequenceDeserializer(ObjectDeserializer> op, JsonpDeserializer tEventDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/ElasticsearchEsqlAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/ElasticsearchEsqlAsyncClient.java new file mode 100644 index 000000000..dac958485 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/ElasticsearchEsqlAsyncClient.java @@ -0,0 +1,142 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.esql; + +import co.elastic.clients.ApiClient; +import co.elastic.clients.elasticsearch._helpers.esql.EsqlAdapter; +import co.elastic.clients.elasticsearch._helpers.esql.EsqlHelper; +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.transport.ElasticsearchTransport; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.JsonEndpoint; +import co.elastic.clients.transport.Transport; +import co.elastic.clients.transport.TransportOptions; +import co.elastic.clients.transport.endpoints.BinaryResponse; +import co.elastic.clients.util.ObjectBuilder; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Client for the esql namespace. + */ +public class ElasticsearchEsqlAsyncClient extends ApiClient { + + public ElasticsearchEsqlAsyncClient(ElasticsearchTransport transport) { + super(transport, null); + } + + public ElasticsearchEsqlAsyncClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + @Override + public ElasticsearchEsqlAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) { + return new ElasticsearchEsqlAsyncClient(this.transport, transportOptions); + } + + // ----- Endpoint: esql.query + + /** + * Executes an ES|QL request + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture query(QueryRequest request) { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) QueryRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Executes an ES|QL request + * + * @param fn + * a function that initializes a builder to create the + * {@link QueryRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture query( + Function> fn) { + return query(fn.apply(new QueryRequest.Builder()).build()); + } + + /** + * Executes an ES|QL request and adapts its result to a target type. + * + * @param adapter + * the ES|QL response adapter + * @param query + * the ES|QL query + * @param parameters + * values for query parameters, if any + */ + public final CompletableFuture query(EsqlAdapter adapter, String query, Object... parameters) { + return EsqlHelper.queryAsync(this, adapter, query, parameters); + } + + /** + * Executes an ES|QL request and adapts its result to a target type. + * + * @param adapter + * the ES|QL response adapter + * @param request + * the ES|QL request + */ + public final CompletableFuture query(EsqlAdapter adapter, QueryRequest request) { + return EsqlHelper.queryAsync(this, adapter, request); + } + + /** + * Executes an ES|QL request and adapts its result to a target type. + * + * @param adapter + * the ES|QL response adapter + * @param fn + * the ES|QL request builder + */ + public final CompletableFuture query(EsqlAdapter adapter, + Function> fn) { + return EsqlHelper.queryAsync(this, adapter, fn.apply(new QueryRequest.Builder()).build()); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/ElasticsearchEsqlClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/ElasticsearchEsqlClient.java new file mode 100644 index 000000000..434231f81 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/ElasticsearchEsqlClient.java @@ -0,0 +1,144 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.esql; + +import co.elastic.clients.ApiClient; +import co.elastic.clients.elasticsearch._helpers.esql.EsqlAdapter; +import co.elastic.clients.elasticsearch._helpers.esql.EsqlHelper; +import co.elastic.clients.elasticsearch._types.ElasticsearchException; +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.transport.ElasticsearchTransport; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.JsonEndpoint; +import co.elastic.clients.transport.Transport; +import co.elastic.clients.transport.TransportOptions; +import co.elastic.clients.transport.endpoints.BinaryResponse; +import co.elastic.clients.util.ObjectBuilder; +import java.io.IOException; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Client for the esql namespace. + */ +public class ElasticsearchEsqlClient extends ApiClient { + + public ElasticsearchEsqlClient(ElasticsearchTransport transport) { + super(transport, null); + } + + public ElasticsearchEsqlClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + @Override + public ElasticsearchEsqlClient withTransportOptions(@Nullable TransportOptions transportOptions) { + return new ElasticsearchEsqlClient(this.transport, transportOptions); + } + + // ----- Endpoint: esql.query + + /** + * Executes an ES|QL request + * + * @see Documentation + * on elastic.co + */ + + public BinaryResponse query(QueryRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) QueryRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Executes an ES|QL request + * + * @param fn + * a function that initializes a builder to create the + * {@link QueryRequest} + * @see Documentation + * on elastic.co + */ + + public final BinaryResponse query(Function> fn) + throws IOException, ElasticsearchException { + return query(fn.apply(new QueryRequest.Builder()).build()); + } + + /** + * Executes an ES|QL request and adapts its result to a target type. + * + * @param adapter + * the ES|QL response adapter + * @param query + * the ES|QL query + * @param parameters + * values for query parameters, if any + */ + public final T query(EsqlAdapter adapter, String query, Object... parameters) + throws IOException, ElasticsearchException { + return EsqlHelper.query(this, adapter, query, parameters); + } + + /** + * Executes an ES|QL request and adapts its result to a target type. + * + * @param adapter + * the ES|QL response adapter + * @param request + * the ES|QL request + */ + public final T query(EsqlAdapter adapter, QueryRequest request) throws IOException, ElasticsearchException { + return EsqlHelper.query(this, adapter, request); + } + + /** + * Executes an ES|QL request and adapts its result to a target type. + * + * @param adapter + * the ES|QL response adapter + * @param fn + * the ES|QL request builder + */ + public final T query(EsqlAdapter adapter, Function> fn) + throws IOException, ElasticsearchException { + return query(adapter, fn.apply(new QueryRequest.Builder()).build()); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/QueryRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/QueryRequest.java new file mode 100644 index 000000000..68f52f6ae --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/esql/QueryRequest.java @@ -0,0 +1,441 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.esql; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.FieldValue; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.endpoints.BinaryEndpoint; +import co.elastic.clients.transport.endpoints.BinaryResponse; +import co.elastic.clients.transport.endpoints.SimpleEndpoint; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.String; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: esql.query.Request + +/** + * Executes an ES|QL request + * + * @see API + * specification + */ +@JsonpDeserializable +public class QueryRequest extends RequestBase implements JsonpSerializable { + @Nullable + private final Boolean columnar; + + @Nullable + private final String delimiter; + + @Nullable + private final Query filter; + + @Nullable + private final String format; + + @Nullable + private final String locale; + + private final List params; + + private final String query; + + // --------------------------------------------------------------------------------------------- + + private QueryRequest(Builder builder) { + + this.columnar = builder.columnar; + this.delimiter = builder.delimiter; + this.filter = builder.filter; + this.format = builder.format; + this.locale = builder.locale; + this.params = ApiTypeHelper.unmodifiable(builder.params); + this.query = ApiTypeHelper.requireNonNull(builder.query, this, "query"); + + } + + public static QueryRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * By default, ES|QL returns results as rows. For example, FROM returns each + * individual document as one row. For the JSON, YAML, CBOR and smile formats, + * ES|QL can return the results in a columnar fashion where one row represents + * all the values of a certain column in the results. + *

+ * API name: {@code columnar} + */ + @Nullable + public final Boolean columnar() { + return this.columnar; + } + + /** + * The character to use between values within a CSV row. Only valid for the CSV + * format. + *

+ * API name: {@code delimiter} + */ + @Nullable + public final String delimiter() { + return this.delimiter; + } + + /** + * Specify a Query DSL query in the filter parameter to filter the set of + * documents that an ES|QL query runs on. + *

+ * API name: {@code filter} + */ + @Nullable + public final Query filter() { + return this.filter; + } + + /** + * A short version of the Accept header, e.g. json, yaml. + *

+ * API name: {@code format} + */ + @Nullable + public final String format() { + return this.format; + } + + /** + * API name: {@code locale} + */ + @Nullable + public final String locale() { + return this.locale; + } + + /** + * To avoid any attempts of hacking or code injection, extract the values in a + * separate list of parameters. Use question mark placeholders (?) in the query + * string for each of the parameters. + *

+ * API name: {@code params} + */ + public final List params() { + return this.params; + } + + /** + * Required - The ES|QL query API accepts an ES|QL query string in the query + * parameter, runs it, and returns the results. + *

+ * API name: {@code query} + */ + public final String query() { + return this.query; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + if (this.columnar != null) { + generator.writeKey("columnar"); + generator.write(this.columnar); + + } + if (this.filter != null) { + generator.writeKey("filter"); + this.filter.serialize(generator, mapper); + + } + if (this.locale != null) { + generator.writeKey("locale"); + generator.write(this.locale); + + } + if (ApiTypeHelper.isDefined(this.params)) { + generator.writeKey("params"); + generator.writeStartArray(); + for (FieldValue item0 : this.params) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + generator.writeKey("query"); + generator.write(this.query); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link QueryRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private Boolean columnar; + + @Nullable + private String delimiter; + + @Nullable + private Query filter; + + @Nullable + private String format; + + @Nullable + private String locale; + + @Nullable + private List params; + + private String query; + + /** + * By default, ES|QL returns results as rows. For example, FROM returns each + * individual document as one row. For the JSON, YAML, CBOR and smile formats, + * ES|QL can return the results in a columnar fashion where one row represents + * all the values of a certain column in the results. + *

+ * API name: {@code columnar} + */ + public final Builder columnar(@Nullable Boolean value) { + this.columnar = value; + return this; + } + + /** + * The character to use between values within a CSV row. Only valid for the CSV + * format. + *

+ * API name: {@code delimiter} + */ + public final Builder delimiter(@Nullable String value) { + this.delimiter = value; + return this; + } + + /** + * Specify a Query DSL query in the filter parameter to filter the set of + * documents that an ES|QL query runs on. + *

+ * API name: {@code filter} + */ + public final Builder filter(@Nullable Query value) { + this.filter = value; + return this; + } + + /** + * Specify a Query DSL query in the filter parameter to filter the set of + * documents that an ES|QL query runs on. + *

+ * API name: {@code filter} + */ + public final Builder filter(Function> fn) { + return this.filter(fn.apply(new Query.Builder()).build()); + } + + /** + * A short version of the Accept header, e.g. json, yaml. + *

+ * API name: {@code format} + */ + public final Builder format(@Nullable String value) { + this.format = value; + return this; + } + + /** + * API name: {@code locale} + */ + public final Builder locale(@Nullable String value) { + this.locale = value; + return this; + } + + /** + * To avoid any attempts of hacking or code injection, extract the values in a + * separate list of parameters. Use question mark placeholders (?) in the query + * string for each of the parameters. + *

+ * API name: {@code params} + *

+ * Adds all elements of list to params. + */ + public final Builder params(List list) { + this.params = _listAddAll(this.params, list); + return this; + } + + /** + * To avoid any attempts of hacking or code injection, extract the values in a + * separate list of parameters. Use question mark placeholders (?) in the query + * string for each of the parameters. + *

+ * API name: {@code params} + *

+ * Adds one or more values to params. + */ + public final Builder params(FieldValue value, FieldValue... values) { + this.params = _listAdd(this.params, value, values); + return this; + } + + /** + * To avoid any attempts of hacking or code injection, extract the values in a + * separate list of parameters. Use question mark placeholders (?) in the query + * string for each of the parameters. + *

+ * API name: {@code params} + *

+ * Adds a value to params using a builder lambda. + */ + public final Builder params(Function> fn) { + return params(fn.apply(new FieldValue.Builder()).build()); + } + + /** + * Required - The ES|QL query API accepts an ES|QL query string in the query + * parameter, runs it, and returns the results. + *

+ * API name: {@code query} + */ + public final Builder query(String value) { + this.query = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link QueryRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public QueryRequest build() { + _checkSingleUse(); + + return new QueryRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link QueryRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + QueryRequest::setupQueryRequestDeserializer); + + protected static void setupQueryRequestDeserializer(ObjectDeserializer op) { + + op.add(Builder::columnar, JsonpDeserializer.booleanDeserializer(), "columnar"); + op.add(Builder::filter, Query._DESERIALIZER, "filter"); + op.add(Builder::locale, JsonpDeserializer.stringDeserializer(), "locale"); + op.add(Builder::params, JsonpDeserializer.arrayDeserializer(FieldValue._DESERIALIZER), "params"); + op.add(Builder::query, JsonpDeserializer.stringDeserializer(), "query"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code esql.query}". + */ + public static final Endpoint _ENDPOINT = new BinaryEndpoint<>( + "es/esql.query", + + // Request method + request -> { + return "POST"; + + }, + + // Request path + request -> { + return "/_query"; + + }, + + // Path parameters + request -> { + return Collections.emptyMap(); + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.delimiter != null) { + params.put("delimiter", request.delimiter); + } + if (request.format != null) { + params.put("format", request.format); + } + return params; + + }, SimpleEndpoint.emptyMap(), true, null); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphAsyncClient.java index 08028390e..77b0c4230 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphAsyncClient.java @@ -68,11 +68,11 @@ public ElasticsearchGraphAsyncClient withTransportOptions(@Nullable TransportOpt // ----- Endpoint: graph.explore /** - * Explore extracted and summarized information about the documents and terms in - * an index. + * Extracts and summarizes information about the documents and terms in an + * Elasticsearch data stream or index. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/graph-explore-api.html">Documentation * on elastic.co */ @@ -84,14 +84,14 @@ public CompletableFuture explore(ExploreRequest request) { } /** - * Explore extracted and summarized information about the documents and terms in - * an index. + * Extracts and summarizes information about the documents and terms in an + * Elasticsearch data stream or index. * * @param fn * a function that initializes a builder to create the * {@link ExploreRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/graph-explore-api.html">Documentation * on elastic.co */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphClient.java index 4857c471d..af2acaf93 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphClient.java @@ -68,11 +68,11 @@ public ElasticsearchGraphClient withTransportOptions(@Nullable TransportOptions // ----- Endpoint: graph.explore /** - * Explore extracted and summarized information about the documents and terms in - * an index. + * Extracts and summarizes information about the documents and terms in an + * Elasticsearch data stream or index. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/graph-explore-api.html">Documentation * on elastic.co */ @@ -84,14 +84,14 @@ public ExploreResponse explore(ExploreRequest request) throws IOException, Elast } /** - * Explore extracted and summarized information about the documents and terms in - * an index. + * Extracts and summarizes information about the documents and terms in an + * Elasticsearch data stream or index. * * @param fn * a function that initializes a builder to create the * {@link ExploreRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/graph-explore-api.html">Documentation * on elastic.co */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteTemplateRequest.java deleted file mode 100644 index 20971b748..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteTemplateRequest.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: indices.delete_template.Request - -/** - * Deletes a legacy index template. - * - * @see API - * specification - */ - -public class DeleteTemplateRequest extends RequestBase { - @Nullable - private final Time masterTimeout; - - private final String name; - - @Nullable - private final Time timeout; - - // --------------------------------------------------------------------------------------------- - - private DeleteTemplateRequest(Builder builder) { - - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.timeout = builder.timeout; - - } - - public static DeleteTemplateRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - The name of the legacy index template to delete. Wildcard - * (*) expressions are supported. - *

- * API name: {@code name} - */ - public final String name() { - return this.name; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - @Nullable - public final Time timeout() { - return this.timeout; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DeleteTemplateRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Time masterTimeout; - - private String name; - - @Nullable - private Time timeout; - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - The name of the legacy index template to delete. Wildcard - * (*) expressions are supported. - *

- * API name: {@code name} - */ - public final Builder name(String value) { - this.name = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DeleteTemplateRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DeleteTemplateRequest build() { - _checkSingleUse(); - - return new DeleteTemplateRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.delete_template}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.delete_template", - - // Request method - request -> { - return "DELETE"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_template"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name, buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.timeout != null) { - params.put("timeout", request.timeout._toJsonString()); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, DeleteTemplateResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DiskUsageRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DiskUsageRequest.java deleted file mode 100644 index c1ba4255c..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DiskUsageRequest.java +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.ExpandWildcard; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -// typedef: indices.disk_usage.Request - -/** - * Analyzes the disk usage of each field of an index or data stream. - * - * @see API - * specification - */ - -public class DiskUsageRequest extends RequestBase { - @Nullable - private final Boolean allowNoIndices; - - private final List expandWildcards; - - @Nullable - private final Boolean flush; - - @Nullable - private final Boolean ignoreUnavailable; - - private final List index; - - @Nullable - private final Boolean runExpensiveTasks; - - // --------------------------------------------------------------------------------------------- - - private DiskUsageRequest(Builder builder) { - - this.allowNoIndices = builder.allowNoIndices; - this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); - this.flush = builder.flush; - this.ignoreUnavailable = builder.ignoreUnavailable; - this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); - this.runExpensiveTasks = builder.runExpensiveTasks; - - } - - public static DiskUsageRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If false, the request returns an error if any wildcard expression, index - * alias, or _all value targets only missing or closed indices. - * This behavior applies even if the request targets other open indices. For - * example, a request targeting foo*,bar* returns an error if an - * index starts with foo but no index starts with bar. - *

- * API name: {@code allow_no_indices} - */ - @Nullable - public final Boolean allowNoIndices() { - return this.allowNoIndices; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. - *

- * API name: {@code expand_wildcards} - */ - public final List expandWildcards() { - return this.expandWildcards; - } - - /** - * If true, the API performs a flush before analysis. If - * false, the response may not include uncommitted data. - *

- * API name: {@code flush} - */ - @Nullable - public final Boolean flush() { - return this.flush; - } - - /** - * If true, missing or closed indices are not included in the - * response. - *

- * API name: {@code ignore_unavailable} - */ - @Nullable - public final Boolean ignoreUnavailable() { - return this.ignoreUnavailable; - } - - /** - * Required - Comma-separated list of data streams, indices, and aliases used to - * limit the request. It’s recommended to execute this API with a single index - * (or the latest backing index of a data stream) as the API consumes resources - * significantly. - *

- * API name: {@code index} - */ - public final List index() { - return this.index; - } - - /** - * Analyzing field disk usage is resource-intensive. To use the API, this - * parameter must be set to true. - *

- * API name: {@code run_expensive_tasks} - */ - @Nullable - public final Boolean runExpensiveTasks() { - return this.runExpensiveTasks; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DiskUsageRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean allowNoIndices; - - @Nullable - private List expandWildcards; - - @Nullable - private Boolean flush; - - @Nullable - private Boolean ignoreUnavailable; - - private List index; - - @Nullable - private Boolean runExpensiveTasks; - - /** - * If false, the request returns an error if any wildcard expression, index - * alias, or _all value targets only missing or closed indices. - * This behavior applies even if the request targets other open indices. For - * example, a request targeting foo*,bar* returns an error if an - * index starts with foo but no index starts with bar. - *

- * API name: {@code allow_no_indices} - */ - public final Builder allowNoIndices(@Nullable Boolean value) { - this.allowNoIndices = value; - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds all elements of list to expandWildcards. - */ - public final Builder expandWildcards(List list) { - this.expandWildcards = _listAddAll(this.expandWildcards, list); - return this; - } - - /** - * Type of index that wildcard patterns can match. If the request can target - * data streams, this argument determines whether wildcard expressions match - * hidden data streams. Supports comma-separated values, such as - * open,hidden. - *

- * API name: {@code expand_wildcards} - *

- * Adds one or more values to expandWildcards. - */ - public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { - this.expandWildcards = _listAdd(this.expandWildcards, value, values); - return this; - } - - /** - * If true, the API performs a flush before analysis. If - * false, the response may not include uncommitted data. - *

- * API name: {@code flush} - */ - public final Builder flush(@Nullable Boolean value) { - this.flush = value; - return this; - } - - /** - * If true, missing or closed indices are not included in the - * response. - *

- * API name: {@code ignore_unavailable} - */ - public final Builder ignoreUnavailable(@Nullable Boolean value) { - this.ignoreUnavailable = value; - return this; - } - - /** - * Required - Comma-separated list of data streams, indices, and aliases used to - * limit the request. It’s recommended to execute this API with a single index - * (or the latest backing index of a data stream) as the API consumes resources - * significantly. - *

- * API name: {@code index} - *

- * Adds all elements of list to index. - */ - public final Builder index(List list) { - this.index = _listAddAll(this.index, list); - return this; - } - - /** - * Required - Comma-separated list of data streams, indices, and aliases used to - * limit the request. It’s recommended to execute this API with a single index - * (or the latest backing index of a data stream) as the API consumes resources - * significantly. - *

- * API name: {@code index} - *

- * Adds one or more values to index. - */ - public final Builder index(String value, String... values) { - this.index = _listAdd(this.index, value, values); - return this; - } - - /** - * Analyzing field disk usage is resource-intensive. To use the API, this - * parameter must be set to true. - *

- * API name: {@code run_expensive_tasks} - */ - public final Builder runExpensiveTasks(@Nullable Boolean value) { - this.runExpensiveTasks = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DiskUsageRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DiskUsageRequest build() { - _checkSingleUse(); - - return new DiskUsageRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.disk_usage}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.disk_usage", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - StringBuilder buf = new StringBuilder(); - buf.append("/"); - SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_disk_usage"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _index = 1 << 0; - - int propsSet = 0; - - propsSet |= _index; - - if (propsSet == (_index)) { - params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.flush != null) { - params.put("flush", String.valueOf(request.flush)); - } - if (ApiTypeHelper.isDefined(request.expandWildcards)) { - params.put("expand_wildcards", - request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); - } - if (request.ignoreUnavailable != null) { - params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); - } - if (request.allowNoIndices != null) { - params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); - } - if (request.runExpensiveTasks != null) { - params.put("run_expensive_tasks", String.valueOf(request.runExpensiveTasks)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, DiskUsageResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DiskUsageResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DiskUsageResponse.java deleted file mode 100644 index 15e884ebb..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DiskUsageResponse.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import jakarta.json.stream.JsonParser; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: indices.disk_usage.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class DiskUsageResponse implements JsonpSerializable { - private final JsonData valueBody; - - // --------------------------------------------------------------------------------------------- - - private DiskUsageResponse(Builder builder) { - - this.valueBody = ApiTypeHelper.requireNonNull(builder.valueBody, this, "valueBody"); - - } - - public static DiskUsageResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Response value. - */ - public final JsonData valueBody() { - return this.valueBody; - } - - /** - * Serialize this value to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - this.valueBody.serialize(generator, mapper); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DiskUsageResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private JsonData valueBody; - - /** - * Required - Response value. - */ - public final Builder valueBody(JsonData value) { - this.valueBody = value; - return this; - } - - @Override - public Builder withJson(JsonParser parser, JsonpMapper mapper) { - - @SuppressWarnings("unchecked") - JsonData value = (JsonData) JsonData._DESERIALIZER.deserialize(parser, mapper); - return this.valueBody(value); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link DiskUsageResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DiskUsageResponse build() { - _checkSingleUse(); - - return new DiskUsageResponse(this); - } - } - - public static final JsonpDeserializer _DESERIALIZER = createDiskUsageResponseDeserializer(); - protected static JsonpDeserializer createDiskUsageResponseDeserializer() { - - JsonpDeserializer valueDeserializer = JsonData._DESERIALIZER; - - return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() - .valueBody(valueDeserializer.deserialize(parser, mapper, event)).build()); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java index 85a60a949..5f9ff2635 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java @@ -104,11 +104,10 @@ public final CompletableFuture addBlock( // ----- Endpoint: indices.analyze /** - * Performs the analysis process on a text and return the tokens breakdown of - * the text. + * Performs analysis on a text string and returns the resulting tokens. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-analyze.html">Documentation * on elastic.co */ @@ -120,14 +119,13 @@ public CompletableFuture analyze(AnalyzeRequest request) { } /** - * Performs the analysis process on a text and return the tokens breakdown of - * the text. + * Performs analysis on a text string and returns the resulting tokens. * * @param fn * a function that initializes a builder to create the * {@link AnalyzeRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-analyze.html">Documentation * on elastic.co */ @@ -137,11 +135,10 @@ public final CompletableFuture analyze( } /** - * Performs the analysis process on a text and return the tokens breakdown of - * the text. + * Performs analysis on a text string and returns the resulting tokens. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-analyze.html">Documentation * on elastic.co */ @@ -153,10 +150,10 @@ public CompletableFuture analyze() { // ----- Endpoint: indices.create /** - * Creates an index with optional settings and mappings. + * Creates a new index. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-create-index.html">Documentation * on elastic.co */ @@ -168,13 +165,13 @@ public CompletableFuture create(CreateIndexRequest request) } /** - * Creates an index with optional settings and mappings. + * Creates a new index. * * @param fn * a function that initializes a builder to create the * {@link CreateIndexRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-create-index.html">Documentation * on elastic.co */ @@ -186,7 +183,8 @@ public final CompletableFuture create( // ----- Endpoint: indices.create_data_stream /** - * Creates a data stream + * Creates a data stream. You must have a matching index template with data + * stream enabled. * * @see Documentation @@ -201,7 +199,8 @@ public CompletableFuture createDataStream(CreateDataSt } /** - * Creates a data stream + * Creates a data stream. You must have a matching index template with data + * stream enabled. * * @param fn * a function that initializes a builder to create the @@ -219,7 +218,7 @@ public final CompletableFuture createDataStream( // ----- Endpoint: indices.data_streams_stats /** - * Provides statistics on operations happening in a data stream. + * Retrieves statistics for one or more data streams. * * @see Documentation @@ -234,7 +233,7 @@ public CompletableFuture dataStreamsStats(DataStreamsS } /** - * Provides statistics on operations happening in a data stream. + * Retrieves statistics for one or more data streams. * * @param fn * a function that initializes a builder to create the @@ -250,7 +249,7 @@ public final CompletableFuture dataStreamsStats( } /** - * Provides statistics on operations happening in a data stream. + * Retrieves statistics for one or more data streams. * * @see Documentation @@ -265,7 +264,7 @@ public CompletableFuture dataStreamsStats() { // ----- Endpoint: indices.delete /** - * Deletes an index. + * Deletes one or more indices. * * @see Documentation @@ -280,7 +279,7 @@ public CompletableFuture delete(DeleteIndexRequest request) } /** - * Deletes an index. + * Deletes one or more indices. * * @param fn * a function that initializes a builder to create the @@ -298,7 +297,7 @@ public final CompletableFuture delete( // ----- Endpoint: indices.delete_alias /** - * Deletes an alias. + * Removes a data stream or index from an alias. * * @see Documentation @@ -313,7 +312,7 @@ public CompletableFuture deleteAlias(DeleteAliasRequest req } /** - * Deletes an alias. + * Removes a data stream or index from an alias. * * @param fn * a function that initializes a builder to create the @@ -331,7 +330,8 @@ public final CompletableFuture deleteAlias( // ----- Endpoint: indices.delete_data_lifecycle /** - * Deletes the data stream lifecycle of the selected data streams. + * Removes the data lifecycle from a data stream rendering it not managed by the + * data stream lifecycle * * @see Documentation @@ -346,7 +346,8 @@ public CompletableFuture deleteDataLifecycle(Delete } /** - * Deletes the data stream lifecycle of the selected data streams. + * Removes the data lifecycle from a data stream rendering it not managed by the + * data stream lifecycle * * @param fn * a function that initializes a builder to create the @@ -364,7 +365,7 @@ public final CompletableFuture deleteDataLifecycle( // ----- Endpoint: indices.delete_data_stream /** - * Deletes a data stream. + * Deletes one or more data streams and their backing indices. * * @see Documentation @@ -379,7 +380,7 @@ public CompletableFuture deleteDataStream(DeleteDataSt } /** - * Deletes a data stream. + * Deletes one or more data streams and their backing indices. * * @param fn * a function that initializes a builder to create the @@ -397,7 +398,10 @@ public final CompletableFuture deleteDataStream( // ----- Endpoint: indices.delete_index_template /** - * Deletes an index template. + * The provided <index-template> may contain multiple template names + * separated by a comma. If multiple template names are specified then there is + * no wildcard support and the provided names should match completely with + * existing templates. * * @see Documentation @@ -412,7 +416,10 @@ public CompletableFuture deleteIndexTemplate(Delete } /** - * Deletes an index template. + * The provided <index-template> may contain multiple template names + * separated by a comma. If multiple template names are specified then there is + * no wildcard support and the provided names should match completely with + * existing templates. * * @param fn * a function that initializes a builder to create the @@ -430,7 +437,7 @@ public final CompletableFuture deleteIndexTemplate( // ----- Endpoint: indices.exists /** - * Returns information about whether a particular index exists. + * Checks if a data stream, index, or alias exists. * * @see Documentation @@ -445,7 +452,7 @@ public CompletableFuture exists(ExistsRequest request) { } /** - * Returns information about whether a particular index exists. + * Checks if a data stream, index, or alias exists. * * @param fn * a function that initializes a builder to create the @@ -463,7 +470,7 @@ public final CompletableFuture exists( // ----- Endpoint: indices.exists_alias /** - * Returns information about whether a particular alias exists. + * Checks if an alias exists. * * @see Documentation @@ -478,7 +485,7 @@ public CompletableFuture existsAlias(ExistsAliasRequest request } /** - * Returns information about whether a particular alias exists. + * Checks if an alias exists. * * @param fn * a function that initializes a builder to create the @@ -564,7 +571,8 @@ public final CompletableFuture explainDataLifecycl // ----- Endpoint: indices.get /** - * Returns information about one or more indices. + * Returns information about one or more indices. For data streams, the API + * returns information about the stream’s backing indices. * * @see Documentation @@ -579,7 +587,8 @@ public CompletableFuture get(GetIndexRequest request) { } /** - * Returns information about one or more indices. + * Returns information about one or more indices. For data streams, the API + * returns information about the stream’s backing indices. * * @param fn * a function that initializes a builder to create the @@ -597,7 +606,7 @@ public final CompletableFuture get( // ----- Endpoint: indices.get_alias /** - * Returns an alias. + * Retrieves information for one or more aliases. * * @see Documentation @@ -612,7 +621,7 @@ public CompletableFuture getAlias(GetAliasRequest request) { } /** - * Returns an alias. + * Retrieves information for one or more aliases. * * @param fn * a function that initializes a builder to create the @@ -628,7 +637,7 @@ public final CompletableFuture getAlias( } /** - * Returns an alias. + * Retrieves information for one or more aliases. * * @see Documentation @@ -643,7 +652,8 @@ public CompletableFuture getAlias() { // ----- Endpoint: indices.get_data_lifecycle /** - * Returns the data stream lifecycle of the selected data streams. + * Retrieves the data stream lifecycle configuration of one or more data + * streams. * * @see Documentation @@ -658,7 +668,8 @@ public CompletableFuture getDataLifecycle(GetDataLifec } /** - * Returns the data stream lifecycle of the selected data streams. + * Retrieves the data stream lifecycle configuration of one or more data + * streams. * * @param fn * a function that initializes a builder to create the @@ -676,7 +687,7 @@ public final CompletableFuture getDataLifecycle( // ----- Endpoint: indices.get_data_stream /** - * Returns data streams. + * Retrieves information about one or more data streams. * * @see Documentation @@ -691,7 +702,7 @@ public CompletableFuture getDataStream(GetDataStreamReque } /** - * Returns data streams. + * Retrieves information about one or more data streams. * * @param fn * a function that initializes a builder to create the @@ -707,7 +718,7 @@ public final CompletableFuture getDataStream( } /** - * Returns data streams. + * Retrieves information about one or more data streams. * * @see Documentation @@ -722,7 +733,7 @@ public CompletableFuture getDataStream() { // ----- Endpoint: indices.get_index_template /** - * Returns an index template. + * Returns information about one or more index templates. * * @see Documentation @@ -737,7 +748,7 @@ public CompletableFuture getIndexTemplate(GetIndexTemp } /** - * Returns an index template. + * Returns information about one or more index templates. * * @param fn * a function that initializes a builder to create the @@ -753,7 +764,7 @@ public final CompletableFuture getIndexTemplate( } /** - * Returns an index template. + * Returns information about one or more index templates. * * @see Documentation @@ -768,7 +779,8 @@ public CompletableFuture getIndexTemplate() { // ----- Endpoint: indices.get_mapping /** - * Returns mappings for one or more indices. + * Retrieves mapping definitions for one or more indices. For data streams, the + * API retrieves mappings for the stream’s backing indices. * * @see Documentation @@ -783,7 +795,8 @@ public CompletableFuture getMapping(GetMappingRequest reques } /** - * Returns mappings for one or more indices. + * Retrieves mapping definitions for one or more indices. For data streams, the + * API retrieves mappings for the stream’s backing indices. * * @param fn * a function that initializes a builder to create the @@ -799,7 +812,8 @@ public final CompletableFuture getMapping( } /** - * Returns mappings for one or more indices. + * Retrieves mapping definitions for one or more indices. For data streams, the + * API retrieves mappings for the stream’s backing indices. * * @see Documentation @@ -814,7 +828,8 @@ public CompletableFuture getMapping() { // ----- Endpoint: indices.get_settings /** - * Returns settings for one or more indices. + * Returns setting information for one or more indices. For data streams, + * returns setting information for the stream’s backing indices. * * @see Documentation @@ -829,7 +844,8 @@ public CompletableFuture getSettings(GetIndicesSetti } /** - * Returns settings for one or more indices. + * Returns setting information for one or more indices. For data streams, + * returns setting information for the stream’s backing indices. * * @param fn * a function that initializes a builder to create the @@ -845,7 +861,8 @@ public final CompletableFuture getSettings( } /** - * Returns settings for one or more indices. + * Returns setting information for one or more indices. For data streams, + * returns setting information for the stream’s backing indices. * * @see Documentation @@ -860,7 +877,15 @@ public CompletableFuture getSettings() { // ----- Endpoint: indices.migrate_to_data_stream /** - * Migrates an alias to a data stream + * Converts an index alias to a data stream. You must have a matching index + * template that is data stream enabled. The alias must meet the following + * criteria: The alias must have a write index; All indices for the alias must + * have a @timestamp field mapping of a date or + * date_nanos field type; The alias must not have any filters; The + * alias must not use custom routing. If successful, the request removes the + * alias and creates a data stream with the same name. The indices for the alias + * become hidden backing indices for the stream. The write index for the alias + * becomes the write index for the stream. * * @see Documentation @@ -875,7 +900,15 @@ public CompletableFuture migrateToDataStream(Migrat } /** - * Migrates an alias to a data stream + * Converts an index alias to a data stream. You must have a matching index + * template that is data stream enabled. The alias must meet the following + * criteria: The alias must have a write index; All indices for the alias must + * have a @timestamp field mapping of a date or + * date_nanos field type; The alias must not have any filters; The + * alias must not use custom routing. If successful, the request removes the + * alias and creates a data stream with the same name. The indices for the alias + * become hidden backing indices for the stream. The write index for the alias + * becomes the write index for the stream. * * @param fn * a function that initializes a builder to create the @@ -893,7 +926,8 @@ public final CompletableFuture migrateToDataStream( // ----- Endpoint: indices.modify_data_stream /** - * Modifies a data stream + * Performs one or more data stream modification actions in a single atomic + * operation. * * @see Documentation @@ -908,7 +942,8 @@ public CompletableFuture modifyDataStream(ModifyDataSt } /** - * Modifies a data stream + * Performs one or more data stream modification actions in a single atomic + * operation. * * @param fn * a function that initializes a builder to create the @@ -926,7 +961,7 @@ public final CompletableFuture modifyDataStream( // ----- Endpoint: indices.put_alias /** - * Creates or updates an alias. + * Adds a data stream or index to an alias. * * @see Documentation @@ -941,7 +976,7 @@ public CompletableFuture putAlias(PutAliasRequest request) { } /** - * Creates or updates an alias. + * Adds a data stream or index to an alias. * * @param fn * a function that initializes a builder to create the @@ -959,7 +994,7 @@ public final CompletableFuture putAlias( // ----- Endpoint: indices.put_data_lifecycle /** - * Updates the data stream lifecycle of the selected data streams. + * Update the data lifecycle of the specified data streams. * * @see Documentation @@ -974,7 +1009,7 @@ public CompletableFuture putDataLifecycle(PutDataLifec } /** - * Updates the data stream lifecycle of the selected data streams. + * Update the data lifecycle of the specified data streams. * * @param fn * a function that initializes a builder to create the @@ -992,7 +1027,8 @@ public final CompletableFuture putDataLifecycle( // ----- Endpoint: indices.put_index_template /** - * Creates or updates an index template. + * Creates or updates an index template. Index templates define settings, + * mappings, and aliases that can be applied automatically to new indices. * * @see Documentation @@ -1007,7 +1043,8 @@ public CompletableFuture putIndexTemplate(PutIndexTemp } /** - * Creates or updates an index template. + * Creates or updates an index template. Index templates define settings, + * mappings, and aliases that can be applied automatically to new indices. * * @param fn * a function that initializes a builder to create the @@ -1025,7 +1062,9 @@ public final CompletableFuture putIndexTemplate( // ----- Endpoint: indices.put_mapping /** - * Updates the index mappings. + * Adds new fields to an existing data stream or index. You can also use this + * API to change the search settings of existing fields. For data streams, these + * changes are applied to all backing indices by default. * * @see Documentation @@ -1040,7 +1079,9 @@ public CompletableFuture putMapping(PutMappingRequest reques } /** - * Updates the index mappings. + * Adds new fields to an existing data stream or index. You can also use this + * API to change the search settings of existing fields. For data streams, these + * changes are applied to all backing indices by default. * * @param fn * a function that initializes a builder to create the @@ -1058,7 +1099,8 @@ public final CompletableFuture putMapping( // ----- Endpoint: indices.put_settings /** - * Updates the index settings. + * Changes a dynamic index setting in real time. For data streams, index setting + * changes are applied to all backing indices by default. * * @see Documentation @@ -1073,7 +1115,8 @@ public CompletableFuture putSettings(PutIndicesSetti } /** - * Updates the index settings. + * Changes a dynamic index setting in real time. For data streams, index setting + * changes are applied to all backing indices by default. * * @param fn * a function that initializes a builder to create the @@ -1089,7 +1132,8 @@ public final CompletableFuture putSettings( } /** - * Updates the index settings. + * Changes a dynamic index setting in real time. For data streams, index setting + * changes are applied to all backing indices by default. * * @see Documentation @@ -1104,7 +1148,8 @@ public CompletableFuture putSettings() { // ----- Endpoint: indices.put_template /** - * Creates or updates an index template. + * Creates or updates an index template. Index templates define settings, + * mappings, and aliases that can be applied automatically to new indices. * * @see Documentation @@ -1119,7 +1164,8 @@ public CompletableFuture putTemplate(PutTemplateRequest req } /** - * Creates or updates an index template. + * Creates or updates an index template. Index templates define settings, + * mappings, and aliases that can be applied automatically to new indices. * * @param fn * a function that initializes a builder to create the @@ -1137,7 +1183,9 @@ public final CompletableFuture putTemplate( // ----- Endpoint: indices.refresh /** - * Performs the refresh operation in one or more indices. + * A refresh makes recent operations performed on one or more indices available + * for search. For data streams, the API runs the refresh operation on the + * stream’s backing indices. * * @see Documentation @@ -1152,7 +1200,9 @@ public CompletableFuture refresh(RefreshRequest request) { } /** - * Performs the refresh operation in one or more indices. + * A refresh makes recent operations performed on one or more indices available + * for search. For data streams, the API runs the refresh operation on the + * stream’s backing indices. * * @param fn * a function that initializes a builder to create the @@ -1168,7 +1218,9 @@ public final CompletableFuture refresh( } /** - * Performs the refresh operation in one or more indices. + * A refresh makes recent operations performed on one or more indices available + * for search. For data streams, the API runs the refresh operation on the + * stream’s backing indices. * * @see Documentation @@ -1183,7 +1235,8 @@ public CompletableFuture refresh() { // ----- Endpoint: indices.resolve_index /** - * Returns information about any matching indices, aliases, and data streams + * Resolves the specified name(s) and/or index patterns for indices, aliases, + * and data streams. Multiple patterns and remote clusters are supported. * * @see Documentation @@ -1198,7 +1251,8 @@ public CompletableFuture resolveIndex(ResolveIndexRequest } /** - * Returns information about any matching indices, aliases, and data streams + * Resolves the specified name(s) and/or index patterns for indices, aliases, + * and data streams. Multiple patterns and remote clusters are supported. * * @param fn * a function that initializes a builder to create the @@ -1216,11 +1270,10 @@ public final CompletableFuture resolveIndex( // ----- Endpoint: indices.rollover /** - * Updates an alias to point to a new index when the existing index is - * considered to be too large or too old. + * Creates a new index for a data stream or index alias. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-rollover-index.html">Documentation * on elastic.co */ @@ -1232,14 +1285,13 @@ public CompletableFuture rollover(RolloverRequest request) { } /** - * Updates an alias to point to a new index when the existing index is - * considered to be too large or too old. + * Creates a new index for a data stream or index alias. * * @param fn * a function that initializes a builder to create the * {@link RolloverRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-rollover-index.html">Documentation * on elastic.co */ @@ -1251,9 +1303,7 @@ public final CompletableFuture rollover( // ----- Endpoint: indices.simulate_index_template /** - * Simulate matching the given index name against the index templates in the - * system - * + * * @see Documentation * on elastic.co @@ -1268,9 +1318,7 @@ public CompletableFuture simulateIndexTemplate( } /** - * Simulate matching the given index name against the index templates in the - * system - * + * * @param fn * a function that initializes a builder to create the * {@link SimulateIndexTemplateRequest} @@ -1287,7 +1335,8 @@ public final CompletableFuture simulateIndexTempl // ----- Endpoint: indices.simulate_template /** - * Simulate resolving the given template name or body + * Returns the index configuration that would be applied by a particular index + * template. * * @see Documentation @@ -1302,7 +1351,8 @@ public CompletableFuture simulateTemplate(SimulateTemp } /** - * Simulate resolving the given template name or body + * Returns the index configuration that would be applied by a particular index + * template. * * @param fn * a function that initializes a builder to create the @@ -1318,7 +1368,8 @@ public final CompletableFuture simulateTemplate( } /** - * Simulate resolving the given template name or body + * Returns the index configuration that would be applied by a particular index + * template. * * @see Documentation @@ -1333,7 +1384,7 @@ public CompletableFuture simulateTemplate() { // ----- Endpoint: indices.update_aliases /** - * Updates index aliases. + * Adds a data stream or index to an alias. * * @see Documentation @@ -1348,7 +1399,7 @@ public CompletableFuture updateAliases(UpdateAliasesReque } /** - * Updates index aliases. + * Adds a data stream or index to an alias. * * @param fn * a function that initializes a builder to create the @@ -1364,7 +1415,7 @@ public final CompletableFuture updateAliases( } /** - * Updates index aliases. + * Adds a data stream or index to an alias. * * @see Documentation @@ -1379,7 +1430,7 @@ public CompletableFuture updateAliases() { // ----- Endpoint: indices.validate_query /** - * Allows a user to validate a potentially expensive query without executing it. + * Validates a potentially expensive query without executing it. * * @see Documentation @@ -1394,7 +1445,7 @@ public CompletableFuture validateQuery(ValidateQueryReque } /** - * Allows a user to validate a potentially expensive query without executing it. + * Validates a potentially expensive query without executing it. * * @param fn * a function that initializes a builder to create the @@ -1410,7 +1461,7 @@ public final CompletableFuture validateQuery( } /** - * Allows a user to validate a potentially expensive query without executing it. + * Validates a potentially expensive query without executing it. * * @see Documentation diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java index 50cc4bb9b..d44610a27 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java @@ -102,11 +102,10 @@ public final AddBlockResponse addBlock(FunctionDocumentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-analyze.html">Documentation * on elastic.co */ @@ -118,14 +117,13 @@ public AnalyzeResponse analyze(AnalyzeRequest request) throws IOException, Elast } /** - * Performs the analysis process on a text and return the tokens breakdown of - * the text. + * Performs analysis on a text string and returns the resulting tokens. * * @param fn * a function that initializes a builder to create the * {@link AnalyzeRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-analyze.html">Documentation * on elastic.co */ @@ -135,11 +133,10 @@ public final AnalyzeResponse analyze(FunctionDocumentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-analyze.html">Documentation * on elastic.co */ @@ -151,10 +148,10 @@ public AnalyzeResponse analyze() throws IOException, ElasticsearchException { // ----- Endpoint: indices.create /** - * Creates an index with optional settings and mappings. + * Creates a new index. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-create-index.html">Documentation * on elastic.co */ @@ -166,13 +163,13 @@ public CreateIndexResponse create(CreateIndexRequest request) throws IOException } /** - * Creates an index with optional settings and mappings. + * Creates a new index. * * @param fn * a function that initializes a builder to create the * {@link CreateIndexRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-create-index.html">Documentation * on elastic.co */ @@ -184,7 +181,8 @@ public final CreateIndexResponse create(FunctionDocumentation @@ -200,7 +198,8 @@ public CreateDataStreamResponse createDataStream(CreateDataStreamRequest request } /** - * Creates a data stream + * Creates a data stream. You must have a matching index template with data + * stream enabled. * * @param fn * a function that initializes a builder to create the @@ -219,7 +218,7 @@ public final CreateDataStreamResponse createDataStream( // ----- Endpoint: indices.data_streams_stats /** - * Provides statistics on operations happening in a data stream. + * Retrieves statistics for one or more data streams. * * @see Documentation @@ -235,7 +234,7 @@ public DataStreamsStatsResponse dataStreamsStats(DataStreamsStatsRequest request } /** - * Provides statistics on operations happening in a data stream. + * Retrieves statistics for one or more data streams. * * @param fn * a function that initializes a builder to create the @@ -252,7 +251,7 @@ public final DataStreamsStatsResponse dataStreamsStats( } /** - * Provides statistics on operations happening in a data stream. + * Retrieves statistics for one or more data streams. * * @see Documentation @@ -267,7 +266,7 @@ public DataStreamsStatsResponse dataStreamsStats() throws IOException, Elasticse // ----- Endpoint: indices.delete /** - * Deletes an index. + * Deletes one or more indices. * * @see Documentation @@ -282,7 +281,7 @@ public DeleteIndexResponse delete(DeleteIndexRequest request) throws IOException } /** - * Deletes an index. + * Deletes one or more indices. * * @param fn * a function that initializes a builder to create the @@ -300,7 +299,7 @@ public final DeleteIndexResponse delete(FunctionDocumentation @@ -315,7 +314,7 @@ public DeleteAliasResponse deleteAlias(DeleteAliasRequest request) throws IOExce } /** - * Deletes an alias. + * Removes a data stream or index from an alias. * * @param fn * a function that initializes a builder to create the @@ -334,7 +333,8 @@ public final DeleteAliasResponse deleteAlias( // ----- Endpoint: indices.delete_data_lifecycle /** - * Deletes the data stream lifecycle of the selected data streams. + * Removes the data lifecycle from a data stream rendering it not managed by the + * data stream lifecycle * * @see Documentation @@ -350,7 +350,8 @@ public DeleteDataLifecycleResponse deleteDataLifecycle(DeleteDataLifecycleReques } /** - * Deletes the data stream lifecycle of the selected data streams. + * Removes the data lifecycle from a data stream rendering it not managed by the + * data stream lifecycle * * @param fn * a function that initializes a builder to create the @@ -369,7 +370,7 @@ public final DeleteDataLifecycleResponse deleteDataLifecycle( // ----- Endpoint: indices.delete_data_stream /** - * Deletes a data stream. + * Deletes one or more data streams and their backing indices. * * @see Documentation @@ -385,7 +386,7 @@ public DeleteDataStreamResponse deleteDataStream(DeleteDataStreamRequest request } /** - * Deletes a data stream. + * Deletes one or more data streams and their backing indices. * * @param fn * a function that initializes a builder to create the @@ -404,7 +405,10 @@ public final DeleteDataStreamResponse deleteDataStream( // ----- Endpoint: indices.delete_index_template /** - * Deletes an index template. + * The provided <index-template> may contain multiple template names + * separated by a comma. If multiple template names are specified then there is + * no wildcard support and the provided names should match completely with + * existing templates. * * @see Documentation @@ -420,7 +424,10 @@ public DeleteIndexTemplateResponse deleteIndexTemplate(DeleteIndexTemplateReques } /** - * Deletes an index template. + * The provided <index-template> may contain multiple template names + * separated by a comma. If multiple template names are specified then there is + * no wildcard support and the provided names should match completely with + * existing templates. * * @param fn * a function that initializes a builder to create the @@ -439,7 +446,7 @@ public final DeleteIndexTemplateResponse deleteIndexTemplate( // ----- Endpoint: indices.exists /** - * Returns information about whether a particular index exists. + * Checks if a data stream, index, or alias exists. * * @see Documentation @@ -454,7 +461,7 @@ public BooleanResponse exists(ExistsRequest request) throws IOException, Elastic } /** - * Returns information about whether a particular index exists. + * Checks if a data stream, index, or alias exists. * * @param fn * a function that initializes a builder to create the @@ -472,7 +479,7 @@ public final BooleanResponse exists(FunctionDocumentation @@ -487,7 +494,7 @@ public BooleanResponse existsAlias(ExistsAliasRequest request) throws IOExceptio } /** - * Returns information about whether a particular alias exists. + * Checks if an alias exists. * * @param fn * a function that initializes a builder to create the @@ -577,7 +584,8 @@ public final ExplainDataLifecycleResponse explainDataLifecycle( // ----- Endpoint: indices.get /** - * Returns information about one or more indices. + * Returns information about one or more indices. For data streams, the API + * returns information about the stream’s backing indices. * * @see Documentation @@ -592,7 +600,8 @@ public GetIndexResponse get(GetIndexRequest request) throws IOException, Elastic } /** - * Returns information about one or more indices. + * Returns information about one or more indices. For data streams, the API + * returns information about the stream’s backing indices. * * @param fn * a function that initializes a builder to create the @@ -610,7 +619,7 @@ public final GetIndexResponse get(FunctionDocumentation @@ -625,7 +634,7 @@ public GetAliasResponse getAlias(GetAliasRequest request) throws IOException, El } /** - * Returns an alias. + * Retrieves information for one or more aliases. * * @param fn * a function that initializes a builder to create the @@ -641,7 +650,7 @@ public final GetAliasResponse getAlias(FunctionDocumentation @@ -656,7 +665,8 @@ public GetAliasResponse getAlias() throws IOException, ElasticsearchException { // ----- Endpoint: indices.get_data_lifecycle /** - * Returns the data stream lifecycle of the selected data streams. + * Retrieves the data stream lifecycle configuration of one or more data + * streams. * * @see Documentation @@ -672,7 +682,8 @@ public GetDataLifecycleResponse getDataLifecycle(GetDataLifecycleRequest request } /** - * Returns the data stream lifecycle of the selected data streams. + * Retrieves the data stream lifecycle configuration of one or more data + * streams. * * @param fn * a function that initializes a builder to create the @@ -691,7 +702,7 @@ public final GetDataLifecycleResponse getDataLifecycle( // ----- Endpoint: indices.get_data_stream /** - * Returns data streams. + * Retrieves information about one or more data streams. * * @see Documentation @@ -707,7 +718,7 @@ public GetDataStreamResponse getDataStream(GetDataStreamRequest request) } /** - * Returns data streams. + * Retrieves information about one or more data streams. * * @param fn * a function that initializes a builder to create the @@ -724,7 +735,7 @@ public final GetDataStreamResponse getDataStream( } /** - * Returns data streams. + * Retrieves information about one or more data streams. * * @see Documentation @@ -739,7 +750,7 @@ public GetDataStreamResponse getDataStream() throws IOException, ElasticsearchEx // ----- Endpoint: indices.get_index_template /** - * Returns an index template. + * Returns information about one or more index templates. * * @see Documentation @@ -755,7 +766,7 @@ public GetIndexTemplateResponse getIndexTemplate(GetIndexTemplateRequest request } /** - * Returns an index template. + * Returns information about one or more index templates. * * @param fn * a function that initializes a builder to create the @@ -772,7 +783,7 @@ public final GetIndexTemplateResponse getIndexTemplate( } /** - * Returns an index template. + * Returns information about one or more index templates. * * @see Documentation @@ -787,7 +798,8 @@ public GetIndexTemplateResponse getIndexTemplate() throws IOException, Elasticse // ----- Endpoint: indices.get_mapping /** - * Returns mappings for one or more indices. + * Retrieves mapping definitions for one or more indices. For data streams, the + * API retrieves mappings for the stream’s backing indices. * * @see Documentation @@ -802,7 +814,8 @@ public GetMappingResponse getMapping(GetMappingRequest request) throws IOExcepti } /** - * Returns mappings for one or more indices. + * Retrieves mapping definitions for one or more indices. For data streams, the + * API retrieves mappings for the stream’s backing indices. * * @param fn * a function that initializes a builder to create the @@ -818,7 +831,8 @@ public final GetMappingResponse getMapping(FunctionDocumentation @@ -833,7 +847,8 @@ public GetMappingResponse getMapping() throws IOException, ElasticsearchExceptio // ----- Endpoint: indices.get_settings /** - * Returns settings for one or more indices. + * Returns setting information for one or more indices. For data streams, + * returns setting information for the stream’s backing indices. * * @see Documentation @@ -849,7 +864,8 @@ public GetIndicesSettingsResponse getSettings(GetIndicesSettingsRequest request) } /** - * Returns settings for one or more indices. + * Returns setting information for one or more indices. For data streams, + * returns setting information for the stream’s backing indices. * * @param fn * a function that initializes a builder to create the @@ -866,7 +882,8 @@ public final GetIndicesSettingsResponse getSettings( } /** - * Returns settings for one or more indices. + * Returns setting information for one or more indices. For data streams, + * returns setting information for the stream’s backing indices. * * @see Documentation @@ -881,7 +898,15 @@ public GetIndicesSettingsResponse getSettings() throws IOException, Elasticsearc // ----- Endpoint: indices.migrate_to_data_stream /** - * Migrates an alias to a data stream + * Converts an index alias to a data stream. You must have a matching index + * template that is data stream enabled. The alias must meet the following + * criteria: The alias must have a write index; All indices for the alias must + * have a @timestamp field mapping of a date or + * date_nanos field type; The alias must not have any filters; The + * alias must not use custom routing. If successful, the request removes the + * alias and creates a data stream with the same name. The indices for the alias + * become hidden backing indices for the stream. The write index for the alias + * becomes the write index for the stream. * * @see Documentation @@ -897,7 +922,15 @@ public MigrateToDataStreamResponse migrateToDataStream(MigrateToDataStreamReques } /** - * Migrates an alias to a data stream + * Converts an index alias to a data stream. You must have a matching index + * template that is data stream enabled. The alias must meet the following + * criteria: The alias must have a write index; All indices for the alias must + * have a @timestamp field mapping of a date or + * date_nanos field type; The alias must not have any filters; The + * alias must not use custom routing. If successful, the request removes the + * alias and creates a data stream with the same name. The indices for the alias + * become hidden backing indices for the stream. The write index for the alias + * becomes the write index for the stream. * * @param fn * a function that initializes a builder to create the @@ -916,7 +949,8 @@ public final MigrateToDataStreamResponse migrateToDataStream( // ----- Endpoint: indices.modify_data_stream /** - * Modifies a data stream + * Performs one or more data stream modification actions in a single atomic + * operation. * * @see Documentation @@ -932,7 +966,8 @@ public ModifyDataStreamResponse modifyDataStream(ModifyDataStreamRequest request } /** - * Modifies a data stream + * Performs one or more data stream modification actions in a single atomic + * operation. * * @param fn * a function that initializes a builder to create the @@ -951,7 +986,7 @@ public final ModifyDataStreamResponse modifyDataStream( // ----- Endpoint: indices.put_alias /** - * Creates or updates an alias. + * Adds a data stream or index to an alias. * * @see Documentation @@ -966,7 +1001,7 @@ public PutAliasResponse putAlias(PutAliasRequest request) throws IOException, El } /** - * Creates or updates an alias. + * Adds a data stream or index to an alias. * * @param fn * a function that initializes a builder to create the @@ -984,7 +1019,7 @@ public final PutAliasResponse putAlias(FunctionDocumentation @@ -1000,7 +1035,7 @@ public PutDataLifecycleResponse putDataLifecycle(PutDataLifecycleRequest request } /** - * Updates the data stream lifecycle of the selected data streams. + * Update the data lifecycle of the specified data streams. * * @param fn * a function that initializes a builder to create the @@ -1019,7 +1054,8 @@ public final PutDataLifecycleResponse putDataLifecycle( // ----- Endpoint: indices.put_index_template /** - * Creates or updates an index template. + * Creates or updates an index template. Index templates define settings, + * mappings, and aliases that can be applied automatically to new indices. * * @see Documentation @@ -1035,7 +1071,8 @@ public PutIndexTemplateResponse putIndexTemplate(PutIndexTemplateRequest request } /** - * Creates or updates an index template. + * Creates or updates an index template. Index templates define settings, + * mappings, and aliases that can be applied automatically to new indices. * * @param fn * a function that initializes a builder to create the @@ -1054,7 +1091,9 @@ public final PutIndexTemplateResponse putIndexTemplate( // ----- Endpoint: indices.put_mapping /** - * Updates the index mappings. + * Adds new fields to an existing data stream or index. You can also use this + * API to change the search settings of existing fields. For data streams, these + * changes are applied to all backing indices by default. * * @see Documentation @@ -1069,7 +1108,9 @@ public PutMappingResponse putMapping(PutMappingRequest request) throws IOExcepti } /** - * Updates the index mappings. + * Adds new fields to an existing data stream or index. You can also use this + * API to change the search settings of existing fields. For data streams, these + * changes are applied to all backing indices by default. * * @param fn * a function that initializes a builder to create the @@ -1087,7 +1128,8 @@ public final PutMappingResponse putMapping(FunctionDocumentation @@ -1103,7 +1145,8 @@ public PutIndicesSettingsResponse putSettings(PutIndicesSettingsRequest request) } /** - * Updates the index settings. + * Changes a dynamic index setting in real time. For data streams, index setting + * changes are applied to all backing indices by default. * * @param fn * a function that initializes a builder to create the @@ -1120,7 +1163,8 @@ public final PutIndicesSettingsResponse putSettings( } /** - * Updates the index settings. + * Changes a dynamic index setting in real time. For data streams, index setting + * changes are applied to all backing indices by default. * * @see Documentation @@ -1135,7 +1179,8 @@ public PutIndicesSettingsResponse putSettings() throws IOException, Elasticsearc // ----- Endpoint: indices.put_template /** - * Creates or updates an index template. + * Creates or updates an index template. Index templates define settings, + * mappings, and aliases that can be applied automatically to new indices. * * @see Documentation @@ -1150,7 +1195,8 @@ public PutTemplateResponse putTemplate(PutTemplateRequest request) throws IOExce } /** - * Creates or updates an index template. + * Creates or updates an index template. Index templates define settings, + * mappings, and aliases that can be applied automatically to new indices. * * @param fn * a function that initializes a builder to create the @@ -1169,7 +1215,9 @@ public final PutTemplateResponse putTemplate( // ----- Endpoint: indices.refresh /** - * Performs the refresh operation in one or more indices. + * A refresh makes recent operations performed on one or more indices available + * for search. For data streams, the API runs the refresh operation on the + * stream’s backing indices. * * @see Documentation @@ -1184,7 +1232,9 @@ public RefreshResponse refresh(RefreshRequest request) throws IOException, Elast } /** - * Performs the refresh operation in one or more indices. + * A refresh makes recent operations performed on one or more indices available + * for search. For data streams, the API runs the refresh operation on the + * stream’s backing indices. * * @param fn * a function that initializes a builder to create the @@ -1200,7 +1250,9 @@ public final RefreshResponse refresh(FunctionDocumentation @@ -1215,7 +1267,8 @@ public RefreshResponse refresh() throws IOException, ElasticsearchException { // ----- Endpoint: indices.resolve_index /** - * Returns information about any matching indices, aliases, and data streams + * Resolves the specified name(s) and/or index patterns for indices, aliases, + * and data streams. Multiple patterns and remote clusters are supported. * * @see Documentation @@ -1230,7 +1283,8 @@ public ResolveIndexResponse resolveIndex(ResolveIndexRequest request) throws IOE } /** - * Returns information about any matching indices, aliases, and data streams + * Resolves the specified name(s) and/or index patterns for indices, aliases, + * and data streams. Multiple patterns and remote clusters are supported. * * @param fn * a function that initializes a builder to create the @@ -1249,11 +1303,10 @@ public final ResolveIndexResponse resolveIndex( // ----- Endpoint: indices.rollover /** - * Updates an alias to point to a new index when the existing index is - * considered to be too large or too old. + * Creates a new index for a data stream or index alias. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-rollover-index.html">Documentation * on elastic.co */ @@ -1265,14 +1318,13 @@ public RolloverResponse rollover(RolloverRequest request) throws IOException, El } /** - * Updates an alias to point to a new index when the existing index is - * considered to be too large or too old. + * Creates a new index for a data stream or index alias. * * @param fn * a function that initializes a builder to create the * {@link RolloverRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/indices-rollover-index.html">Documentation * on elastic.co */ @@ -1284,9 +1336,7 @@ public final RolloverResponse rollover(FunctionDocumentation * on elastic.co @@ -1301,9 +1351,7 @@ public SimulateIndexTemplateResponse simulateIndexTemplate(SimulateIndexTemplate } /** - * Simulate matching the given index name against the index templates in the - * system - * + * * @param fn * a function that initializes a builder to create the * {@link SimulateIndexTemplateRequest} @@ -1321,7 +1369,8 @@ public final SimulateIndexTemplateResponse simulateIndexTemplate( // ----- Endpoint: indices.simulate_template /** - * Simulate resolving the given template name or body + * Returns the index configuration that would be applied by a particular index + * template. * * @see Documentation @@ -1337,7 +1386,8 @@ public SimulateTemplateResponse simulateTemplate(SimulateTemplateRequest request } /** - * Simulate resolving the given template name or body + * Returns the index configuration that would be applied by a particular index + * template. * * @param fn * a function that initializes a builder to create the @@ -1354,7 +1404,8 @@ public final SimulateTemplateResponse simulateTemplate( } /** - * Simulate resolving the given template name or body + * Returns the index configuration that would be applied by a particular index + * template. * * @see Documentation @@ -1369,7 +1420,7 @@ public SimulateTemplateResponse simulateTemplate() throws IOException, Elasticse // ----- Endpoint: indices.update_aliases /** - * Updates index aliases. + * Adds a data stream or index to an alias. * * @see Documentation @@ -1385,7 +1436,7 @@ public UpdateAliasesResponse updateAliases(UpdateAliasesRequest request) } /** - * Updates index aliases. + * Adds a data stream or index to an alias. * * @param fn * a function that initializes a builder to create the @@ -1402,7 +1453,7 @@ public final UpdateAliasesResponse updateAliases( } /** - * Updates index aliases. + * Adds a data stream or index to an alias. * * @see Documentation @@ -1417,7 +1468,7 @@ public UpdateAliasesResponse updateAliases() throws IOException, ElasticsearchEx // ----- Endpoint: indices.validate_query /** - * Allows a user to validate a potentially expensive query without executing it. + * Validates a potentially expensive query without executing it. * * @see Documentation @@ -1433,7 +1484,7 @@ public ValidateQueryResponse validateQuery(ValidateQueryRequest request) } /** - * Allows a user to validate a potentially expensive query without executing it. + * Validates a potentially expensive query without executing it. * * @param fn * a function that initializes a builder to create the @@ -1450,7 +1501,7 @@ public final ValidateQueryResponse validateQuery( } /** - * Allows a user to validate a potentially expensive query without executing it. + * Validates a potentially expensive query without executing it. * * @see Documentation diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsTemplateRequest.java deleted file mode 100644 index 380c4ebde..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsTemplateRequest.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.BooleanEndpoint; -import co.elastic.clients.transport.endpoints.BooleanResponse; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -// typedef: indices.exists_template.Request - -/** - * Returns information about whether a particular index template exists. - * - * @see API - * specification - */ - -public class ExistsTemplateRequest extends RequestBase { - @Nullable - private final Boolean flatSettings; - - @Nullable - private final Boolean local; - - @Nullable - private final Time masterTimeout; - - private final List name; - - // --------------------------------------------------------------------------------------------- - - private ExistsTemplateRequest(Builder builder) { - - this.flatSettings = builder.flatSettings; - this.local = builder.local; - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); - - } - - public static ExistsTemplateRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Return settings in flat format (default: false) - *

- * API name: {@code flat_settings} - */ - @Nullable - public final Boolean flatSettings() { - return this.flatSettings; - } - - /** - * Return local information, do not retrieve the state from master node - * (default: false) - *

- * API name: {@code local} - */ - @Nullable - public final Boolean local() { - return this.local; - } - - /** - * Explicit operation timeout for connection to master node - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Required - The comma separated names of the index templates - *

- * API name: {@code name} - */ - public final List name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ExistsTemplateRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean flatSettings; - - @Nullable - private Boolean local; - - @Nullable - private Time masterTimeout; - - private List name; - - /** - * Return settings in flat format (default: false) - *

- * API name: {@code flat_settings} - */ - public final Builder flatSettings(@Nullable Boolean value) { - this.flatSettings = value; - return this; - } - - /** - * Return local information, do not retrieve the state from master node - * (default: false) - *

- * API name: {@code local} - */ - public final Builder local(@Nullable Boolean value) { - this.local = value; - return this; - } - - /** - * Explicit operation timeout for connection to master node - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Explicit operation timeout for connection to master node - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Required - The comma separated names of the index templates - *

- * API name: {@code name} - *

- * Adds all elements of list to name. - */ - public final Builder name(List list) { - this.name = _listAddAll(this.name, list); - return this; - } - - /** - * Required - The comma separated names of the index templates - *

- * API name: {@code name} - *

- * Adds one or more values to name. - */ - public final Builder name(String value, String... values) { - this.name = _listAdd(this.name, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ExistsTemplateRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ExistsTemplateRequest build() { - _checkSingleUse(); - - return new ExistsTemplateRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.exists_template}". - */ - public static final Endpoint _ENDPOINT = new BooleanEndpoint<>( - "es/indices.exists_template", - - // Request method - request -> { - return "HEAD"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_template"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - propsSet |= _name; - - if (propsSet == (_name)) { - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, null); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetTemplateRequest.java deleted file mode 100644 index 85ef8c5c5..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetTemplateRequest.java +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; -import java.lang.String; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -// typedef: indices.get_template.Request - -/** - * Retrieves information about one or more index templates. - * - * @see API - * specification - */ - -public class GetTemplateRequest extends RequestBase { - @Nullable - private final Boolean flatSettings; - - @Nullable - private final Boolean local; - - @Nullable - private final Time masterTimeout; - - private final List name; - - // --------------------------------------------------------------------------------------------- - - private GetTemplateRequest(Builder builder) { - - this.flatSettings = builder.flatSettings; - this.local = builder.local; - this.masterTimeout = builder.masterTimeout; - this.name = ApiTypeHelper.unmodifiable(builder.name); - - } - - public static GetTemplateRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - @Nullable - public final Boolean flatSettings() { - return this.flatSettings; - } - - /** - * If true, the request retrieves information from the local node - * only. - *

- * API name: {@code local} - */ - @Nullable - public final Boolean local() { - return this.local; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - @Nullable - public final Time masterTimeout() { - return this.masterTimeout; - } - - /** - * Comma-separated list of index template names used to limit the request. - * Wildcard (*) expressions are supported. To return all index - * templates, omit this parameter or use a value of _all or - * *. - *

- * API name: {@code name} - */ - public final List name() { - return this.name; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetTemplateRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - @Nullable - private Boolean flatSettings; - - @Nullable - private Boolean local; - - @Nullable - private Time masterTimeout; - - @Nullable - private List name; - - /** - * If true, returns settings in flat format. - *

- * API name: {@code flat_settings} - */ - public final Builder flatSettings(@Nullable Boolean value) { - this.flatSettings = value; - return this; - } - - /** - * If true, the request retrieves information from the local node - * only. - *

- * API name: {@code local} - */ - public final Builder local(@Nullable Boolean value) { - this.local = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(@Nullable Time value) { - this.masterTimeout = value; - return this; - } - - /** - * Period to wait for a connection to the master node. If no response is - * received before the timeout expires, the request fails and returns an error. - *

- * API name: {@code master_timeout} - */ - public final Builder masterTimeout(Function> fn) { - return this.masterTimeout(fn.apply(new Time.Builder()).build()); - } - - /** - * Comma-separated list of index template names used to limit the request. - * Wildcard (*) expressions are supported. To return all index - * templates, omit this parameter or use a value of _all or - * *. - *

- * API name: {@code name} - *

- * Adds all elements of list to name. - */ - public final Builder name(List list) { - this.name = _listAddAll(this.name, list); - return this; - } - - /** - * Comma-separated list of index template names used to limit the request. - * Wildcard (*) expressions are supported. To return all index - * templates, omit this parameter or use a value of _all or - * *. - *

- * API name: {@code name} - *

- * Adds one or more values to name. - */ - public final Builder name(String value, String... values) { - this.name = _listAdd(this.name, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetTemplateRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetTemplateRequest build() { - _checkSingleUse(); - - return new GetTemplateRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code indices.get_template}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/indices.get_template", - - // Request method - request -> { - return "GET"; - - }, - - // Request path - request -> { - final int _name = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.name())) - propsSet |= _name; - - if (propsSet == 0) { - StringBuilder buf = new StringBuilder(); - buf.append("/_template"); - return buf.toString(); - } - if (propsSet == (_name)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_template"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _name = 1 << 0; - - int propsSet = 0; - - if (ApiTypeHelper.isDefined(request.name())) - propsSet |= _name; - - if (propsSet == 0) { - } - if (propsSet == (_name)) { - params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - Map params = new HashMap<>(); - if (request.masterTimeout != null) { - params.put("master_timeout", request.masterTimeout._toJsonString()); - } - if (request.flatSettings != null) { - params.put("flat_settings", String.valueOf(request.flatSettings)); - } - if (request.local != null) { - params.put("local", String.valueOf(request.local)); - } - return params; - - }, SimpleEndpoint.emptyMap(), false, GetTemplateResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetTemplateResponse.java deleted file mode 100644 index 71d677396..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetTemplateResponse.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import jakarta.json.stream.JsonParser; -import java.lang.String; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: indices.get_template.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class GetTemplateResponse implements JsonpSerializable { - private final Map result; - - // --------------------------------------------------------------------------------------------- - - private GetTemplateResponse(Builder builder) { - - this.result = ApiTypeHelper.unmodifiableRequired(builder.result, this, "result"); - - } - - public static GetTemplateResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Response value. - */ - public final Map result() { - return this.result; - } - - /** - * Get an element of {@code result}. - */ - public final @Nullable TemplateMapping get(String key) { - return this.result.get(key); - } - - /** - * Serialize this value to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - for (Map.Entry item0 : this.result.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GetTemplateResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private Map result = new HashMap<>(); - - /** - * Required - Response value. - *

- * Adds all entries of map to result. - */ - public final Builder result(Map map) { - this.result = _mapPutAll(this.result, map); - return this; - } - - /** - * Required - Response value. - *

- * Adds an entry to result. - */ - public final Builder result(String key, TemplateMapping value) { - this.result = _mapPut(this.result, key, value); - return this; - } - - /** - * Required - Response value. - *

- * Adds an entry to result using a builder lambda. - */ - public final Builder result(String key, Function> fn) { - return result(key, fn.apply(new TemplateMapping.Builder()).build()); - } - - @Override - public Builder withJson(JsonParser parser, JsonpMapper mapper) { - - @SuppressWarnings("unchecked") - Map value = (Map) JsonpDeserializer - .stringMapDeserializer(TemplateMapping._DESERIALIZER).deserialize(parser, mapper); - return this.result(value); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link GetTemplateResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GetTemplateResponse build() { - _checkSingleUse(); - - return new GetTemplateResponse(this); - } - } - - public static final JsonpDeserializer _DESERIALIZER = createGetTemplateResponseDeserializer(); - protected static JsonpDeserializer createGetTemplateResponseDeserializer() { - - JsonpDeserializer> valueDeserializer = JsonpDeserializer - .stringMapDeserializer(TemplateMapping._DESERIALIZER); - - return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() - .result(valueDeserializer.deserialize(parser, mapper, event)).build()); - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java index 01c9bbf02..63fe19942 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java @@ -64,7 +64,7 @@ /** * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/index-modules.html#index-modules-settings">Documentation * on elastic.co * @see API * specification @@ -225,8 +225,7 @@ public class IndexSettings implements JsonpSerializable { @Nullable private final Queries queries; - @Nullable - private final SettingsSimilarity similarity; + private final Map similarity; @Nullable private final MappingLimitSettings mapping; @@ -297,7 +296,7 @@ private IndexSettings(Builder builder) { this.settings = builder.settings; this.timeSeries = builder.timeSeries; this.queries = builder.queries; - this.similarity = builder.similarity; + this.similarity = ApiTypeHelper.unmodifiable(builder.similarity); this.mapping = builder.mapping; this.indexingSlowlog = builder.indexingSlowlog; this.indexingPressure = builder.indexingPressure; @@ -735,8 +734,7 @@ public final Queries queries() { *

* API name: {@code similarity} */ - @Nullable - public final SettingsSimilarity similarity() { + public final Map similarity() { return this.similarity; } @@ -1054,9 +1052,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { this.queries.serialize(generator, mapper); } - if (this.similarity != null) { + if (ApiTypeHelper.isDefined(this.similarity)) { generator.writeKey("similarity"); - this.similarity.serialize(generator, mapper); + generator.writeStartObject(); + for (Map.Entry item0 : this.similarity.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); } if (this.mapping != null) { @@ -1277,7 +1281,7 @@ public final Builder otherSettings(String key, JsonData value) { private Queries queries; @Nullable - private SettingsSimilarity similarity; + private Map similarity; @Nullable private MappingLimitSettings mapping; @@ -1858,9 +1862,11 @@ public final Builder queries(Function> f * scored. *

* API name: {@code similarity} + *

+ * Adds all entries of map to similarity. */ - public final Builder similarity(@Nullable SettingsSimilarity value) { - this.similarity = value; + public final Builder similarity(Map map) { + this.similarity = _mapPutAll(this.similarity, map); return this; } @@ -1869,9 +1875,25 @@ public final Builder similarity(@Nullable SettingsSimilarity value) { * scored. *

* API name: {@code similarity} + *

+ * Adds an entry to similarity. + */ + public final Builder similarity(String key, SettingsSimilarity value) { + this.similarity = _mapPut(this.similarity, key, value); + return this; + } + + /** + * Configure custom similarity settings to customize how search results are + * scored. + *

+ * API name: {@code similarity} + *

+ * Adds an entry to similarity using a builder lambda. */ - public final Builder similarity(Function> fn) { - return this.similarity(fn.apply(new SettingsSimilarity.Builder()).build()); + public final Builder similarity(String key, + Function> fn) { + return similarity(key, fn.apply(new SettingsSimilarity.Builder()).build()); } /** @@ -2030,7 +2052,8 @@ protected static void setupIndexSettingsDeserializer(ObjectDeserializer * API name: {@code name} */ + @Nullable public final String name() { return this.name; } @@ -179,9 +180,11 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey("name"); - generator.write(this.name); + if (this.name != null) { + generator.writeKey("name"); + generator.write(this.name); + } if (this.indexingComplete != null) { generator.writeKey("indexing_complete"); generator.write(this.indexingComplete); @@ -224,6 +227,7 @@ public String toString() { public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable private String name; @Nullable @@ -242,12 +246,12 @@ public static class Builder extends WithJsonObjectBuilderBase private String rolloverAlias; /** - * Required - The name of the policy to use to manage the index. For information - * about how Elasticsearch applies policy changes, see Policy updates. + * The name of the policy to use to manage the index. For information about how + * Elasticsearch applies policy changes, see Policy updates. *

* API name: {@code name} */ - public final Builder name(String value) { + public final Builder name(@Nullable String value) { this.name = value; return this; } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettings.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettings.java index e72578718..f6848141d 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettings.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettings.java @@ -55,7 +55,7 @@ * Mapping Limit Settings * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/mapping-settings-limit.html">Documentation * on elastic.co * @see API diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDepth.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDepth.java index 0d711c469..61b93c9ce 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDepth.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDepth.java @@ -29,7 +29,7 @@ import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; +import java.lang.Long; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -60,7 +60,7 @@ @JsonpDeserializable public class MappingLimitSettingsDepth implements JsonpSerializable { @Nullable - private final Integer limit; + private final Long limit; // --------------------------------------------------------------------------------------------- @@ -83,7 +83,7 @@ public static MappingLimitSettingsDepth of(Function implements ObjectBuilder { @Nullable - private Integer limit; + private Long limit; /** * The maximum depth for a field, which is measured as the number of inner @@ -131,7 +131,7 @@ public static class Builder extends WithJsonObjectBuilderBase *

* API name: {@code limit} */ - public final Builder limit(@Nullable Integer value) { + public final Builder limit(@Nullable Long value) { this.limit = value; return this; } @@ -165,7 +165,7 @@ public MappingLimitSettingsDepth build() { protected static void setupMappingLimitSettingsDepthDeserializer( ObjectDeserializer op) { - op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit"); + op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDimensionFields.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDimensionFields.java index a5aea4eff..52de5458e 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDimensionFields.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDimensionFields.java @@ -29,7 +29,7 @@ import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; +import java.lang.Long; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -60,7 +60,7 @@ @JsonpDeserializable public class MappingLimitSettingsDimensionFields implements JsonpSerializable { @Nullable - private final Integer limit; + private final Long limit; // --------------------------------------------------------------------------------------------- @@ -84,7 +84,7 @@ public static MappingLimitSettingsDimensionFields of( * API name: {@code limit} */ @Nullable - public final Integer limit() { + public final Long limit() { return this.limit; } @@ -122,7 +122,7 @@ public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { @Nullable - private Integer limit; + private Long limit; /** * [preview] This functionality is in technical preview and may be changed or @@ -132,7 +132,7 @@ public static class Builder extends WithJsonObjectBuilderBase *

* API name: {@code limit} */ - public final Builder limit(@Nullable Integer value) { + public final Builder limit(@Nullable Long value) { this.limit = value; return this; } @@ -167,7 +167,7 @@ public MappingLimitSettingsDimensionFields build() { protected static void setupMappingLimitSettingsDimensionFieldsDeserializer( ObjectDeserializer op) { - op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit"); + op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedFields.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedFields.java index 707160c6a..7bff31845 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedFields.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedFields.java @@ -29,7 +29,7 @@ import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; +import java.lang.Long; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -60,7 +60,7 @@ @JsonpDeserializable public class MappingLimitSettingsNestedFields implements JsonpSerializable { @Nullable - private final Integer limit; + private final Long limit; // --------------------------------------------------------------------------------------------- @@ -84,7 +84,7 @@ public static MappingLimitSettingsNestedFields of( * API name: {@code limit} */ @Nullable - public final Integer limit() { + public final Long limit() { return this.limit; } @@ -122,7 +122,7 @@ public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { @Nullable - private Integer limit; + private Long limit; /** * The maximum number of distinct nested mappings in an index. The nested type @@ -132,7 +132,7 @@ public static class Builder extends WithJsonObjectBuilderBase *

* API name: {@code limit} */ - public final Builder limit(@Nullable Integer value) { + public final Builder limit(@Nullable Long value) { this.limit = value; return this; } @@ -166,7 +166,7 @@ public MappingLimitSettingsNestedFields build() { protected static void setupMappingLimitSettingsNestedFieldsDeserializer( ObjectDeserializer op) { - op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit"); + op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedObjects.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedObjects.java index 68753110a..d29c6b76a 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedObjects.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedObjects.java @@ -29,7 +29,7 @@ import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; +import java.lang.Long; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -60,7 +60,7 @@ @JsonpDeserializable public class MappingLimitSettingsNestedObjects implements JsonpSerializable { @Nullable - private final Integer limit; + private final Long limit; // --------------------------------------------------------------------------------------------- @@ -83,7 +83,7 @@ public static MappingLimitSettingsNestedObjects of( * API name: {@code limit} */ @Nullable - public final Integer limit() { + public final Long limit() { return this.limit; } @@ -121,7 +121,7 @@ public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { @Nullable - private Integer limit; + private Long limit; /** * The maximum number of nested JSON objects that a single document can contain @@ -130,7 +130,7 @@ public static class Builder extends WithJsonObjectBuilderBase *

* API name: {@code limit} */ - public final Builder limit(@Nullable Integer value) { + public final Builder limit(@Nullable Long value) { this.limit = value; return this; } @@ -164,7 +164,7 @@ public MappingLimitSettingsNestedObjects build() { protected static void setupMappingLimitSettingsNestedObjectsDeserializer( ObjectDeserializer op) { - op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit"); + op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java index 7c532cb2f..ace492270 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java @@ -29,7 +29,8 @@ import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; +import java.lang.Boolean; +import java.lang.Long; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -60,13 +61,17 @@ @JsonpDeserializable public class MappingLimitSettingsTotalFields implements JsonpSerializable { @Nullable - private final Integer limit; + private final Long limit; + + @Nullable + private final Boolean ignoreDynamicBeyondLimit; // --------------------------------------------------------------------------------------------- private MappingLimitSettingsTotalFields(Builder builder) { this.limit = builder.limit; + this.ignoreDynamicBeyondLimit = builder.ignoreDynamicBeyondLimit; } @@ -85,10 +90,26 @@ public static MappingLimitSettingsTotalFields of( * API name: {@code limit} */ @Nullable - public final Integer limit() { + public final Long limit() { return this.limit; } + /** + * This setting determines what happens when a dynamically mapped field would + * exceed the total fields limit. When set to false (the default), the index + * request of the document that tries to add a dynamic field to the mapping will + * fail with the message Limit of total fields [X] has been exceeded. When set + * to true, the index request will not fail. Instead, fields that would exceed + * the limit are not added to the mapping, similar to dynamic: false. The fields + * that were not added to the mapping will be added to the _ignored field. + *

+ * API name: {@code ignore_dynamic_beyond_limit} + */ + @Nullable + public final Boolean ignoreDynamicBeyondLimit() { + return this.ignoreDynamicBeyondLimit; + } + /** * Serialize this object to JSON. */ @@ -105,6 +126,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.limit); } + if (this.ignoreDynamicBeyondLimit != null) { + generator.writeKey("ignore_dynamic_beyond_limit"); + generator.write(this.ignoreDynamicBeyondLimit); + + } } @@ -123,7 +149,10 @@ public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { @Nullable - private Integer limit; + private Long limit; + + @Nullable + private Boolean ignoreDynamicBeyondLimit; /** * The maximum number of fields in an index. Field and object mappings, as well @@ -134,11 +163,27 @@ public static class Builder extends WithJsonObjectBuilderBase *

* API name: {@code limit} */ - public final Builder limit(@Nullable Integer value) { + public final Builder limit(@Nullable Long value) { this.limit = value; return this; } + /** + * This setting determines what happens when a dynamically mapped field would + * exceed the total fields limit. When set to false (the default), the index + * request of the document that tries to add a dynamic field to the mapping will + * fail with the message Limit of total fields [X] has been exceeded. When set + * to true, the index request will not fail. Instead, fields that would exceed + * the limit are not added to the mapping, similar to dynamic: false. The fields + * that were not added to the mapping will be added to the _ignored field. + *

+ * API name: {@code ignore_dynamic_beyond_limit} + */ + public final Builder ignoreDynamicBeyondLimit(@Nullable Boolean value) { + this.ignoreDynamicBeyondLimit = value; + return this; + } + @Override protected Builder self() { return this; @@ -168,7 +213,9 @@ public MappingLimitSettingsTotalFields build() { protected static void setupMappingLimitSettingsTotalFieldsDeserializer( ObjectDeserializer op) { - op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit"); + op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); + op.add(Builder::ignoreDynamicBeyondLimit, JsonpDeserializer.booleanDeserializer(), + "ignore_dynamic_beyond_limit"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateRequest.java index b6e50f6d0..43d8b6e9d 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateRequest.java @@ -21,6 +21,7 @@ import co.elastic.clients.elasticsearch._types.ErrorResponse; import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.elasticsearch.indices.put_index_template.IndexTemplateMapping; import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpDeserializable; @@ -35,7 +36,6 @@ import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; import java.lang.Boolean; -import java.lang.Integer; import java.lang.Long; import java.lang.String; import java.util.HashMap; @@ -74,6 +74,12 @@ public class PutIndexTemplateRequest extends RequestBase implements JsonpSerializable { private final Map meta; + @Nullable + private final Boolean allowAutoCreate; + + @Nullable + private final String cause; + private final List composedOf; @Nullable @@ -82,12 +88,20 @@ public class PutIndexTemplateRequest extends RequestBase implements JsonpSeriali @Nullable private final DataStreamVisibility dataStream; + @Nullable + private final Boolean deprecated; + + private final List ignoreMissingComponentTemplates; + private final List indexPatterns; + @Nullable + private final Time masterTimeout; + private final String name; @Nullable - private final Integer priority; + private final Long priority; @Nullable private final IndexTemplateMapping template; @@ -100,10 +114,15 @@ public class PutIndexTemplateRequest extends RequestBase implements JsonpSeriali private PutIndexTemplateRequest(Builder builder) { this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.allowAutoCreate = builder.allowAutoCreate; + this.cause = builder.cause; this.composedOf = ApiTypeHelper.unmodifiable(builder.composedOf); this.create = builder.create; this.dataStream = builder.dataStream; + this.deprecated = builder.deprecated; + this.ignoreMissingComponentTemplates = ApiTypeHelper.unmodifiable(builder.ignoreMissingComponentTemplates); this.indexPatterns = ApiTypeHelper.unmodifiable(builder.indexPatterns); + this.masterTimeout = builder.masterTimeout; this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); this.priority = builder.priority; this.template = builder.template; @@ -125,6 +144,31 @@ public final Map meta() { return this.meta; } + /** + * This setting overrides the value of the action.auto_create_index + * cluster setting. If set to true in a template, then indices can + * be automatically created using that template even if auto-creation of indices + * is disabled via actions.auto_create_index. If set to + * false, then indices or data streams matching the template must + * always be explicitly created, and may never be automatically created. + *

+ * API name: {@code allow_auto_create} + */ + @Nullable + public final Boolean allowAutoCreate() { + return this.allowAutoCreate; + } + + /** + * User defined reason for creating/updating the index template + *

+ * API name: {@code cause} + */ + @Nullable + public final String cause() { + return this.cause; + } + /** * An ordered list of component template names. Component templates are merged * in the order specified, meaning that the last component template specified @@ -159,6 +203,28 @@ public final DataStreamVisibility dataStream() { return this.dataStream; } + /** + * Marks this index template as deprecated. When creating or updating a + * non-deprecated index template that uses deprecated components, Elasticsearch + * will emit a deprecation warning. + *

+ * API name: {@code deprecated} + */ + @Nullable + public final Boolean deprecated() { + return this.deprecated; + } + + /** + * The configuration option ignore_missing_component_templates can be used when + * an index template references a component template that might not exist + *

+ * API name: {@code ignore_missing_component_templates} + */ + public final List ignoreMissingComponentTemplates() { + return this.ignoreMissingComponentTemplates; + } + /** * Name of the index template to create. *

@@ -168,6 +234,17 @@ public final List indexPatterns() { return this.indexPatterns; } + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + /** * Required - Index or template name *

@@ -187,7 +264,7 @@ public final String name() { * API name: {@code priority} */ @Nullable - public final Integer priority() { + public final Long priority() { return this.priority; } @@ -234,6 +311,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } generator.writeEnd(); + } + if (this.allowAutoCreate != null) { + generator.writeKey("allow_auto_create"); + generator.write(this.allowAutoCreate); + } if (ApiTypeHelper.isDefined(this.composedOf)) { generator.writeKey("composed_of"); @@ -249,6 +331,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("data_stream"); this.dataStream.serialize(generator, mapper); + } + if (this.deprecated != null) { + generator.writeKey("deprecated"); + generator.write(this.deprecated); + + } + if (ApiTypeHelper.isDefined(this.ignoreMissingComponentTemplates)) { + generator.writeKey("ignore_missing_component_templates"); + generator.writeStartArray(); + for (String item0 : this.ignoreMissingComponentTemplates) { + generator.write(item0); + + } + generator.writeEnd(); + } if (ApiTypeHelper.isDefined(this.indexPatterns)) { generator.writeKey("index_patterns"); @@ -290,6 +387,12 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private Map meta; + @Nullable + private Boolean allowAutoCreate; + + @Nullable + private String cause; + @Nullable private List composedOf; @@ -299,13 +402,22 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private DataStreamVisibility dataStream; + @Nullable + private Boolean deprecated; + + @Nullable + private List ignoreMissingComponentTemplates; + @Nullable private List indexPatterns; + @Nullable + private Time masterTimeout; + private String name; @Nullable - private Integer priority; + private Long priority; @Nullable private IndexTemplateMapping template; @@ -339,6 +451,31 @@ public final Builder meta(String key, JsonData value) { return this; } + /** + * This setting overrides the value of the action.auto_create_index + * cluster setting. If set to true in a template, then indices can + * be automatically created using that template even if auto-creation of indices + * is disabled via actions.auto_create_index. If set to + * false, then indices or data streams matching the template must + * always be explicitly created, and may never be automatically created. + *

+ * API name: {@code allow_auto_create} + */ + public final Builder allowAutoCreate(@Nullable Boolean value) { + this.allowAutoCreate = value; + return this; + } + + /** + * User defined reason for creating/updating the index template + *

+ * API name: {@code cause} + */ + public final Builder cause(@Nullable String value) { + this.cause = value; + return this; + } + /** * An ordered list of component template names. Component templates are merged * in the order specified, meaning that the last component template specified @@ -402,6 +539,45 @@ public final Builder dataStream( return this.dataStream(fn.apply(new DataStreamVisibility.Builder()).build()); } + /** + * Marks this index template as deprecated. When creating or updating a + * non-deprecated index template that uses deprecated components, Elasticsearch + * will emit a deprecation warning. + *

+ * API name: {@code deprecated} + */ + public final Builder deprecated(@Nullable Boolean value) { + this.deprecated = value; + return this; + } + + /** + * The configuration option ignore_missing_component_templates can be used when + * an index template references a component template that might not exist + *

+ * API name: {@code ignore_missing_component_templates} + *

+ * Adds all elements of list to + * ignoreMissingComponentTemplates. + */ + public final Builder ignoreMissingComponentTemplates(List list) { + this.ignoreMissingComponentTemplates = _listAddAll(this.ignoreMissingComponentTemplates, list); + return this; + } + + /** + * The configuration option ignore_missing_component_templates can be used when + * an index template references a component template that might not exist + *

+ * API name: {@code ignore_missing_component_templates} + *

+ * Adds one or more values to ignoreMissingComponentTemplates. + */ + public final Builder ignoreMissingComponentTemplates(String value, String... values) { + this.ignoreMissingComponentTemplates = _listAdd(this.ignoreMissingComponentTemplates, value, values); + return this; + } + /** * Name of the index template to create. *

@@ -426,6 +602,27 @@ public final Builder indexPatterns(String value, String... values) { return this; } + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + /** * Required - Index or template name *

@@ -445,7 +642,7 @@ public final Builder name(String value) { *

* API name: {@code priority} */ - public final Builder priority(@Nullable Integer value) { + public final Builder priority(@Nullable Long value) { this.priority = value; return this; } @@ -512,12 +709,17 @@ protected static void setupPutIndexTemplateRequestDeserializer( ObjectDeserializer op) { op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); + op.add(Builder::allowAutoCreate, JsonpDeserializer.booleanDeserializer(), "allow_auto_create"); op.add(Builder::composedOf, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "composed_of"); op.add(Builder::dataStream, DataStreamVisibility._DESERIALIZER, "data_stream"); + op.add(Builder::deprecated, JsonpDeserializer.booleanDeserializer(), "deprecated"); + op.add(Builder::ignoreMissingComponentTemplates, + JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "ignore_missing_component_templates"); op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "index_patterns"); - op.add(Builder::priority, JsonpDeserializer.integerDeserializer(), "priority"); + op.add(Builder::priority, JsonpDeserializer.longDeserializer(), "priority"); op.add(Builder::template, IndexTemplateMapping._DESERIALIZER, "template"); op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); @@ -574,9 +776,15 @@ protected static void setupPutIndexTemplateRequestDeserializer( // Request parameters request -> { Map params = new HashMap<>(); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } if (request.create != null) { params.put("create", String.valueOf(request.create)); } + if (request.cause != null) { + params.put("cause", request.cause); + } return params; }, SimpleEndpoint.emptyMap(), true, PutIndexTemplateResponse._DESERIALIZER); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateRequest.java index 42236ece0..42a6bfe3b 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateRequest.java @@ -23,7 +23,6 @@ import co.elastic.clients.elasticsearch._types.RequestBase; import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; -import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -75,10 +74,10 @@ public class PutTemplateRequest extends RequestBase implements JsonpSerializable private final Map aliases; @Nullable - private final Boolean create; + private final String cause; @Nullable - private final Boolean flatSettings; + private final Boolean create; private final List indexPatterns; @@ -93,10 +92,8 @@ public class PutTemplateRequest extends RequestBase implements JsonpSerializable @Nullable private final Integer order; - private final Map settings; - @Nullable - private final Time timeout; + private final IndexSettings settings; @Nullable private final Long version; @@ -106,15 +103,14 @@ public class PutTemplateRequest extends RequestBase implements JsonpSerializable private PutTemplateRequest(Builder builder) { this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); + this.cause = builder.cause; this.create = builder.create; - this.flatSettings = builder.flatSettings; this.indexPatterns = ApiTypeHelper.unmodifiable(builder.indexPatterns); this.mappings = builder.mappings; this.masterTimeout = builder.masterTimeout; this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); this.order = builder.order; - this.settings = ApiTypeHelper.unmodifiable(builder.settings); - this.timeout = builder.timeout; + this.settings = builder.settings; this.version = builder.version; } @@ -133,23 +129,21 @@ public final Map aliases() { } /** - * If true, this request cannot replace or update existing index templates. - *

- * API name: {@code create} + * API name: {@code cause} */ @Nullable - public final Boolean create() { - return this.create; + public final String cause() { + return this.cause; } /** - * If true, returns settings in flat format. + * If true, this request cannot replace or update existing index templates. *

- * API name: {@code flat_settings} + * API name: {@code create} */ @Nullable - public final Boolean flatSettings() { - return this.flatSettings; + public final Boolean create() { + return this.create; } /** @@ -211,19 +205,9 @@ public final Integer order() { *

* API name: {@code settings} */ - public final Map settings() { - return this.settings; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ @Nullable - public final Time timeout() { - return this.timeout; + public final IndexSettings settings() { + return this.settings; } /** @@ -279,15 +263,9 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.order); } - if (ApiTypeHelper.isDefined(this.settings)) { + if (this.settings != null) { generator.writeKey("settings"); - generator.writeStartObject(); - for (Map.Entry item0 : this.settings.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); + this.settings.serialize(generator, mapper); } if (this.version != null) { @@ -311,10 +289,10 @@ public static class Builder extends RequestBase.AbstractBuilder private Map aliases; @Nullable - private Boolean create; + private String cause; @Nullable - private Boolean flatSettings; + private Boolean create; @Nullable private List indexPatterns; @@ -331,10 +309,7 @@ public static class Builder extends RequestBase.AbstractBuilder private Integer order; @Nullable - private Map settings; - - @Nullable - private Time timeout; + private IndexSettings settings; @Nullable private Long version; @@ -375,22 +350,20 @@ public final Builder aliases(String key, Function - * API name: {@code create} + * API name: {@code cause} */ - public final Builder create(@Nullable Boolean value) { - this.create = value; + public final Builder cause(@Nullable String value) { + this.cause = value; return this; } /** - * If true, returns settings in flat format. + * If true, this request cannot replace or update existing index templates. *

- * API name: {@code flat_settings} + * API name: {@code create} */ - public final Builder flatSettings(@Nullable Boolean value) { - this.flatSettings = value; + public final Builder create(@Nullable Boolean value) { + this.create = value; return this; } @@ -488,11 +461,9 @@ public final Builder order(@Nullable Integer value) { * Configuration options for the index. *

* API name: {@code settings} - *

- * Adds all entries of map to settings. */ - public final Builder settings(Map map) { - this.settings = _mapPutAll(this.settings, map); + public final Builder settings(@Nullable IndexSettings value) { + this.settings = value; return this; } @@ -500,33 +471,9 @@ public final Builder settings(Map map) { * Configuration options for the index. *

* API name: {@code settings} - *

- * Adds an entry to settings. */ - public final Builder settings(String key, JsonData value) { - this.settings = _mapPut(this.settings, key, value); - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(@Nullable Time value) { - this.timeout = value; - return this; - } - - /** - * Period to wait for a response. If no response is received before the timeout - * expires, the request fails and returns an error. - *

- * API name: {@code timeout} - */ - public final Builder timeout(Function> fn) { - return this.timeout(fn.apply(new Time.Builder()).build()); + public final Builder settings(Function> fn) { + return this.settings(fn.apply(new IndexSettings.Builder()).build()); } /** @@ -573,7 +520,7 @@ protected static void setupPutTemplateRequestDeserializer(ObjectDeserializer */ @JsonpDeserializable -public class SettingsSimilarity implements OpenTaggedUnion, JsonpSerializable { +public class SettingsSimilarity + implements + TaggedUnion, + JsonpSerializable { /** * {@link SettingsSimilarity} variant kinds. @@ -74,22 +75,21 @@ public class SettingsSimilarity implements OpenTaggedUnion"); this._value = ApiTypeHelper.requireNonNull(value, this, ""); - this._customKind = null; } @@ -130,7 +129,6 @@ private SettingsSimilarity(Builder builder) { this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); - this._customKind = builder._customKind; } @@ -139,165 +137,146 @@ public static SettingsSimilarity of(Function implements ObjectBuilder { private Kind _kind; - private Object _value; - private String _customKind; + private SettingsSimilarityVariant _value; @Override protected Builder self() { @@ -328,6 +306,17 @@ public ObjectBuilder bm25( return this.bm25(fn.apply(new SettingsSimilarityBm25.Builder()).build()); } + public ObjectBuilder boolean_(SettingsSimilarityBoolean v) { + this._kind = Kind.Boolean; + this._value = v; + return this; + } + + public ObjectBuilder boolean_( + Function> fn) { + return this.boolean_(fn.apply(new SettingsSimilarityBoolean.Builder()).build()); + } + public ObjectBuilder dfi(SettingsSimilarityDfi v) { this._kind = Kind.Dfi; this._value = v; @@ -361,53 +350,37 @@ public ObjectBuilder ib( return this.ib(fn.apply(new SettingsSimilarityIb.Builder()).build()); } - public ObjectBuilder lmd(SettingsSimilarityLmd v) { - this._kind = Kind.Lmd; + public ObjectBuilder lmdirichlet(SettingsSimilarityLmd v) { + this._kind = Kind.LMDirichlet; this._value = v; return this; } - public ObjectBuilder lmd( + public ObjectBuilder lmdirichlet( Function> fn) { - return this.lmd(fn.apply(new SettingsSimilarityLmd.Builder()).build()); + return this.lmdirichlet(fn.apply(new SettingsSimilarityLmd.Builder()).build()); } - public ObjectBuilder lmj(SettingsSimilarityLmj v) { - this._kind = Kind.Lmj; + public ObjectBuilder lmjelinekmercer(SettingsSimilarityLmj v) { + this._kind = Kind.LMJelinekMercer; this._value = v; return this; } - public ObjectBuilder lmj( + public ObjectBuilder lmjelinekmercer( Function> fn) { - return this.lmj(fn.apply(new SettingsSimilarityLmj.Builder()).build()); + return this.lmjelinekmercer(fn.apply(new SettingsSimilarityLmj.Builder()).build()); } - public ObjectBuilder scriptedTfidf(SettingsSimilarityScriptedTfidf v) { - this._kind = Kind.ScriptedTfidf; + public ObjectBuilder scripted(SettingsSimilarityScripted v) { + this._kind = Kind.Scripted; this._value = v; return this; } - public ObjectBuilder scriptedTfidf( - Function> fn) { - return this.scriptedTfidf(fn.apply(new SettingsSimilarityScriptedTfidf.Builder()).build()); - } - - /** - * Define this {@code SettingsSimilarity} as a plugin-defined variant. - * - * @param name - * the plugin-defined identifier - * @param data - * the data for this custom {@code SettingsSimilarity}. It is - * converted internally to {@link JsonData}. - */ - public ObjectBuilder _custom(String name, Object data) { - this._kind = Kind._Custom; - this._customKind = name; - this._value = JsonData.of(data); - return this; + public ObjectBuilder scripted( + Function> fn) { + return this.scripted(fn.apply(new SettingsSimilarityScripted.Builder()).build()); } public SettingsSimilarity build() { @@ -419,18 +392,16 @@ public SettingsSimilarity build() { protected static void setupSettingsSimilarityDeserializer(ObjectDeserializer op) { - op.add(Builder::bm25, SettingsSimilarityBm25._DESERIALIZER, "bm25"); - op.add(Builder::dfi, SettingsSimilarityDfi._DESERIALIZER, "dfi"); - op.add(Builder::dfr, SettingsSimilarityDfr._DESERIALIZER, "dfr"); - op.add(Builder::ib, SettingsSimilarityIb._DESERIALIZER, "ib"); - op.add(Builder::lmd, SettingsSimilarityLmd._DESERIALIZER, "lmd"); - op.add(Builder::lmj, SettingsSimilarityLmj._DESERIALIZER, "lmj"); - op.add(Builder::scriptedTfidf, SettingsSimilarityScriptedTfidf._DESERIALIZER, "scripted_tfidf"); - - op.setUnknownFieldHandler((builder, name, parser, mapper) -> { - JsonpUtils.ensureCustomVariantsAllowed(parser, mapper); - builder._custom(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); - }); + op.add(Builder::bm25, SettingsSimilarityBm25._DESERIALIZER, "BM25"); + op.add(Builder::boolean_, SettingsSimilarityBoolean._DESERIALIZER, "boolean"); + op.add(Builder::dfi, SettingsSimilarityDfi._DESERIALIZER, "DFI"); + op.add(Builder::dfr, SettingsSimilarityDfr._DESERIALIZER, "DFR"); + op.add(Builder::ib, SettingsSimilarityIb._DESERIALIZER, "IB"); + op.add(Builder::lmdirichlet, SettingsSimilarityLmd._DESERIALIZER, "LMDirichlet"); + op.add(Builder::lmjelinekmercer, SettingsSimilarityLmj._DESERIALIZER, "LMJelinekMercer"); + op.add(Builder::scripted, SettingsSimilarityScripted._DESERIALIZER, "scripted"); + + op.setTypeProperty("type", null); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBm25.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBm25.java index addd2cfb5..82ff73383 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBm25.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBm25.java @@ -26,7 +26,6 @@ import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; @@ -34,6 +33,7 @@ import java.lang.Double; import java.util.Objects; import java.util.function.Function; +import javax.annotation.Nullable; //---------------------------------------------------------------- // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. @@ -60,19 +60,22 @@ */ @JsonpDeserializable public class SettingsSimilarityBm25 implements SettingsSimilarityVariant, JsonpSerializable { - private final double b; + @Nullable + private final Double b; - private final boolean discountOverlaps; + @Nullable + private final Boolean discountOverlaps; - private final double k1; + @Nullable + private final Double k1; // --------------------------------------------------------------------------------------------- private SettingsSimilarityBm25(Builder builder) { - this.b = ApiTypeHelper.requireNonNull(builder.b, this, "b"); - this.discountOverlaps = ApiTypeHelper.requireNonNull(builder.discountOverlaps, this, "discountOverlaps"); - this.k1 = ApiTypeHelper.requireNonNull(builder.k1, this, "k1"); + this.b = builder.b; + this.discountOverlaps = builder.discountOverlaps; + this.k1 = builder.k1; } @@ -89,23 +92,26 @@ public SettingsSimilarity.Kind _settingsSimilarityKind() { } /** - * Required - API name: {@code b} + * API name: {@code b} */ - public final double b() { + @Nullable + public final Double b() { return this.b; } /** - * Required - API name: {@code discount_overlaps} + * API name: {@code discount_overlaps} */ - public final boolean discountOverlaps() { + @Nullable + public final Boolean discountOverlaps() { return this.discountOverlaps; } /** - * Required - API name: {@code k1} + * API name: {@code k1} */ - public final double k1() { + @Nullable + public final Double k1() { return this.k1; } @@ -120,14 +126,23 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey("b"); - generator.write(this.b); + generator.write("type", "BM25"); - generator.writeKey("discount_overlaps"); - generator.write(this.discountOverlaps); + if (this.b != null) { + generator.writeKey("b"); + generator.write(this.b); - generator.writeKey("k1"); - generator.write(this.k1); + } + if (this.discountOverlaps != null) { + generator.writeKey("discount_overlaps"); + generator.write(this.discountOverlaps); + + } + if (this.k1 != null) { + generator.writeKey("k1"); + generator.write(this.k1); + + } } @@ -145,32 +160,35 @@ public String toString() { public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable private Double b; + @Nullable private Boolean discountOverlaps; + @Nullable private Double k1; /** - * Required - API name: {@code b} + * API name: {@code b} */ - public final Builder b(double value) { + public final Builder b(@Nullable Double value) { this.b = value; return this; } /** - * Required - API name: {@code discount_overlaps} + * API name: {@code discount_overlaps} */ - public final Builder discountOverlaps(boolean value) { + public final Builder discountOverlaps(@Nullable Boolean value) { this.discountOverlaps = value; return this; } /** - * Required - API name: {@code k1} + * API name: {@code k1} */ - public final Builder k1(double value) { + public final Builder k1(@Nullable Double value) { this.k1 = value; return this; } @@ -208,6 +226,7 @@ protected static void setupSettingsSimilarityBm25Deserializer( op.add(Builder::discountOverlaps, JsonpDeserializer.booleanDeserializer(), "discount_overlaps"); op.add(Builder::k1, JsonpDeserializer.doubleDeserializer(), "k1"); + op.ignore("type"); } } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/TransientMetadataConfig.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBoolean.java similarity index 56% rename from java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/TransientMetadataConfig.java rename to java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBoolean.java index beb1066cf..e3016b8f1 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/TransientMetadataConfig.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBoolean.java @@ -17,11 +17,7 @@ * under the License. */ -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.security; +package co.elastic.clients.elasticsearch.indices; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; @@ -30,43 +26,53 @@ import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; import java.util.Objects; import java.util.function.Function; -// typedef: security._types.TransientMetadataConfig +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: indices._types.SettingsSimilarityBoolean /** * * @see API + * "../doc-files/api-spec.html#indices._types.SettingsSimilarityBoolean">API * specification */ @JsonpDeserializable -public class TransientMetadataConfig implements JsonpSerializable { - private final boolean enabled; - +public class SettingsSimilarityBoolean implements SettingsSimilarityVariant, JsonpSerializable { // --------------------------------------------------------------------------------------------- - private TransientMetadataConfig(Builder builder) { - - this.enabled = ApiTypeHelper.requireNonNull(builder.enabled, this, "enabled"); + private SettingsSimilarityBoolean(Builder builder) { } - public static TransientMetadataConfig of(Function> fn) { + public static SettingsSimilarityBoolean of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * Required - API name: {@code enabled} + * SettingsSimilarity variant kind. */ - public final boolean enabled() { - return this.enabled; + @Override + public SettingsSimilarity.Kind _settingsSimilarityKind() { + return SettingsSimilarity.Kind.Boolean; } /** @@ -80,8 +86,7 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey("enabled"); - generator.write(this.enabled); + generator.write("type", "boolean"); } @@ -93,53 +98,42 @@ public String toString() { // --------------------------------------------------------------------------------------------- /** - * Builder for {@link TransientMetadataConfig}. + * Builder for {@link SettingsSimilarityBoolean}. */ public static class Builder extends WithJsonObjectBuilderBase implements - ObjectBuilder { - private Boolean enabled; - - /** - * Required - API name: {@code enabled} - */ - public final Builder enabled(boolean value) { - this.enabled = value; - return this; - } - + ObjectBuilder { @Override protected Builder self() { return this; } /** - * Builds a {@link TransientMetadataConfig}. + * Builds a {@link SettingsSimilarityBoolean}. * * @throws NullPointerException * if some of the required fields are null. */ - public TransientMetadataConfig build() { + public SettingsSimilarityBoolean build() { _checkSingleUse(); - return new TransientMetadataConfig(this); + return new SettingsSimilarityBoolean(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link TransientMetadataConfig} + * Json deserializer for {@link SettingsSimilarityBoolean} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, TransientMetadataConfig::setupTransientMetadataConfigDeserializer); - - protected static void setupTransientMetadataConfigDeserializer( - ObjectDeserializer op) { + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SettingsSimilarityBoolean::setupSettingsSimilarityBooleanDeserializer); - op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); + protected static void setupSettingsSimilarityBooleanDeserializer( + ObjectDeserializer op) { + op.ignore("type"); } } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBuilders.java index e21e3cef0..454f72af1 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBuilders.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBuilders.java @@ -45,7 +45,7 @@ private SettingsSimilarityBuilders() { } /** - * Creates a builder for the {@link SettingsSimilarityBm25 bm25} + * Creates a builder for the {@link SettingsSimilarityBm25 BM25} * {@code SettingsSimilarity} variant. */ public static SettingsSimilarityBm25.Builder bm25() { @@ -53,7 +53,7 @@ public static SettingsSimilarityBm25.Builder bm25() { } /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityBm25 bm25} + * Creates a SettingsSimilarity of the {@link SettingsSimilarityBm25 BM25} * {@code SettingsSimilarity} variant. */ public static SettingsSimilarity bm25( @@ -64,7 +64,26 @@ public static SettingsSimilarity bm25( } /** - * Creates a builder for the {@link SettingsSimilarityDfi dfi} + * Creates a builder for the {@link SettingsSimilarityBoolean boolean} + * {@code SettingsSimilarity} variant. + */ + public static SettingsSimilarityBoolean.Builder boolean_() { + return new SettingsSimilarityBoolean.Builder(); + } + + /** + * Creates a SettingsSimilarity of the {@link SettingsSimilarityBoolean boolean} + * {@code SettingsSimilarity} variant. + */ + public static SettingsSimilarity boolean_( + Function> fn) { + SettingsSimilarity.Builder builder = new SettingsSimilarity.Builder(); + builder.boolean_(fn.apply(new SettingsSimilarityBoolean.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link SettingsSimilarityDfi DFI} * {@code SettingsSimilarity} variant. */ public static SettingsSimilarityDfi.Builder dfi() { @@ -72,7 +91,7 @@ public static SettingsSimilarityDfi.Builder dfi() { } /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityDfi dfi} + * Creates a SettingsSimilarity of the {@link SettingsSimilarityDfi DFI} * {@code SettingsSimilarity} variant. */ public static SettingsSimilarity dfi( @@ -83,7 +102,7 @@ public static SettingsSimilarity dfi( } /** - * Creates a builder for the {@link SettingsSimilarityDfr dfr} + * Creates a builder for the {@link SettingsSimilarityDfr DFR} * {@code SettingsSimilarity} variant. */ public static SettingsSimilarityDfr.Builder dfr() { @@ -91,7 +110,7 @@ public static SettingsSimilarityDfr.Builder dfr() { } /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityDfr dfr} + * Creates a SettingsSimilarity of the {@link SettingsSimilarityDfr DFR} * {@code SettingsSimilarity} variant. */ public static SettingsSimilarity dfr( @@ -102,7 +121,7 @@ public static SettingsSimilarity dfr( } /** - * Creates a builder for the {@link SettingsSimilarityIb ib} + * Creates a builder for the {@link SettingsSimilarityIb IB} * {@code SettingsSimilarity} variant. */ public static SettingsSimilarityIb.Builder ib() { @@ -110,7 +129,7 @@ public static SettingsSimilarityIb.Builder ib() { } /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityIb ib} + * Creates a SettingsSimilarity of the {@link SettingsSimilarityIb IB} * {@code SettingsSimilarity} variant. */ public static SettingsSimilarity ib( @@ -121,59 +140,59 @@ public static SettingsSimilarity ib( } /** - * Creates a builder for the {@link SettingsSimilarityLmd lmd} + * Creates a builder for the {@link SettingsSimilarityLmd LMDirichlet} * {@code SettingsSimilarity} variant. */ - public static SettingsSimilarityLmd.Builder lmd() { + public static SettingsSimilarityLmd.Builder lmdirichlet() { return new SettingsSimilarityLmd.Builder(); } /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityLmd lmd} + * Creates a SettingsSimilarity of the {@link SettingsSimilarityLmd LMDirichlet} * {@code SettingsSimilarity} variant. */ - public static SettingsSimilarity lmd( + public static SettingsSimilarity lmdirichlet( Function> fn) { SettingsSimilarity.Builder builder = new SettingsSimilarity.Builder(); - builder.lmd(fn.apply(new SettingsSimilarityLmd.Builder()).build()); + builder.lmdirichlet(fn.apply(new SettingsSimilarityLmd.Builder()).build()); return builder.build(); } /** - * Creates a builder for the {@link SettingsSimilarityLmj lmj} + * Creates a builder for the {@link SettingsSimilarityLmj LMJelinekMercer} * {@code SettingsSimilarity} variant. */ - public static SettingsSimilarityLmj.Builder lmj() { + public static SettingsSimilarityLmj.Builder lmjelinekmercer() { return new SettingsSimilarityLmj.Builder(); } /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityLmj lmj} - * {@code SettingsSimilarity} variant. + * Creates a SettingsSimilarity of the {@link SettingsSimilarityLmj + * LMJelinekMercer} {@code SettingsSimilarity} variant. */ - public static SettingsSimilarity lmj( + public static SettingsSimilarity lmjelinekmercer( Function> fn) { SettingsSimilarity.Builder builder = new SettingsSimilarity.Builder(); - builder.lmj(fn.apply(new SettingsSimilarityLmj.Builder()).build()); + builder.lmjelinekmercer(fn.apply(new SettingsSimilarityLmj.Builder()).build()); return builder.build(); } /** - * Creates a builder for the {@link SettingsSimilarityScriptedTfidf - * scripted_tfidf} {@code SettingsSimilarity} variant. + * Creates a builder for the {@link SettingsSimilarityScripted scripted} + * {@code SettingsSimilarity} variant. */ - public static SettingsSimilarityScriptedTfidf.Builder scriptedTfidf() { - return new SettingsSimilarityScriptedTfidf.Builder(); + public static SettingsSimilarityScripted.Builder scripted() { + return new SettingsSimilarityScripted.Builder(); } /** - * Creates a SettingsSimilarity of the {@link SettingsSimilarityScriptedTfidf - * scripted_tfidf} {@code SettingsSimilarity} variant. + * Creates a SettingsSimilarity of the {@link SettingsSimilarityScripted + * scripted} {@code SettingsSimilarity} variant. */ - public static SettingsSimilarity scriptedTfidf( - Function> fn) { + public static SettingsSimilarity scripted( + Function> fn) { SettingsSimilarity.Builder builder = new SettingsSimilarity.Builder(); - builder.scriptedTfidf(fn.apply(new SettingsSimilarityScriptedTfidf.Builder()).build()); + builder.scripted(fn.apply(new SettingsSimilarityScripted.Builder()).build()); return builder.build(); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfi.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfi.java index acc0cfb49..596a78bd3 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfi.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfi.java @@ -101,6 +101,8 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.write("type", "DFI"); + generator.writeKey("independence_measure"); this.independenceMeasure.serialize(generator, mapper); @@ -160,6 +162,7 @@ protected static void setupSettingsSimilarityDfiDeserializer(ObjectDeserializer< op.add(Builder::independenceMeasure, DFIIndependenceMeasure._DESERIALIZER, "independence_measure"); + op.ignore("type"); } } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfr.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfr.java index 168953aab..9e022df97 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfr.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfr.java @@ -122,6 +122,8 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.write("type", "DFR"); + generator.writeKey("after_effect"); this.afterEffect.serialize(generator, mapper); generator.writeKey("basic_model"); @@ -207,6 +209,7 @@ protected static void setupSettingsSimilarityDfrDeserializer(ObjectDeserializer< op.add(Builder::basicModel, DFRBasicModel._DESERIALIZER, "basic_model"); op.add(Builder::normalization, Normalization._DESERIALIZER, "normalization"); + op.ignore("type"); } } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityIb.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityIb.java index 19ebcd6dc..ad8bf0ba1 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityIb.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityIb.java @@ -122,6 +122,8 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.write("type", "IB"); + generator.writeKey("distribution"); this.distribution.serialize(generator, mapper); generator.writeKey("lambda"); @@ -207,6 +209,7 @@ protected static void setupSettingsSimilarityIbDeserializer(ObjectDeserializer implements ObjectBuilder { - private Integer mu; + @Nullable + private Double mu; /** - * Required - API name: {@code mu} + * API name: {@code mu} */ - public final Builder mu(int value) { + public final Builder mu(@Nullable Double value) { this.mu = value; return this; } @@ -156,8 +164,9 @@ public SettingsSimilarityLmd build() { protected static void setupSettingsSimilarityLmdDeserializer(ObjectDeserializer op) { - op.add(Builder::mu, JsonpDeserializer.integerDeserializer(), "mu"); + op.add(Builder::mu, JsonpDeserializer.doubleDeserializer(), "mu"); + op.ignore("type"); } } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmj.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmj.java index 11a0e7140..5c8998fd8 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmj.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmj.java @@ -26,13 +26,13 @@ import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; import java.lang.Double; import java.util.Objects; import java.util.function.Function; +import javax.annotation.Nullable; //---------------------------------------------------------------- // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. @@ -59,13 +59,14 @@ */ @JsonpDeserializable public class SettingsSimilarityLmj implements SettingsSimilarityVariant, JsonpSerializable { - private final double lambda; + @Nullable + private final Double lambda; // --------------------------------------------------------------------------------------------- private SettingsSimilarityLmj(Builder builder) { - this.lambda = ApiTypeHelper.requireNonNull(builder.lambda, this, "lambda"); + this.lambda = builder.lambda; } @@ -78,13 +79,14 @@ public static SettingsSimilarityLmj of(Function implements ObjectBuilder { + @Nullable private Double lambda; /** - * Required - API name: {@code lambda} + * API name: {@code lambda} */ - public final Builder lambda(double value) { + public final Builder lambda(@Nullable Double value) { this.lambda = value; return this; } @@ -158,6 +166,7 @@ protected static void setupSettingsSimilarityLmjDeserializer(ObjectDeserializer< op.add(Builder::lambda, JsonpDeserializer.doubleDeserializer(), "lambda"); + op.ignore("type"); } } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityScriptedTfidf.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityScripted.java similarity index 69% rename from java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityScriptedTfidf.java rename to java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityScripted.java index 35d8fe7f7..daa33e276 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityScriptedTfidf.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityScripted.java @@ -50,28 +50,31 @@ // //---------------------------------------------------------------- -// typedef: indices._types.SettingsSimilarityScriptedTfidf +// typedef: indices._types.SettingsSimilarityScripted /** * * @see API + * "../doc-files/api-spec.html#indices._types.SettingsSimilarityScripted">API * specification */ @JsonpDeserializable -public class SettingsSimilarityScriptedTfidf implements SettingsSimilarityVariant, JsonpSerializable { +public class SettingsSimilarityScripted implements SettingsSimilarityVariant, JsonpSerializable { private final Script script; + @Nullable + private final Script weightScript; + // --------------------------------------------------------------------------------------------- - private SettingsSimilarityScriptedTfidf(Builder builder) { + private SettingsSimilarityScripted(Builder builder) { this.script = ApiTypeHelper.requireNonNull(builder.script, this, "script"); + this.weightScript = builder.weightScript; } - public static SettingsSimilarityScriptedTfidf of( - Function> fn) { + public static SettingsSimilarityScripted of(Function> fn) { return fn.apply(new Builder()).build(); } @@ -80,7 +83,7 @@ public static SettingsSimilarityScriptedTfidf of( */ @Override public SettingsSimilarity.Kind _settingsSimilarityKind() { - return SettingsSimilarity.Kind.ScriptedTfidf; + return SettingsSimilarity.Kind.Scripted; } /** @@ -90,6 +93,14 @@ public final Script script() { return this.script; } + /** + * API name: {@code weight_script} + */ + @Nullable + public final Script weightScript() { + return this.weightScript; + } + /** * Serialize this object to JSON. */ @@ -101,9 +112,17 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + generator.write("type", "scripted"); + generator.writeKey("script"); this.script.serialize(generator, mapper); + if (this.weightScript != null) { + generator.writeKey("weight_script"); + this.weightScript.serialize(generator, mapper); + + } + } @Override @@ -114,14 +133,17 @@ public String toString() { // --------------------------------------------------------------------------------------------- /** - * Builder for {@link SettingsSimilarityScriptedTfidf}. + * Builder for {@link SettingsSimilarityScripted}. */ public static class Builder extends WithJsonObjectBuilderBase implements - ObjectBuilder { + ObjectBuilder { private Script script; + @Nullable + private Script weightScript; + /** * Required - API name: {@code script} */ @@ -137,37 +159,54 @@ public final Builder script(Function> fn) return this.script(fn.apply(new Script.Builder()).build()); } + /** + * API name: {@code weight_script} + */ + public final Builder weightScript(@Nullable Script value) { + this.weightScript = value; + return this; + } + + /** + * API name: {@code weight_script} + */ + public final Builder weightScript(Function> fn) { + return this.weightScript(fn.apply(new Script.Builder()).build()); + } + @Override protected Builder self() { return this; } /** - * Builds a {@link SettingsSimilarityScriptedTfidf}. + * Builds a {@link SettingsSimilarityScripted}. * * @throws NullPointerException * if some of the required fields are null. */ - public SettingsSimilarityScriptedTfidf build() { + public SettingsSimilarityScripted build() { _checkSingleUse(); - return new SettingsSimilarityScriptedTfidf(this); + return new SettingsSimilarityScripted(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link SettingsSimilarityScriptedTfidf} + * Json deserializer for {@link SettingsSimilarityScripted} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SettingsSimilarityScriptedTfidf::setupSettingsSimilarityScriptedTfidfDeserializer); + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SettingsSimilarityScripted::setupSettingsSimilarityScriptedDeserializer); - protected static void setupSettingsSimilarityScriptedTfidfDeserializer( - ObjectDeserializer op) { + protected static void setupSettingsSimilarityScriptedDeserializer( + ObjectDeserializer op) { op.add(Builder::script, Script._DESERIALIZER, "script"); + op.add(Builder::weightScript, Script._DESERIALIZER, "weight_script"); + op.ignore("type"); } } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityVariant.java index badfa9446..b77e52300 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityVariant.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityVariant.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch.indices; +import co.elastic.clients.json.JsonpSerializable; + //---------------------------------------------------------------- // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. //---------------------------------------------------------------- @@ -37,7 +39,7 @@ /** * Base interface for {@link SettingsSimilarity} variants. */ -public interface SettingsSimilarityVariant { +public interface SettingsSimilarityVariant extends JsonpSerializable { SettingsSimilarity.Kind _settingsSimilarityKind(); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateRequest.java index 4d080dcc3..3468d41f3 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateRequest.java @@ -22,12 +22,8 @@ import co.elastic.clients.elasticsearch._types.ErrorResponse; import co.elastic.clients.elasticsearch._types.RequestBase; import co.elastic.clients.elasticsearch._types.Time; -import co.elastic.clients.elasticsearch.indices.put_index_template.IndexTemplateMapping; -import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.transport.Endpoint; @@ -36,11 +32,8 @@ import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; import java.lang.Boolean; -import java.lang.Integer; -import java.lang.Long; import java.lang.String; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Function; @@ -69,56 +62,23 @@ * "../doc-files/api-spec.html#indices.simulate_index_template.Request">API * specification */ -@JsonpDeserializable -public class SimulateIndexTemplateRequest extends RequestBase implements JsonpSerializable { - private final Map meta; - - @Nullable - private final Boolean allowAutoCreate; - - private final List composedOf; - - @Nullable - private final Boolean create; - - @Nullable - private final DataStreamVisibility dataStream; +public class SimulateIndexTemplateRequest extends RequestBase { @Nullable private final Boolean includeDefaults; - private final List indexPatterns; - @Nullable private final Time masterTimeout; private final String name; - @Nullable - private final Integer priority; - - @Nullable - private final IndexTemplateMapping template; - - @Nullable - private final Long version; - // --------------------------------------------------------------------------------------------- private SimulateIndexTemplateRequest(Builder builder) { - this.meta = ApiTypeHelper.unmodifiable(builder.meta); - this.allowAutoCreate = builder.allowAutoCreate; - this.composedOf = ApiTypeHelper.unmodifiable(builder.composedOf); - this.create = builder.create; - this.dataStream = builder.dataStream; this.includeDefaults = builder.includeDefaults; - this.indexPatterns = ApiTypeHelper.unmodifiable(builder.indexPatterns); this.masterTimeout = builder.masterTimeout; this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); - this.priority = builder.priority; - this.template = builder.template; - this.version = builder.version; } @@ -126,68 +86,6 @@ public static SimulateIndexTemplateRequest of(Function - * API name: {@code _meta} - */ - public final Map meta() { - return this.meta; - } - - /** - * This setting overrides the value of the action.auto_create_index - * cluster setting. If set to true in a template, then indices can - * be automatically created using that template even if auto-creation of indices - * is disabled via actions.auto_create_index. If set to - * false, then indices or data streams matching the template must - * always be explicitly created, and may never be automatically created. - *

- * API name: {@code allow_auto_create} - */ - @Nullable - public final Boolean allowAutoCreate() { - return this.allowAutoCreate; - } - - /** - * An ordered list of component template names. Component templates are merged - * in the order specified, meaning that the last component template specified - * has the highest precedence. - *

- * API name: {@code composed_of} - */ - public final List composedOf() { - return this.composedOf; - } - - /** - * If true, the template passed in the body is only used if no - * existing templates match the same index patterns. If false, the - * simulation uses the template with the highest priority. Note that the - * template is not permanently added or updated in either case; it is only used - * for the simulation. - *

- * API name: {@code create} - */ - @Nullable - public final Boolean create() { - return this.create; - } - - /** - * If this object is included, the template is used to create data streams and - * their backing indices. Supports an empty object. Data streams require a - * matching index template with a data_stream object. - *

- * API name: {@code data_stream} - */ - @Nullable - public final DataStreamVisibility dataStream() { - return this.dataStream; - } - /** * If true, returns all relevant default configurations for the index template. *

@@ -198,16 +96,6 @@ public final Boolean includeDefaults() { return this.includeDefaults; } - /** - * Array of wildcard (*) expressions used to match the names of - * data streams and indices during creation. - *

- * API name: {@code index_patterns} - */ - public final List indexPatterns() { - return this.indexPatterns; - } - /** * Period to wait for a connection to the master node. If no response is * received before the timeout expires, the request fails and returns an error. @@ -220,7 +108,7 @@ public final Time masterTimeout() { } /** - * Required - Index or template name to simulate + * Required - Name of the index to simulate *

* API name: {@code name} */ @@ -228,112 +116,6 @@ public final String name() { return this.name; } - /** - * Priority to determine index template precedence when a new data stream or - * index is created. The index template with the highest priority is chosen. If - * no priority is specified the template is treated as though it is of priority - * 0 (lowest priority). This number is not automatically generated by - * Elasticsearch. - *

- * API name: {@code priority} - */ - @Nullable - public final Integer priority() { - return this.priority; - } - - /** - * Template to be applied. It may optionally include an aliases, - * mappings, or settings configuration. - *

- * API name: {@code template} - */ - @Nullable - public final IndexTemplateMapping template() { - return this.template; - } - - /** - * Version number used to manage index templates externally. This number is not - * automatically generated by Elasticsearch. - *

- * API name: {@code version} - */ - @Nullable - public final Long version() { - return this.version; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.meta)) { - generator.writeKey("_meta"); - generator.writeStartObject(); - for (Map.Entry item0 : this.meta.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.allowAutoCreate != null) { - generator.writeKey("allow_auto_create"); - generator.write(this.allowAutoCreate); - - } - if (ApiTypeHelper.isDefined(this.composedOf)) { - generator.writeKey("composed_of"); - generator.writeStartArray(); - for (String item0 : this.composedOf) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.dataStream != null) { - generator.writeKey("data_stream"); - this.dataStream.serialize(generator, mapper); - - } - if (ApiTypeHelper.isDefined(this.indexPatterns)) { - generator.writeKey("index_patterns"); - generator.writeStartArray(); - for (String item0 : this.indexPatterns) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.priority != null) { - generator.writeKey("priority"); - generator.write(this.priority); - - } - if (this.template != null) { - generator.writeKey("template"); - this.template.serialize(generator, mapper); - - } - if (this.version != null) { - generator.writeKey("version"); - generator.write(this.version); - - } - - } - // --------------------------------------------------------------------------------------------- /** @@ -343,148 +125,14 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { - @Nullable - private Map meta; - - @Nullable - private Boolean allowAutoCreate; - - @Nullable - private List composedOf; - - @Nullable - private Boolean create; - - @Nullable - private DataStreamVisibility dataStream; - @Nullable private Boolean includeDefaults; - @Nullable - private List indexPatterns; - @Nullable private Time masterTimeout; private String name; - @Nullable - private Integer priority; - - @Nullable - private IndexTemplateMapping template; - - @Nullable - private Long version; - - /** - * Optional user metadata about the index template. May have any contents. This - * map is not automatically generated by Elasticsearch. - *

- * API name: {@code _meta} - *

- * Adds all entries of map to meta. - */ - public final Builder meta(Map map) { - this.meta = _mapPutAll(this.meta, map); - return this; - } - - /** - * Optional user metadata about the index template. May have any contents. This - * map is not automatically generated by Elasticsearch. - *

- * API name: {@code _meta} - *

- * Adds an entry to meta. - */ - public final Builder meta(String key, JsonData value) { - this.meta = _mapPut(this.meta, key, value); - return this; - } - - /** - * This setting overrides the value of the action.auto_create_index - * cluster setting. If set to true in a template, then indices can - * be automatically created using that template even if auto-creation of indices - * is disabled via actions.auto_create_index. If set to - * false, then indices or data streams matching the template must - * always be explicitly created, and may never be automatically created. - *

- * API name: {@code allow_auto_create} - */ - public final Builder allowAutoCreate(@Nullable Boolean value) { - this.allowAutoCreate = value; - return this; - } - - /** - * An ordered list of component template names. Component templates are merged - * in the order specified, meaning that the last component template specified - * has the highest precedence. - *

- * API name: {@code composed_of} - *

- * Adds all elements of list to composedOf. - */ - public final Builder composedOf(List list) { - this.composedOf = _listAddAll(this.composedOf, list); - return this; - } - - /** - * An ordered list of component template names. Component templates are merged - * in the order specified, meaning that the last component template specified - * has the highest precedence. - *

- * API name: {@code composed_of} - *

- * Adds one or more values to composedOf. - */ - public final Builder composedOf(String value, String... values) { - this.composedOf = _listAdd(this.composedOf, value, values); - return this; - } - - /** - * If true, the template passed in the body is only used if no - * existing templates match the same index patterns. If false, the - * simulation uses the template with the highest priority. Note that the - * template is not permanently added or updated in either case; it is only used - * for the simulation. - *

- * API name: {@code create} - */ - public final Builder create(@Nullable Boolean value) { - this.create = value; - return this; - } - - /** - * If this object is included, the template is used to create data streams and - * their backing indices. Supports an empty object. Data streams require a - * matching index template with a data_stream object. - *

- * API name: {@code data_stream} - */ - public final Builder dataStream(@Nullable DataStreamVisibility value) { - this.dataStream = value; - return this; - } - - /** - * If this object is included, the template is used to create data streams and - * their backing indices. Supports an empty object. Data streams require a - * matching index template with a data_stream object. - *

- * API name: {@code data_stream} - */ - public final Builder dataStream( - Function> fn) { - return this.dataStream(fn.apply(new DataStreamVisibility.Builder()).build()); - } - /** * If true, returns all relevant default configurations for the index template. *

@@ -495,32 +143,6 @@ public final Builder includeDefaults(@Nullable Boolean value) { return this; } - /** - * Array of wildcard (*) expressions used to match the names of - * data streams and indices during creation. - *

- * API name: {@code index_patterns} - *

- * Adds all elements of list to indexPatterns. - */ - public final Builder indexPatterns(List list) { - this.indexPatterns = _listAddAll(this.indexPatterns, list); - return this; - } - - /** - * Array of wildcard (*) expressions used to match the names of - * data streams and indices during creation. - *

- * API name: {@code index_patterns} - *

- * Adds one or more values to indexPatterns. - */ - public final Builder indexPatterns(String value, String... values) { - this.indexPatterns = _listAdd(this.indexPatterns, value, values); - return this; - } - /** * Period to wait for a connection to the master node. If no response is * received before the timeout expires, the request fails and returns an error. @@ -543,7 +165,7 @@ public final Builder masterTimeout(Function> f } /** - * Required - Index or template name to simulate + * Required - Name of the index to simulate *

* API name: {@code name} */ @@ -552,52 +174,6 @@ public final Builder name(String value) { return this; } - /** - * Priority to determine index template precedence when a new data stream or - * index is created. The index template with the highest priority is chosen. If - * no priority is specified the template is treated as though it is of priority - * 0 (lowest priority). This number is not automatically generated by - * Elasticsearch. - *

- * API name: {@code priority} - */ - public final Builder priority(@Nullable Integer value) { - this.priority = value; - return this; - } - - /** - * Template to be applied. It may optionally include an aliases, - * mappings, or settings configuration. - *

- * API name: {@code template} - */ - public final Builder template(@Nullable IndexTemplateMapping value) { - this.template = value; - return this; - } - - /** - * Template to be applied. It may optionally include an aliases, - * mappings, or settings configuration. - *

- * API name: {@code template} - */ - public final Builder template(Function> fn) { - return this.template(fn.apply(new IndexTemplateMapping.Builder()).build()); - } - - /** - * Version number used to manage index templates externally. This number is not - * automatically generated by Elasticsearch. - *

- * API name: {@code version} - */ - public final Builder version(@Nullable Long value) { - this.version = value; - return this; - } - @Override protected Builder self() { return this; @@ -618,30 +194,6 @@ public SimulateIndexTemplateRequest build() { // --------------------------------------------------------------------------------------------- - /** - * Json deserializer for {@link SimulateIndexTemplateRequest} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, SimulateIndexTemplateRequest::setupSimulateIndexTemplateRequestDeserializer); - - protected static void setupSimulateIndexTemplateRequestDeserializer( - ObjectDeserializer op) { - - op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); - op.add(Builder::allowAutoCreate, JsonpDeserializer.booleanDeserializer(), "allow_auto_create"); - op.add(Builder::composedOf, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "composed_of"); - op.add(Builder::dataStream, DataStreamVisibility._DESERIALIZER, "data_stream"); - op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "index_patterns"); - op.add(Builder::priority, JsonpDeserializer.integerDeserializer(), "priority"); - op.add(Builder::template, IndexTemplateMapping._DESERIALIZER, "template"); - op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); - - } - - // --------------------------------------------------------------------------------------------- - /** * Endpoint "{@code indices.simulate_index_template}". */ @@ -695,13 +247,10 @@ protected static void setupSimulateIndexTemplateRequestDeserializer( if (request.masterTimeout != null) { params.put("master_timeout", request.masterTimeout._toJsonString()); } - if (request.create != null) { - params.put("create", String.valueOf(request.create)); - } if (request.includeDefaults != null) { params.put("include_defaults", String.valueOf(request.includeDefaults)); } return params; - }, SimpleEndpoint.emptyMap(), true, SimulateIndexTemplateResponse._DESERIALIZER); + }, SimpleEndpoint.emptyMap(), false, SimulateIndexTemplateResponse._DESERIALIZER); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateResponse.java index ddc66e621..b53fc70d9 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateResponse.java @@ -19,13 +19,23 @@ package co.elastic.clients.elasticsearch.indices; +import co.elastic.clients.elasticsearch.indices.simulate_template.Overlapping; +import co.elastic.clients.elasticsearch.indices.simulate_template.Template; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; +import java.util.List; import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; //---------------------------------------------------------------- // THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. @@ -50,17 +60,160 @@ * "../doc-files/api-spec.html#indices.simulate_index_template.Response">API * specification */ +@JsonpDeserializable +public class SimulateIndexTemplateResponse implements JsonpSerializable { + private final List overlapping; -public class SimulateIndexTemplateResponse { - public SimulateIndexTemplateResponse() { + private final Template template; + + // --------------------------------------------------------------------------------------------- + + private SimulateIndexTemplateResponse(Builder builder) { + + this.overlapping = ApiTypeHelper.unmodifiable(builder.overlapping); + this.template = ApiTypeHelper.requireNonNull(builder.template, this, "template"); + + } + + public static SimulateIndexTemplateResponse of(Function> fn) { + return fn.apply(new Builder()).build(); } /** - * Singleton instance for {@link SimulateIndexTemplateResponse}. + * API name: {@code overlapping} */ - public static final SimulateIndexTemplateResponse _INSTANCE = new SimulateIndexTemplateResponse(); + public final List overlapping() { + return this.overlapping; + } + + /** + * Required - API name: {@code template} + */ + public final Template template() { + return this.template; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + if (ApiTypeHelper.isDefined(this.overlapping)) { + generator.writeKey("overlapping"); + generator.writeStartArray(); + for (Overlapping item0 : this.overlapping) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + generator.writeKey("template"); + this.template.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } - public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer - .fixedValue(SimulateIndexTemplateResponse._INSTANCE); + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SimulateIndexTemplateResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private List overlapping; + + private Template template; + + /** + * API name: {@code overlapping} + *

+ * Adds all elements of list to overlapping. + */ + public final Builder overlapping(List list) { + this.overlapping = _listAddAll(this.overlapping, list); + return this; + } + + /** + * API name: {@code overlapping} + *

+ * Adds one or more values to overlapping. + */ + public final Builder overlapping(Overlapping value, Overlapping... values) { + this.overlapping = _listAdd(this.overlapping, value, values); + return this; + } + + /** + * API name: {@code overlapping} + *

+ * Adds a value to overlapping using a builder lambda. + */ + public final Builder overlapping(Function> fn) { + return overlapping(fn.apply(new Overlapping.Builder()).build()); + } + + /** + * Required - API name: {@code template} + */ + public final Builder template(Template value) { + this.template = value; + return this; + } + + /** + * Required - API name: {@code template} + */ + public final Builder template(Function> fn) { + return this.template(fn.apply(new Template.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SimulateIndexTemplateResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SimulateIndexTemplateResponse build() { + _checkSingleUse(); + + return new SimulateIndexTemplateResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SimulateIndexTemplateResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SimulateIndexTemplateResponse::setupSimulateIndexTemplateResponseDeserializer); + + protected static void setupSimulateIndexTemplateResponseDeserializer( + ObjectDeserializer op) { + + op.add(Builder::overlapping, JsonpDeserializer.arrayDeserializer(Overlapping._DESERIALIZER), "overlapping"); + op.add(Builder::template, Template._DESERIALIZER, "template"); + + } } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateRequest.java index c23ccef78..984b9485a 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateRequest.java @@ -22,6 +22,8 @@ import co.elastic.clients.elasticsearch._types.ErrorResponse; import co.elastic.clients.elasticsearch._types.RequestBase; import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.elasticsearch.indices.put_index_template.IndexTemplateMapping; +import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -33,10 +35,11 @@ import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; -import jakarta.json.stream.JsonParser; import java.lang.Boolean; +import java.lang.Long; import java.lang.String; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Function; @@ -69,29 +72,62 @@ */ @JsonpDeserializable public class SimulateTemplateRequest extends RequestBase implements JsonpSerializable { + private final Map meta; + + @Nullable + private final Boolean allowAutoCreate; + + private final List composedOf; + @Nullable private final Boolean create; + @Nullable + private final DataStreamVisibility dataStream; + + @Nullable + private final Boolean deprecated; + + private final List ignoreMissingComponentTemplates; + @Nullable private final Boolean includeDefaults; + private final List indexPatterns; + @Nullable private final Time masterTimeout; @Nullable private final String name; - private final IndexTemplate template; + @Nullable + private final Long priority; + + @Nullable + private final IndexTemplateMapping template; + + @Nullable + private final Long version; // --------------------------------------------------------------------------------------------- private SimulateTemplateRequest(Builder builder) { + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.allowAutoCreate = builder.allowAutoCreate; + this.composedOf = ApiTypeHelper.unmodifiable(builder.composedOf); this.create = builder.create; + this.dataStream = builder.dataStream; + this.deprecated = builder.deprecated; + this.ignoreMissingComponentTemplates = ApiTypeHelper.unmodifiable(builder.ignoreMissingComponentTemplates); this.includeDefaults = builder.includeDefaults; + this.indexPatterns = ApiTypeHelper.unmodifiable(builder.indexPatterns); this.masterTimeout = builder.masterTimeout; this.name = builder.name; - this.template = ApiTypeHelper.requireNonNull(builder.template, this, "template"); + this.priority = builder.priority; + this.template = builder.template; + this.version = builder.version; } @@ -99,6 +135,42 @@ public static SimulateTemplateRequest of(Function + * API name: {@code _meta} + */ + public final Map meta() { + return this.meta; + } + + /** + * This setting overrides the value of the action.auto_create_index + * cluster setting. If set to true in a template, then indices can + * be automatically created using that template even if auto-creation of indices + * is disabled via actions.auto_create_index. If set to + * false, then indices or data streams matching the template must + * always be explicitly created, and may never be automatically created. + *

+ * API name: {@code allow_auto_create} + */ + @Nullable + public final Boolean allowAutoCreate() { + return this.allowAutoCreate; + } + + /** + * An ordered list of component template names. Component templates are merged + * in the order specified, meaning that the last component template specified + * has the highest precedence. + *

+ * API name: {@code composed_of} + */ + public final List composedOf() { + return this.composedOf; + } + /** * If true, the template passed in the body is only used if no existing * templates match the same index patterns. If false, the simulation uses the @@ -112,6 +184,40 @@ public final Boolean create() { return this.create; } + /** + * If this object is included, the template is used to create data streams and + * their backing indices. Supports an empty object. Data streams require a + * matching index template with a data_stream object. + *

+ * API name: {@code data_stream} + */ + @Nullable + public final DataStreamVisibility dataStream() { + return this.dataStream; + } + + /** + * Marks this index template as deprecated. When creating or updating a + * non-deprecated index template that uses deprecated components, Elasticsearch + * will emit a deprecation warning. + *

+ * API name: {@code deprecated} + */ + @Nullable + public final Boolean deprecated() { + return this.deprecated; + } + + /** + * The configuration option ignore_missing_component_templates can be used when + * an index template references a component template that might not exist + *

+ * API name: {@code ignore_missing_component_templates} + */ + public final List ignoreMissingComponentTemplates() { + return this.ignoreMissingComponentTemplates; + } + /** * If true, returns all relevant default configurations for the index template. *

@@ -122,6 +228,16 @@ public final Boolean includeDefaults() { return this.includeDefaults; } + /** + * Array of wildcard (*) expressions used to match the names of + * data streams and indices during creation. + *

+ * API name: {@code index_patterns} + */ + public final List indexPatterns() { + return this.indexPatterns; + } + /** * Period to wait for a connection to the master node. If no response is * received before the timeout expires, the request fails and returns an error. @@ -146,17 +262,123 @@ public final String name() { } /** - * Required - Request body. + * Priority to determine index template precedence when a new data stream or + * index is created. The index template with the highest priority is chosen. If + * no priority is specified the template is treated as though it is of priority + * 0 (lowest priority). This number is not automatically generated by + * Elasticsearch. + *

+ * API name: {@code priority} + */ + @Nullable + public final Long priority() { + return this.priority; + } + + /** + * Template to be applied. It may optionally include an aliases, + * mappings, or settings configuration. + *

+ * API name: {@code template} */ - public final IndexTemplate template() { + @Nullable + public final IndexTemplateMapping template() { return this.template; } /** - * Serialize this value to JSON. + * Version number used to manage index templates externally. This number is not + * automatically generated by Elasticsearch. + *

+ * API name: {@code version} + */ + @Nullable + public final Long version() { + return this.version; + } + + /** + * Serialize this object to JSON. */ public void serialize(JsonGenerator generator, JsonpMapper mapper) { - this.template.serialize(generator, mapper); + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("_meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.allowAutoCreate != null) { + generator.writeKey("allow_auto_create"); + generator.write(this.allowAutoCreate); + + } + if (ApiTypeHelper.isDefined(this.composedOf)) { + generator.writeKey("composed_of"); + generator.writeStartArray(); + for (String item0 : this.composedOf) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.dataStream != null) { + generator.writeKey("data_stream"); + this.dataStream.serialize(generator, mapper); + + } + if (this.deprecated != null) { + generator.writeKey("deprecated"); + generator.write(this.deprecated); + + } + if (ApiTypeHelper.isDefined(this.ignoreMissingComponentTemplates)) { + generator.writeKey("ignore_missing_component_templates"); + generator.writeStartArray(); + for (String item0 : this.ignoreMissingComponentTemplates) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.indexPatterns)) { + generator.writeKey("index_patterns"); + generator.writeStartArray(); + for (String item0 : this.indexPatterns) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.priority != null) { + generator.writeKey("priority"); + generator.write(this.priority); + + } + if (this.template != null) { + generator.writeKey("template"); + this.template.serialize(generator, mapper); + + } + if (this.version != null) { + generator.writeKey("version"); + generator.write(this.version); + + } } @@ -169,19 +391,116 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private Map meta; + + @Nullable + private Boolean allowAutoCreate; + + @Nullable + private List composedOf; + @Nullable private Boolean create; + @Nullable + private DataStreamVisibility dataStream; + + @Nullable + private Boolean deprecated; + + @Nullable + private List ignoreMissingComponentTemplates; + @Nullable private Boolean includeDefaults; + @Nullable + private List indexPatterns; + @Nullable private Time masterTimeout; @Nullable private String name; - private IndexTemplate template; + @Nullable + private Long priority; + + @Nullable + private IndexTemplateMapping template; + + @Nullable + private Long version; + + /** + * Optional user metadata about the index template. May have any contents. This + * map is not automatically generated by Elasticsearch. + *

+ * API name: {@code _meta} + *

+ * Adds all entries of map to meta. + */ + public final Builder meta(Map map) { + this.meta = _mapPutAll(this.meta, map); + return this; + } + + /** + * Optional user metadata about the index template. May have any contents. This + * map is not automatically generated by Elasticsearch. + *

+ * API name: {@code _meta} + *

+ * Adds an entry to meta. + */ + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); + return this; + } + + /** + * This setting overrides the value of the action.auto_create_index + * cluster setting. If set to true in a template, then indices can + * be automatically created using that template even if auto-creation of indices + * is disabled via actions.auto_create_index. If set to + * false, then indices or data streams matching the template must + * always be explicitly created, and may never be automatically created. + *

+ * API name: {@code allow_auto_create} + */ + public final Builder allowAutoCreate(@Nullable Boolean value) { + this.allowAutoCreate = value; + return this; + } + + /** + * An ordered list of component template names. Component templates are merged + * in the order specified, meaning that the last component template specified + * has the highest precedence. + *

+ * API name: {@code composed_of} + *

+ * Adds all elements of list to composedOf. + */ + public final Builder composedOf(List list) { + this.composedOf = _listAddAll(this.composedOf, list); + return this; + } + + /** + * An ordered list of component template names. Component templates are merged + * in the order specified, meaning that the last component template specified + * has the highest precedence. + *

+ * API name: {@code composed_of} + *

+ * Adds one or more values to composedOf. + */ + public final Builder composedOf(String value, String... values) { + this.composedOf = _listAdd(this.composedOf, value, values); + return this; + } /** * If true, the template passed in the body is only used if no existing @@ -196,6 +515,69 @@ public final Builder create(@Nullable Boolean value) { return this; } + /** + * If this object is included, the template is used to create data streams and + * their backing indices. Supports an empty object. Data streams require a + * matching index template with a data_stream object. + *

+ * API name: {@code data_stream} + */ + public final Builder dataStream(@Nullable DataStreamVisibility value) { + this.dataStream = value; + return this; + } + + /** + * If this object is included, the template is used to create data streams and + * their backing indices. Supports an empty object. Data streams require a + * matching index template with a data_stream object. + *

+ * API name: {@code data_stream} + */ + public final Builder dataStream( + Function> fn) { + return this.dataStream(fn.apply(new DataStreamVisibility.Builder()).build()); + } + + /** + * Marks this index template as deprecated. When creating or updating a + * non-deprecated index template that uses deprecated components, Elasticsearch + * will emit a deprecation warning. + *

+ * API name: {@code deprecated} + */ + public final Builder deprecated(@Nullable Boolean value) { + this.deprecated = value; + return this; + } + + /** + * The configuration option ignore_missing_component_templates can be used when + * an index template references a component template that might not exist + *

+ * API name: {@code ignore_missing_component_templates} + *

+ * Adds all elements of list to + * ignoreMissingComponentTemplates. + */ + public final Builder ignoreMissingComponentTemplates(List list) { + this.ignoreMissingComponentTemplates = _listAddAll(this.ignoreMissingComponentTemplates, list); + return this; + } + + /** + * The configuration option ignore_missing_component_templates can be used when + * an index template references a component template that might not exist + *

+ * API name: {@code ignore_missing_component_templates} + *

+ * Adds one or more values to ignoreMissingComponentTemplates. + */ + public final Builder ignoreMissingComponentTemplates(String value, String... values) { + this.ignoreMissingComponentTemplates = _listAdd(this.ignoreMissingComponentTemplates, value, values); + return this; + } + /** * If true, returns all relevant default configurations for the index template. *

@@ -206,6 +588,32 @@ public final Builder includeDefaults(@Nullable Boolean value) { return this; } + /** + * Array of wildcard (*) expressions used to match the names of + * data streams and indices during creation. + *

+ * API name: {@code index_patterns} + *

+ * Adds all elements of list to indexPatterns. + */ + public final Builder indexPatterns(List list) { + this.indexPatterns = _listAddAll(this.indexPatterns, list); + return this; + } + + /** + * Array of wildcard (*) expressions used to match the names of + * data streams and indices during creation. + *

+ * API name: {@code index_patterns} + *

+ * Adds one or more values to indexPatterns. + */ + public final Builder indexPatterns(String value, String... values) { + this.indexPatterns = _listAdd(this.indexPatterns, value, values); + return this; + } + /** * Period to wait for a connection to the master node. If no response is * received before the timeout expires, the request fails and returns an error. @@ -240,26 +648,49 @@ public final Builder name(@Nullable String value) { } /** - * Required - Request body. + * Priority to determine index template precedence when a new data stream or + * index is created. The index template with the highest priority is chosen. If + * no priority is specified the template is treated as though it is of priority + * 0 (lowest priority). This number is not automatically generated by + * Elasticsearch. + *

+ * API name: {@code priority} */ - public final Builder template(IndexTemplate value) { - this.template = value; + public final Builder priority(@Nullable Long value) { + this.priority = value; return this; } /** - * Required - Request body. + * Template to be applied. It may optionally include an aliases, + * mappings, or settings configuration. + *

+ * API name: {@code template} */ - public final Builder template(Function> fn) { - return this.template(fn.apply(new IndexTemplate.Builder()).build()); + public final Builder template(@Nullable IndexTemplateMapping value) { + this.template = value; + return this; } - @Override - public Builder withJson(JsonParser parser, JsonpMapper mapper) { + /** + * Template to be applied. It may optionally include an aliases, + * mappings, or settings configuration. + *

+ * API name: {@code template} + */ + public final Builder template(Function> fn) { + return this.template(fn.apply(new IndexTemplateMapping.Builder()).build()); + } - @SuppressWarnings("unchecked") - IndexTemplate value = (IndexTemplate) IndexTemplate._DESERIALIZER.deserialize(parser, mapper); - return this.template(value); + /** + * Version number used to manage index templates externally. This number is not + * automatically generated by Elasticsearch. + *

+ * API name: {@code version} + */ + public final Builder version(@Nullable Long value) { + this.version = value; + return this; } @Override @@ -280,13 +711,32 @@ public SimulateTemplateRequest build() { } } - public static final JsonpDeserializer _DESERIALIZER = createSimulateTemplateRequestDeserializer(); - protected static JsonpDeserializer createSimulateTemplateRequestDeserializer() { + // --------------------------------------------------------------------------------------------- - JsonpDeserializer valueDeserializer = IndexTemplate._DESERIALIZER; + /** + * Json deserializer for {@link SimulateTemplateRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SimulateTemplateRequest::setupSimulateTemplateRequestDeserializer); + + protected static void setupSimulateTemplateRequestDeserializer( + ObjectDeserializer op) { + + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); + op.add(Builder::allowAutoCreate, JsonpDeserializer.booleanDeserializer(), "allow_auto_create"); + op.add(Builder::composedOf, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "composed_of"); + op.add(Builder::dataStream, DataStreamVisibility._DESERIALIZER, "data_stream"); + op.add(Builder::deprecated, JsonpDeserializer.booleanDeserializer(), "deprecated"); + op.add(Builder::ignoreMissingComponentTemplates, + JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "ignore_missing_component_templates"); + op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "index_patterns"); + op.add(Builder::priority, JsonpDeserializer.longDeserializer(), "priority"); + op.add(Builder::template, IndexTemplateMapping._DESERIALIZER, "template"); + op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); - return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() - .template(valueDeserializer.deserialize(parser, mapper, event)).build()); } // --------------------------------------------------------------------------------------------- diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/StorageType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/StorageType.java index 10510c714..2b429e72c 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/StorageType.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/StorageType.java @@ -50,7 +50,7 @@ public enum StorageType implements JsonEnum { * depending on the operating environment, which is currently hybridfs on all * supported systems but is subject to change. */ - Fs("fs", ""), + Fs("fs"), /** * The NIO FS type stores the shard index on the file system (maps to Lucene @@ -82,21 +82,15 @@ public enum StorageType implements JsonEnum { ; private final String jsonValue; - private final String[] aliases; - StorageType(String jsonValue, String... aliases) { + StorageType(String jsonValue) { this.jsonValue = jsonValue; - this.aliases = aliases; } public String jsonValue() { return this.jsonValue; } - public String[] aliases() { - return this.aliases; - } - public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( StorageType.values()); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TemplateMapping.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TemplateMapping.java deleted file mode 100644 index 775659f7b..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TemplateMapping.java +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; -import co.elastic.clients.json.JsonData; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Integer; -import java.lang.Long; -import java.lang.String; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: indices._types.TemplateMapping - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class TemplateMapping implements JsonpSerializable { - private final Map aliases; - - private final List indexPatterns; - - private final TypeMapping mappings; - - private final int order; - - private final Map settings; - - @Nullable - private final Long version; - - // --------------------------------------------------------------------------------------------- - - private TemplateMapping(Builder builder) { - - this.aliases = ApiTypeHelper.unmodifiableRequired(builder.aliases, this, "aliases"); - this.indexPatterns = ApiTypeHelper.unmodifiableRequired(builder.indexPatterns, this, "indexPatterns"); - this.mappings = ApiTypeHelper.requireNonNull(builder.mappings, this, "mappings"); - this.order = ApiTypeHelper.requireNonNull(builder.order, this, "order"); - this.settings = ApiTypeHelper.unmodifiableRequired(builder.settings, this, "settings"); - this.version = builder.version; - - } - - public static TemplateMapping of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code aliases} - */ - public final Map aliases() { - return this.aliases; - } - - /** - * Required - API name: {@code index_patterns} - */ - public final List indexPatterns() { - return this.indexPatterns; - } - - /** - * Required - API name: {@code mappings} - */ - public final TypeMapping mappings() { - return this.mappings; - } - - /** - * Required - API name: {@code order} - */ - public final int order() { - return this.order; - } - - /** - * Required - API name: {@code settings} - */ - public final Map settings() { - return this.settings; - } - - /** - * API name: {@code version} - */ - @Nullable - public final Long version() { - return this.version; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (ApiTypeHelper.isDefined(this.aliases)) { - generator.writeKey("aliases"); - generator.writeStartObject(); - for (Map.Entry item0 : this.aliases.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (ApiTypeHelper.isDefined(this.indexPatterns)) { - generator.writeKey("index_patterns"); - generator.writeStartArray(); - for (String item0 : this.indexPatterns) { - generator.write(item0); - - } - generator.writeEnd(); - - } - generator.writeKey("mappings"); - this.mappings.serialize(generator, mapper); - - generator.writeKey("order"); - generator.write(this.order); - - if (ApiTypeHelper.isDefined(this.settings)) { - generator.writeKey("settings"); - generator.writeStartObject(); - for (Map.Entry item0 : this.settings.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - if (this.version != null) { - generator.writeKey("version"); - generator.write(this.version); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link TemplateMapping}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Map aliases; - - private List indexPatterns; - - private TypeMapping mappings; - - private Integer order; - - private Map settings; - - @Nullable - private Long version; - - /** - * Required - API name: {@code aliases} - *

- * Adds all entries of map to aliases. - */ - public final Builder aliases(Map map) { - this.aliases = _mapPutAll(this.aliases, map); - return this; - } - - /** - * Required - API name: {@code aliases} - *

- * Adds an entry to aliases. - */ - public final Builder aliases(String key, Alias value) { - this.aliases = _mapPut(this.aliases, key, value); - return this; - } - - /** - * Required - API name: {@code aliases} - *

- * Adds an entry to aliases using a builder lambda. - */ - public final Builder aliases(String key, Function> fn) { - return aliases(key, fn.apply(new Alias.Builder()).build()); - } - - /** - * Required - API name: {@code index_patterns} - *

- * Adds all elements of list to indexPatterns. - */ - public final Builder indexPatterns(List list) { - this.indexPatterns = _listAddAll(this.indexPatterns, list); - return this; - } - - /** - * Required - API name: {@code index_patterns} - *

- * Adds one or more values to indexPatterns. - */ - public final Builder indexPatterns(String value, String... values) { - this.indexPatterns = _listAdd(this.indexPatterns, value, values); - return this; - } - - /** - * Required - API name: {@code mappings} - */ - public final Builder mappings(TypeMapping value) { - this.mappings = value; - return this; - } - - /** - * Required - API name: {@code mappings} - */ - public final Builder mappings(Function> fn) { - return this.mappings(fn.apply(new TypeMapping.Builder()).build()); - } - - /** - * Required - API name: {@code order} - */ - public final Builder order(int value) { - this.order = value; - return this; - } - - /** - * Required - API name: {@code settings} - *

- * Adds all entries of map to settings. - */ - public final Builder settings(Map map) { - this.settings = _mapPutAll(this.settings, map); - return this; - } - - /** - * Required - API name: {@code settings} - *

- * Adds an entry to settings. - */ - public final Builder settings(String key, JsonData value) { - this.settings = _mapPut(this.settings, key, value); - return this; - } - - /** - * API name: {@code version} - */ - public final Builder version(@Nullable Long value) { - this.version = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link TemplateMapping}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public TemplateMapping build() { - _checkSingleUse(); - - return new TemplateMapping(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link TemplateMapping} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - TemplateMapping::setupTemplateMappingDeserializer); - - protected static void setupTemplateMappingDeserializer(ObjectDeserializer op) { - - op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(Alias._DESERIALIZER), "aliases"); - op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), - "index_patterns"); - op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); - op.add(Builder::order, JsonpDeserializer.integerDeserializer(), "order"); - op.add(Builder::settings, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "settings"); - op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/stats/ShardFileSizeInfo.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/stats/ShardFileSizeInfo.java deleted file mode 100644 index 784a5ebea..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/stats/ShardFileSizeInfo.java +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.indices.stats; - -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.Long; -import java.lang.String; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: indices.stats.ShardFileSizeInfo - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ShardFileSizeInfo implements JsonpSerializable { - private final String description; - - private final long sizeInBytes; - - @Nullable - private final Long minSizeInBytes; - - @Nullable - private final Long maxSizeInBytes; - - @Nullable - private final Long averageSizeInBytes; - - @Nullable - private final Long count; - - // --------------------------------------------------------------------------------------------- - - private ShardFileSizeInfo(Builder builder) { - - this.description = ApiTypeHelper.requireNonNull(builder.description, this, "description"); - this.sizeInBytes = ApiTypeHelper.requireNonNull(builder.sizeInBytes, this, "sizeInBytes"); - this.minSizeInBytes = builder.minSizeInBytes; - this.maxSizeInBytes = builder.maxSizeInBytes; - this.averageSizeInBytes = builder.averageSizeInBytes; - this.count = builder.count; - - } - - public static ShardFileSizeInfo of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code description} - */ - public final String description() { - return this.description; - } - - /** - * Required - API name: {@code size_in_bytes} - */ - public final long sizeInBytes() { - return this.sizeInBytes; - } - - /** - * API name: {@code min_size_in_bytes} - */ - @Nullable - public final Long minSizeInBytes() { - return this.minSizeInBytes; - } - - /** - * API name: {@code max_size_in_bytes} - */ - @Nullable - public final Long maxSizeInBytes() { - return this.maxSizeInBytes; - } - - /** - * API name: {@code average_size_in_bytes} - */ - @Nullable - public final Long averageSizeInBytes() { - return this.averageSizeInBytes; - } - - /** - * API name: {@code count} - */ - @Nullable - public final Long count() { - return this.count; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("description"); - generator.write(this.description); - - generator.writeKey("size_in_bytes"); - generator.write(this.sizeInBytes); - - if (this.minSizeInBytes != null) { - generator.writeKey("min_size_in_bytes"); - generator.write(this.minSizeInBytes); - - } - if (this.maxSizeInBytes != null) { - generator.writeKey("max_size_in_bytes"); - generator.write(this.maxSizeInBytes); - - } - if (this.averageSizeInBytes != null) { - generator.writeKey("average_size_in_bytes"); - generator.write(this.averageSizeInBytes); - - } - if (this.count != null) { - generator.writeKey("count"); - generator.write(this.count); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ShardFileSizeInfo}. - */ - - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String description; - - private Long sizeInBytes; - - @Nullable - private Long minSizeInBytes; - - @Nullable - private Long maxSizeInBytes; - - @Nullable - private Long averageSizeInBytes; - - @Nullable - private Long count; - - /** - * Required - API name: {@code description} - */ - public final Builder description(String value) { - this.description = value; - return this; - } - - /** - * Required - API name: {@code size_in_bytes} - */ - public final Builder sizeInBytes(long value) { - this.sizeInBytes = value; - return this; - } - - /** - * API name: {@code min_size_in_bytes} - */ - public final Builder minSizeInBytes(@Nullable Long value) { - this.minSizeInBytes = value; - return this; - } - - /** - * API name: {@code max_size_in_bytes} - */ - public final Builder maxSizeInBytes(@Nullable Long value) { - this.maxSizeInBytes = value; - return this; - } - - /** - * API name: {@code average_size_in_bytes} - */ - public final Builder averageSizeInBytes(@Nullable Long value) { - this.averageSizeInBytes = value; - return this; - } - - /** - * API name: {@code count} - */ - public final Builder count(@Nullable Long value) { - this.count = value; - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ShardFileSizeInfo}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ShardFileSizeInfo build() { - _checkSingleUse(); - - return new ShardFileSizeInfo(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ShardFileSizeInfo} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ShardFileSizeInfo::setupShardFileSizeInfoDeserializer); - - protected static void setupShardFileSizeInfoDeserializer(ObjectDeserializer op) { - - op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description"); - op.add(Builder::sizeInBytes, JsonpDeserializer.longDeserializer(), "size_in_bytes"); - op.add(Builder::minSizeInBytes, JsonpDeserializer.longDeserializer(), "min_size_in_bytes"); - op.add(Builder::maxSizeInBytes, JsonpDeserializer.longDeserializer(), "max_size_in_bytes"); - op.add(Builder::averageSizeInBytes, JsonpDeserializer.longDeserializer(), "average_size_in_bytes"); - op.add(Builder::count, JsonpDeserializer.longDeserializer(), "count"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndexingPressure.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/CompletionResult.java similarity index 56% rename from java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndexingPressure.java rename to java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/CompletionResult.java index 5a36d1405..345149456 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndexingPressure.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/CompletionResult.java @@ -17,11 +17,7 @@ * under the License. */ -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.cluster.stats; +package co.elastic.clients.elasticsearch.inference; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; @@ -34,39 +30,56 @@ import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; +import java.lang.String; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; -// typedef: cluster.stats.IndexingPressure +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: inference._types.CompletionResult /** - * + * The completion result object + * * @see API + * "../doc-files/api-spec.html#inference._types.CompletionResult">API * specification */ @JsonpDeserializable -public class IndexingPressure implements JsonpSerializable { - private final IndexingPressureMemory memory; +public class CompletionResult implements JsonpSerializable { + private final String result; // --------------------------------------------------------------------------------------------- - private IndexingPressure(Builder builder) { + private CompletionResult(Builder builder) { - this.memory = ApiTypeHelper.requireNonNull(builder.memory, this, "memory"); + this.result = ApiTypeHelper.requireNonNull(builder.result, this, "result"); } - public static IndexingPressure of(Function> fn) { + public static CompletionResult of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * Required - API name: {@code memory} + * Required - API name: {@code result} */ - public final IndexingPressureMemory memory() { - return this.memory; + public final String result() { + return this.result; } /** @@ -80,8 +93,8 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey("memory"); - this.memory.serialize(generator, mapper); + generator.writeKey("result"); + generator.write(this.result); } @@ -93,57 +106,49 @@ public String toString() { // --------------------------------------------------------------------------------------------- /** - * Builder for {@link IndexingPressure}. + * Builder for {@link CompletionResult}. */ - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private IndexingPressureMemory memory; + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String result; /** - * Required - API name: {@code memory} + * Required - API name: {@code result} */ - public final Builder memory(IndexingPressureMemory value) { - this.memory = value; + public final Builder result(String value) { + this.result = value; return this; } - /** - * Required - API name: {@code memory} - */ - public final Builder memory( - Function> fn) { - return this.memory(fn.apply(new IndexingPressureMemory.Builder()).build()); - } - @Override protected Builder self() { return this; } /** - * Builds a {@link IndexingPressure}. + * Builds a {@link CompletionResult}. * * @throws NullPointerException * if some of the required fields are null. */ - public IndexingPressure build() { + public CompletionResult build() { _checkSingleUse(); - return new IndexingPressure(this); + return new CompletionResult(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link IndexingPressure} + * Json deserializer for {@link CompletionResult} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - IndexingPressure::setupIndexingPressureDeserializer); + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + CompletionResult::setupCompletionResultDeserializer); - protected static void setupIndexingPressureDeserializer(ObjectDeserializer op) { + protected static void setupCompletionResultDeserializer(ObjectDeserializer op) { - op.add(Builder::memory, IndexingPressureMemory._DESERIALIZER, "memory"); + op.add(Builder::result, JsonpDeserializer.stringDeserializer(), "result"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteInferenceEndpointResult.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteInferenceEndpointResult.java new file mode 100644 index 000000000..345a060f3 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteInferenceEndpointResult.java @@ -0,0 +1,134 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.inference; + +import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: inference._types.DeleteInferenceEndpointResult + +/** + * Acknowledged response. For dry_run, contains the list of pipelines which + * reference the inference endpoint + * + * @see API + * specification + */ + +public abstract class DeleteInferenceEndpointResult extends AcknowledgedResponseBase { + private final List pipelines; + + // --------------------------------------------------------------------------------------------- + + protected DeleteInferenceEndpointResult(AbstractBuilder builder) { + super(builder); + + this.pipelines = ApiTypeHelper.unmodifiableRequired(builder.pipelines, this, "pipelines"); + + } + + /** + * Required - API name: {@code pipelines} + */ + public final List pipelines() { + return this.pipelines; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + super.serializeInternal(generator, mapper); + if (ApiTypeHelper.isDefined(this.pipelines)) { + generator.writeKey("pipelines"); + generator.writeStartArray(); + for (String item0 : this.pipelines) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + public abstract static class AbstractBuilder> + extends + AcknowledgedResponseBase.AbstractBuilder { + private List pipelines; + + /** + * Required - API name: {@code pipelines} + *

+ * Adds all elements of list to pipelines. + */ + public final BuilderT pipelines(List list) { + this.pipelines = _listAddAll(this.pipelines, list); + return self(); + } + + /** + * Required - API name: {@code pipelines} + *

+ * Adds one or more values to pipelines. + */ + public final BuilderT pipelines(String value, String... values) { + this.pipelines = _listAdd(this.pipelines, value, values); + return self(); + } + + } + + // --------------------------------------------------------------------------------------------- + protected static > void setupDeleteInferenceEndpointResultDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + op.add(AbstractBuilder::pipelines, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "pipelines"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/GetModelRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteInferenceRequest.java similarity index 68% rename from java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/GetModelRequest.java rename to java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteInferenceRequest.java index b7ce8d929..c5e643f36 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/GetModelRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteInferenceRequest.java @@ -30,8 +30,8 @@ import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; import java.lang.String; -import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -53,16 +53,22 @@ // //---------------------------------------------------------------- -// typedef: inference.get_model.Request +// typedef: inference.delete.Request /** - * Get an inference service model + * Delete an inference endpoint * - * @see API + * @see API * specification */ -public class GetModelRequest extends RequestBase { +public class DeleteInferenceRequest extends RequestBase { + @Nullable + private final Boolean dryRun; + + @Nullable + private final Boolean force; + private final String inferenceId; @Nullable @@ -70,17 +76,41 @@ public class GetModelRequest extends RequestBase { // --------------------------------------------------------------------------------------------- - private GetModelRequest(Builder builder) { + private DeleteInferenceRequest(Builder builder) { + this.dryRun = builder.dryRun; + this.force = builder.force; this.inferenceId = ApiTypeHelper.requireNonNull(builder.inferenceId, this, "inferenceId"); this.taskType = builder.taskType; } - public static GetModelRequest of(Function> fn) { + public static DeleteInferenceRequest of(Function> fn) { return fn.apply(new Builder()).build(); } + /** + * When true, the endpoint is not deleted, and a list of ingest processors which + * reference this endpoint is returned + *

+ * API name: {@code dry_run} + */ + @Nullable + public final Boolean dryRun() { + return this.dryRun; + } + + /** + * When true, the inference endpoint is forcefully deleted even if it is still + * being used by ingest processors or semantic text fields + *

+ * API name: {@code force} + */ + @Nullable + public final Boolean force() { + return this.force; + } + /** * Required - The inference Id *

@@ -103,15 +133,45 @@ public final TaskType taskType() { // --------------------------------------------------------------------------------------------- /** - * Builder for {@link GetModelRequest}. + * Builder for {@link DeleteInferenceRequest}. */ - public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean dryRun; + + @Nullable + private Boolean force; + private String inferenceId; @Nullable private TaskType taskType; + /** + * When true, the endpoint is not deleted, and a list of ingest processors which + * reference this endpoint is returned + *

+ * API name: {@code dry_run} + */ + public final Builder dryRun(@Nullable Boolean value) { + this.dryRun = value; + return this; + } + + /** + * When true, the inference endpoint is forcefully deleted even if it is still + * being used by ingest processors or semantic text fields + *

+ * API name: {@code force} + */ + public final Builder force(@Nullable Boolean value) { + this.force = value; + return this; + } + /** * Required - The inference Id *

@@ -138,29 +198,29 @@ protected Builder self() { } /** - * Builds a {@link GetModelRequest}. + * Builds a {@link DeleteInferenceRequest}. * * @throws NullPointerException * if some of the required fields are null. */ - public GetModelRequest build() { + public DeleteInferenceRequest build() { _checkSingleUse(); - return new GetModelRequest(this); + return new DeleteInferenceRequest(this); } } // --------------------------------------------------------------------------------------------- /** - * Endpoint "{@code inference.get_model}". + * Endpoint "{@code inference.delete}". */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/inference.get_model", + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/inference.delete", // Request method request -> { - return "GET"; + return "DELETE"; }, @@ -219,7 +279,14 @@ public GetModelRequest build() { // Request parameters request -> { - return Collections.emptyMap(); + Map params = new HashMap<>(); + if (request.dryRun != null) { + params.put("dry_run", String.valueOf(request.dryRun)); + } + if (request.force != null) { + params.put("force", String.valueOf(request.force)); + } + return params; - }, SimpleEndpoint.emptyMap(), false, GetModelResponse._DESERIALIZER); + }, SimpleEndpoint.emptyMap(), false, DeleteInferenceResponse._DESERIALIZER); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteInferenceResponse.java similarity index 50% rename from java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteTemplateResponse.java rename to java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteInferenceResponse.java index 4a5dbdb5f..1ddee6c97 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteTemplateResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteInferenceResponse.java @@ -17,13 +17,8 @@ * under the License. */ -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- +package co.elastic.clients.elasticsearch.inference; -package co.elastic.clients.elasticsearch.indices; - -import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -33,65 +28,79 @@ import java.util.Objects; import java.util.function.Function; -// typedef: indices.delete_template.Response +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: inference.delete.Response /** * - * @see API + * @see API * specification */ @JsonpDeserializable -public class DeleteTemplateResponse extends AcknowledgedResponseBase { +public class DeleteInferenceResponse extends DeleteInferenceEndpointResult { // --------------------------------------------------------------------------------------------- - private DeleteTemplateResponse(Builder builder) { + private DeleteInferenceResponse(Builder builder) { super(builder); } - public static DeleteTemplateResponse of(Function> fn) { + public static DeleteInferenceResponse of(Function> fn) { return fn.apply(new Builder()).build(); } // --------------------------------------------------------------------------------------------- /** - * Builder for {@link DeleteTemplateResponse}. + * Builder for {@link DeleteInferenceResponse}. */ - public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + public static class Builder extends DeleteInferenceEndpointResult.AbstractBuilder implements - ObjectBuilder { + ObjectBuilder { @Override protected Builder self() { return this; } /** - * Builds a {@link DeleteTemplateResponse}. + * Builds a {@link DeleteInferenceResponse}. * * @throws NullPointerException * if some of the required fields are null. */ - public DeleteTemplateResponse build() { + public DeleteInferenceResponse build() { _checkSingleUse(); - return new DeleteTemplateResponse(this); + return new DeleteInferenceResponse(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link DeleteTemplateResponse} + * Json deserializer for {@link DeleteInferenceResponse} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DeleteTemplateResponse::setupDeleteTemplateResponseDeserializer); + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DeleteInferenceResponse::setupDeleteInferenceResponseDeserializer); - protected static void setupDeleteTemplateResponseDeserializer( - ObjectDeserializer op) { - AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + protected static void setupDeleteInferenceResponseDeserializer( + ObjectDeserializer op) { + DeleteInferenceEndpointResult.setupDeleteInferenceEndpointResultDeserializer(op); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceAsyncClient.java index 5a6fac587..64685ed53 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceAsyncClient.java @@ -67,76 +67,89 @@ public ElasticsearchInferenceAsyncClient withTransportOptions(@Nullable Transpor return new ElasticsearchInferenceAsyncClient(this.transport, transportOptions); } - // ----- Endpoint: inference.delete_model + // ----- Endpoint: inference.delete /** - * Delete model in the Inference API + * Delete an inference endpoint * * @see Documentation * on elastic.co */ - public CompletableFuture deleteModel(DeleteModelRequest request) { + public CompletableFuture delete(DeleteInferenceRequest request) { @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteModelRequest._ENDPOINT; + JsonEndpoint endpoint = (JsonEndpoint) DeleteInferenceRequest._ENDPOINT; return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Delete model in the Inference API + * Delete an inference endpoint * * @param fn * a function that initializes a builder to create the - * {@link DeleteModelRequest} + * {@link DeleteInferenceRequest} * @see Documentation * on elastic.co */ - public final CompletableFuture deleteModel( - Function> fn) { - return deleteModel(fn.apply(new DeleteModelRequest.Builder()).build()); + public final CompletableFuture delete( + Function> fn) { + return delete(fn.apply(new DeleteInferenceRequest.Builder()).build()); } - // ----- Endpoint: inference.get_model + // ----- Endpoint: inference.get /** - * Get a model in the Inference API + * Get an inference endpoint * * @see Documentation * on elastic.co */ - public CompletableFuture getModel(GetModelRequest request) { + public CompletableFuture get(GetInferenceRequest request) { @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetModelRequest._ENDPOINT; + JsonEndpoint endpoint = (JsonEndpoint) GetInferenceRequest._ENDPOINT; return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Get a model in the Inference API + * Get an inference endpoint * * @param fn * a function that initializes a builder to create the - * {@link GetModelRequest} + * {@link GetInferenceRequest} * @see Documentation * on elastic.co */ - public final CompletableFuture getModel( - Function> fn) { - return getModel(fn.apply(new GetModelRequest.Builder()).build()); + public final CompletableFuture get( + Function> fn) { + return get(fn.apply(new GetInferenceRequest.Builder()).build()); + } + + /** + * Get an inference endpoint + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture get() { + return this.transport.performRequestAsync(new GetInferenceRequest.Builder().build(), + GetInferenceRequest._ENDPOINT, this.transportOptions); } // ----- Endpoint: inference.inference /** - * Perform inference on a model + * Perform inference on the service * * @see Documentation @@ -151,7 +164,7 @@ public CompletableFuture inference(InferenceRequest request) } /** - * Perform inference on a model + * Perform inference on the service * * @param fn * a function that initializes a builder to create the @@ -166,37 +179,36 @@ public final CompletableFuture inference( return inference(fn.apply(new InferenceRequest.Builder()).build()); } - // ----- Endpoint: inference.put_model + // ----- Endpoint: inference.put /** - * Configure a model for use in the Inference API + * Create an inference endpoint * * @see Documentation * on elastic.co */ - public CompletableFuture putModel(PutModelRequest request) { + public CompletableFuture put(PutRequest request) { @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutModelRequest._ENDPOINT; + JsonEndpoint endpoint = (JsonEndpoint) PutRequest._ENDPOINT; return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Configure a model for use in the Inference API + * Create an inference endpoint * * @param fn * a function that initializes a builder to create the - * {@link PutModelRequest} + * {@link PutRequest} * @see Documentation * on elastic.co */ - public final CompletableFuture putModel( - Function> fn) { - return putModel(fn.apply(new PutModelRequest.Builder()).build()); + public final CompletableFuture put(Function> fn) { + return put(fn.apply(new PutRequest.Builder()).build()); } } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceClient.java index c46cc5480..753d3646c 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/ElasticsearchInferenceClient.java @@ -65,77 +65,90 @@ public ElasticsearchInferenceClient withTransportOptions(@Nullable TransportOpti return new ElasticsearchInferenceClient(this.transport, transportOptions); } - // ----- Endpoint: inference.delete_model + // ----- Endpoint: inference.delete /** - * Delete model in the Inference API + * Delete an inference endpoint * * @see Documentation * on elastic.co */ - public DeleteModelResponse deleteModel(DeleteModelRequest request) throws IOException, ElasticsearchException { + public DeleteInferenceResponse delete(DeleteInferenceRequest request) throws IOException, ElasticsearchException { @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) DeleteModelRequest._ENDPOINT; + JsonEndpoint endpoint = (JsonEndpoint) DeleteInferenceRequest._ENDPOINT; return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Delete model in the Inference API + * Delete an inference endpoint * * @param fn * a function that initializes a builder to create the - * {@link DeleteModelRequest} + * {@link DeleteInferenceRequest} * @see Documentation * on elastic.co */ - public final DeleteModelResponse deleteModel( - Function> fn) + public final DeleteInferenceResponse delete( + Function> fn) throws IOException, ElasticsearchException { - return deleteModel(fn.apply(new DeleteModelRequest.Builder()).build()); + return delete(fn.apply(new DeleteInferenceRequest.Builder()).build()); } - // ----- Endpoint: inference.get_model + // ----- Endpoint: inference.get /** - * Get a model in the Inference API + * Get an inference endpoint * * @see Documentation * on elastic.co */ - public GetModelResponse getModel(GetModelRequest request) throws IOException, ElasticsearchException { + public GetInferenceResponse get(GetInferenceRequest request) throws IOException, ElasticsearchException { @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) GetModelRequest._ENDPOINT; + JsonEndpoint endpoint = (JsonEndpoint) GetInferenceRequest._ENDPOINT; return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Get a model in the Inference API + * Get an inference endpoint * * @param fn * a function that initializes a builder to create the - * {@link GetModelRequest} + * {@link GetInferenceRequest} * @see Documentation * on elastic.co */ - public final GetModelResponse getModel(Function> fn) + public final GetInferenceResponse get(Function> fn) throws IOException, ElasticsearchException { - return getModel(fn.apply(new GetModelRequest.Builder()).build()); + return get(fn.apply(new GetInferenceRequest.Builder()).build()); + } + + /** + * Get an inference endpoint + * + * @see Documentation + * on elastic.co + */ + + public GetInferenceResponse get() throws IOException, ElasticsearchException { + return this.transport.performRequest(new GetInferenceRequest.Builder().build(), GetInferenceRequest._ENDPOINT, + this.transportOptions); } // ----- Endpoint: inference.inference /** - * Perform inference on a model + * Perform inference on the service * * @see Documentation @@ -150,7 +163,7 @@ public InferenceResponse inference(InferenceRequest request) throws IOException, } /** - * Perform inference on a model + * Perform inference on the service * * @param fn * a function that initializes a builder to create the @@ -165,37 +178,37 @@ public final InferenceResponse inference(FunctionDocumentation * on elastic.co */ - public PutModelResponse putModel(PutModelRequest request) throws IOException, ElasticsearchException { + public PutResponse put(PutRequest request) throws IOException, ElasticsearchException { @SuppressWarnings("unchecked") - JsonEndpoint endpoint = (JsonEndpoint) PutModelRequest._ENDPOINT; + JsonEndpoint endpoint = (JsonEndpoint) PutRequest._ENDPOINT; return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Configure a model for use in the Inference API + * Create an inference endpoint * * @param fn * a function that initializes a builder to create the - * {@link PutModelRequest} + * {@link PutRequest} * @see Documentation * on elastic.co */ - public final PutModelResponse putModel(Function> fn) + public final PutResponse put(Function> fn) throws IOException, ElasticsearchException { - return putModel(fn.apply(new PutModelRequest.Builder()).build()); + return put(fn.apply(new PutRequest.Builder()).build()); } } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteModelRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/GetInferenceRequest.java similarity index 79% rename from java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteModelRequest.java rename to java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/GetInferenceRequest.java index 58a8f73c6..8a167a202 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteModelRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/GetInferenceRequest.java @@ -27,7 +27,6 @@ import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.transport.Endpoint; import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; import java.lang.String; @@ -53,16 +52,17 @@ // //---------------------------------------------------------------- -// typedef: inference.delete_model.Request +// typedef: inference.get.Request /** - * Delete an inference service model + * Get an inference endpoint * - * @see API + * @see API * specification */ -public class DeleteModelRequest extends RequestBase { +public class GetInferenceRequest extends RequestBase { + @Nullable private final String inferenceId; @Nullable @@ -70,22 +70,23 @@ public class DeleteModelRequest extends RequestBase { // --------------------------------------------------------------------------------------------- - private DeleteModelRequest(Builder builder) { + private GetInferenceRequest(Builder builder) { - this.inferenceId = ApiTypeHelper.requireNonNull(builder.inferenceId, this, "inferenceId"); + this.inferenceId = builder.inferenceId; this.taskType = builder.taskType; } - public static DeleteModelRequest of(Function> fn) { + public static GetInferenceRequest of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * Required - The inference Id + * The inference Id *

* API name: {@code inference_id} */ + @Nullable public final String inferenceId() { return this.inferenceId; } @@ -103,23 +104,24 @@ public final TaskType taskType() { // --------------------------------------------------------------------------------------------- /** - * Builder for {@link DeleteModelRequest}. + * Builder for {@link GetInferenceRequest}. */ public static class Builder extends RequestBase.AbstractBuilder implements - ObjectBuilder { + ObjectBuilder { + @Nullable private String inferenceId; @Nullable private TaskType taskType; /** - * Required - The inference Id + * The inference Id *

* API name: {@code inference_id} */ - public final Builder inferenceId(String value) { + public final Builder inferenceId(@Nullable String value) { this.inferenceId = value; return this; } @@ -140,29 +142,29 @@ protected Builder self() { } /** - * Builds a {@link DeleteModelRequest}. + * Builds a {@link GetInferenceRequest}. * * @throws NullPointerException * if some of the required fields are null. */ - public DeleteModelRequest build() { + public GetInferenceRequest build() { _checkSingleUse(); - return new DeleteModelRequest(this); + return new GetInferenceRequest(this); } } // --------------------------------------------------------------------------------------------- /** - * Endpoint "{@code inference.delete_model}". + * Endpoint "{@code inference.get}". */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/inference.delete_model", + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/inference.get", // Request method request -> { - return "DELETE"; + return "GET"; }, @@ -173,10 +175,16 @@ public DeleteModelRequest build() { int propsSet = 0; - propsSet |= _inferenceId; + if (request.inferenceId() != null) + propsSet |= _inferenceId; if (request.taskType() != null) propsSet |= _taskType; + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_inference"); + return buf.toString(); + } if (propsSet == (_inferenceId)) { StringBuilder buf = new StringBuilder(); buf.append("/_inference"); @@ -205,10 +213,13 @@ public DeleteModelRequest build() { int propsSet = 0; - propsSet |= _inferenceId; + if (request.inferenceId() != null) + propsSet |= _inferenceId; if (request.taskType() != null) propsSet |= _taskType; + if (propsSet == 0) { + } if (propsSet == (_inferenceId)) { params.put("inferenceId", request.inferenceId); } @@ -223,5 +234,5 @@ public DeleteModelRequest build() { request -> { return Collections.emptyMap(); - }, SimpleEndpoint.emptyMap(), false, DeleteModelResponse._DESERIALIZER); + }, SimpleEndpoint.emptyMap(), false, GetInferenceResponse._DESERIALIZER); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/GetModelResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/GetInferenceResponse.java similarity index 59% rename from java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/GetModelResponse.java rename to java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/GetInferenceResponse.java index 1d02e083a..17a5d4458 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/GetModelResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/GetInferenceResponse.java @@ -50,34 +50,34 @@ // //---------------------------------------------------------------- -// typedef: inference.get_model.Response +// typedef: inference.get.Response /** * - * @see API + * @see API * specification */ @JsonpDeserializable -public class GetModelResponse implements JsonpSerializable { - private final List models; +public class GetInferenceResponse implements JsonpSerializable { + private final List endpoints; // --------------------------------------------------------------------------------------------- - private GetModelResponse(Builder builder) { + private GetInferenceResponse(Builder builder) { - this.models = ApiTypeHelper.unmodifiableRequired(builder.models, this, "models"); + this.endpoints = ApiTypeHelper.unmodifiableRequired(builder.endpoints, this, "endpoints"); } - public static GetModelResponse of(Function> fn) { + public static GetInferenceResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * Required - API name: {@code models} + * Required - API name: {@code endpoints} */ - public final List models() { - return this.models; + public final List endpoints() { + return this.endpoints; } /** @@ -91,10 +91,10 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - if (ApiTypeHelper.isDefined(this.models)) { - generator.writeKey("models"); + if (ApiTypeHelper.isDefined(this.endpoints)) { + generator.writeKey("endpoints"); generator.writeStartArray(); - for (ModelConfigContainer item0 : this.models) { + for (InferenceEndpointInfo item0 : this.endpoints) { item0.serialize(generator, mapper); } @@ -112,39 +112,42 @@ public String toString() { // --------------------------------------------------------------------------------------------- /** - * Builder for {@link GetModelResponse}. + * Builder for {@link GetInferenceResponse}. */ - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private List models; + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private List endpoints; /** - * Required - API name: {@code models} + * Required - API name: {@code endpoints} *

- * Adds all elements of list to models. + * Adds all elements of list to endpoints. */ - public final Builder models(List list) { - this.models = _listAddAll(this.models, list); + public final Builder endpoints(List list) { + this.endpoints = _listAddAll(this.endpoints, list); return this; } /** - * Required - API name: {@code models} + * Required - API name: {@code endpoints} *

- * Adds one or more values to models. + * Adds one or more values to endpoints. */ - public final Builder models(ModelConfigContainer value, ModelConfigContainer... values) { - this.models = _listAdd(this.models, value, values); + public final Builder endpoints(InferenceEndpointInfo value, InferenceEndpointInfo... values) { + this.endpoints = _listAdd(this.endpoints, value, values); return this; } /** - * Required - API name: {@code models} + * Required - API name: {@code endpoints} *

- * Adds a value to models using a builder lambda. + * Adds a value to endpoints using a builder lambda. */ - public final Builder models(Function> fn) { - return models(fn.apply(new ModelConfigContainer.Builder()).build()); + public final Builder endpoints( + Function> fn) { + return endpoints(fn.apply(new InferenceEndpointInfo.Builder()).build()); } @Override @@ -153,29 +156,30 @@ protected Builder self() { } /** - * Builds a {@link GetModelResponse}. + * Builds a {@link GetInferenceResponse}. * * @throws NullPointerException * if some of the required fields are null. */ - public GetModelResponse build() { + public GetInferenceResponse build() { _checkSingleUse(); - return new GetModelResponse(this); + return new GetInferenceResponse(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link GetModelResponse} + * Json deserializer for {@link GetInferenceResponse} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - GetModelResponse::setupGetModelResponseDeserializer); + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, GetInferenceResponse::setupGetInferenceResponseDeserializer); - protected static void setupGetModelResponseDeserializer(ObjectDeserializer op) { + protected static void setupGetInferenceResponseDeserializer(ObjectDeserializer op) { - op.add(Builder::models, JsonpDeserializer.arrayDeserializer(ModelConfigContainer._DESERIALIZER), "models"); + op.add(Builder::endpoints, JsonpDeserializer.arrayDeserializer(InferenceEndpointInfo._DESERIALIZER), + "endpoints"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/ModelConfig.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceEndpoint.java similarity index 82% rename from java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/ModelConfig.java rename to java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceEndpoint.java index f7a219e29..89d4b95a9 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/ModelConfig.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceEndpoint.java @@ -51,16 +51,17 @@ // //---------------------------------------------------------------- -// typedef: inference._types.ModelConfig +// typedef: inference._types.InferenceEndpoint /** - * Configuration options when storing the model config + * Configuration options when storing the inference endpoint * - * @see API + * @see API * specification */ @JsonpDeserializable -public class ModelConfig implements JsonpSerializable { +public class InferenceEndpoint implements JsonpSerializable { private final String service; private final JsonData serviceSettings; @@ -69,7 +70,7 @@ public class ModelConfig implements JsonpSerializable { // --------------------------------------------------------------------------------------------- - protected ModelConfig(AbstractBuilder builder) { + protected InferenceEndpoint(AbstractBuilder builder) { this.service = ApiTypeHelper.requireNonNull(builder.service, this, "service"); this.serviceSettings = ApiTypeHelper.requireNonNull(builder.serviceSettings, this, "serviceSettings"); @@ -77,7 +78,7 @@ protected ModelConfig(AbstractBuilder builder) { } - public static ModelConfig modelConfigOf(Function> fn) { + public static InferenceEndpoint inferenceEndpointOf(Function> fn) { return fn.apply(new Builder()).build(); } @@ -100,7 +101,7 @@ public final JsonData serviceSettings() { } /** - * Required - Task settings specific to the service and model + * Required - Task settings specific to the service and task type *

* API name: {@code task_settings} */ @@ -138,25 +139,27 @@ public String toString() { // --------------------------------------------------------------------------------------------- /** - * Builder for {@link ModelConfig}. + * Builder for {@link InferenceEndpoint}. */ - public static class Builder extends ModelConfig.AbstractBuilder implements ObjectBuilder { + public static class Builder extends InferenceEndpoint.AbstractBuilder + implements + ObjectBuilder { @Override protected Builder self() { return this; } /** - * Builds a {@link ModelConfig}. + * Builds a {@link InferenceEndpoint}. * * @throws NullPointerException * if some of the required fields are null. */ - public ModelConfig build() { + public InferenceEndpoint build() { _checkSingleUse(); - return new ModelConfig(this); + return new InferenceEndpoint(this); } } @@ -190,7 +193,7 @@ public final BuilderT serviceSettings(JsonData value) { } /** - * Required - Task settings specific to the service and model + * Required - Task settings specific to the service and task type *

* API name: {@code task_settings} */ @@ -206,12 +209,12 @@ public final BuilderT taskSettings(JsonData value) { // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link ModelConfig} + * Json deserializer for {@link InferenceEndpoint} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ModelConfig::setupModelConfigDeserializer); + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, InferenceEndpoint::setupInferenceEndpointDeserializer); - protected static > void setupModelConfigDeserializer( + protected static > void setupInferenceEndpointDeserializer( ObjectDeserializer op) { op.add(AbstractBuilder::service, JsonpDeserializer.stringDeserializer(), "service"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/ModelConfigContainer.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceEndpointInfo.java similarity index 67% rename from java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/ModelConfigContainer.java rename to java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceEndpointInfo.java index 10677d187..9ec75b927 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/ModelConfigContainer.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceEndpointInfo.java @@ -48,47 +48,47 @@ // //---------------------------------------------------------------- -// typedef: inference._types.ModelConfigContainer +// typedef: inference._types.InferenceEndpointInfo /** - * Represents a model as returned by the GET API + * Represents an inference endpoint as returned by the GET API * * @see API + * "../doc-files/api-spec.html#inference._types.InferenceEndpointInfo">API * specification */ @JsonpDeserializable -public class ModelConfigContainer extends ModelConfig { - private final String modelId; +public class InferenceEndpointInfo extends InferenceEndpoint { + private final String inferenceId; private final TaskType taskType; // --------------------------------------------------------------------------------------------- - protected ModelConfigContainer(AbstractBuilder builder) { + protected InferenceEndpointInfo(AbstractBuilder builder) { super(builder); - this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId"); + this.inferenceId = ApiTypeHelper.requireNonNull(builder.inferenceId, this, "inferenceId"); this.taskType = ApiTypeHelper.requireNonNull(builder.taskType, this, "taskType"); } - public static ModelConfigContainer modelConfigContainerOf( - Function> fn) { + public static InferenceEndpointInfo inferenceEndpointInfoOf( + Function> fn) { return fn.apply(new Builder()).build(); } /** - * Required - The model Id + * Required - The inference Id *

- * API name: {@code model_id} + * API name: {@code inference_id} */ - public final String modelId() { - return this.modelId; + public final String inferenceId() { + return this.inferenceId; } /** - * Required - The model's task type + * Required - The task type *

* API name: {@code task_type} */ @@ -99,8 +99,8 @@ public final TaskType taskType() { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { super.serializeInternal(generator, mapper); - generator.writeKey("model_id"); - generator.write(this.modelId); + generator.writeKey("inference_id"); + generator.write(this.inferenceId); generator.writeKey("task_type"); this.taskType.serialize(generator, mapper); @@ -110,49 +110,49 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { // --------------------------------------------------------------------------------------------- /** - * Builder for {@link ModelConfigContainer}. + * Builder for {@link InferenceEndpointInfo}. */ - public static class Builder extends ModelConfigContainer.AbstractBuilder + public static class Builder extends InferenceEndpointInfo.AbstractBuilder implements - ObjectBuilder { + ObjectBuilder { @Override protected Builder self() { return this; } /** - * Builds a {@link ModelConfigContainer}. + * Builds a {@link InferenceEndpointInfo}. * * @throws NullPointerException * if some of the required fields are null. */ - public ModelConfigContainer build() { + public InferenceEndpointInfo build() { _checkSingleUse(); - return new ModelConfigContainer(this); + return new InferenceEndpointInfo(this); } } public abstract static class AbstractBuilder> extends - ModelConfig.AbstractBuilder { - private String modelId; + InferenceEndpoint.AbstractBuilder { + private String inferenceId; private TaskType taskType; /** - * Required - The model Id + * Required - The inference Id *

- * API name: {@code model_id} + * API name: {@code inference_id} */ - public final BuilderT modelId(String value) { - this.modelId = value; + public final BuilderT inferenceId(String value) { + this.inferenceId = value; return self(); } /** - * Required - The model's task type + * Required - The task type *

* API name: {@code task_type} */ @@ -166,15 +166,15 @@ public final BuilderT taskType(TaskType value) { // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link ModelConfigContainer} + * Json deserializer for {@link InferenceEndpointInfo} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ModelConfigContainer::setupModelConfigContainerDeserializer); + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, InferenceEndpointInfo::setupInferenceEndpointInfoDeserializer); - protected static > void setupModelConfigContainerDeserializer( + protected static > void setupInferenceEndpointInfoDeserializer( ObjectDeserializer op) { - ModelConfig.setupModelConfigDeserializer(op); - op.add(AbstractBuilder::modelId, JsonpDeserializer.stringDeserializer(), "model_id"); + InferenceEndpoint.setupInferenceEndpointDeserializer(op); + op.add(AbstractBuilder::inferenceId, JsonpDeserializer.stringDeserializer(), "inference_id"); op.add(AbstractBuilder::taskType, TaskType._DESERIALIZER, "task_type"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceRequest.java index aaa83cb1c..90fc7c254 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceRequest.java @@ -21,6 +21,7 @@ import co.elastic.clients.elasticsearch._types.ErrorResponse; import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch._types.Time; import co.elastic.clients.json.JsonData; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; @@ -34,7 +35,6 @@ import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; import java.lang.String; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -71,20 +71,28 @@ public class InferenceRequest extends RequestBase implements JsonpSerializable { private final List input; + @Nullable + private final String query; + @Nullable private final JsonData taskSettings; @Nullable private final TaskType taskType; + @Nullable + private final Time timeout; + // --------------------------------------------------------------------------------------------- private InferenceRequest(Builder builder) { this.inferenceId = ApiTypeHelper.requireNonNull(builder.inferenceId, this, "inferenceId"); this.input = ApiTypeHelper.unmodifiableRequired(builder.input, this, "input"); + this.query = builder.query; this.taskSettings = builder.taskSettings; this.taskType = builder.taskType; + this.timeout = builder.timeout; } @@ -102,7 +110,7 @@ public final String inferenceId() { } /** - * Required - Text input to the model. Either a string or an array of strings. + * Required - Inference input. Either a string or an array of strings. *

* API name: {@code input} */ @@ -110,6 +118,16 @@ public final List input() { return this.input; } + /** + * Query input, required for rerank task. Not required for other tasks. + *

+ * API name: {@code query} + */ + @Nullable + public final String query() { + return this.query; + } + /** * Optional task settings *

@@ -130,6 +148,16 @@ public final TaskType taskType() { return this.taskType; } + /** + * Specifies the amount of time to wait for the inference request to complete. + *

+ * API name: {@code timeout} + */ + @Nullable + public final Time timeout() { + return this.timeout; + } + /** * Serialize this object to JSON. */ @@ -150,6 +178,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } generator.writeEnd(); + } + if (this.query != null) { + generator.writeKey("query"); + generator.write(this.query); + } if (this.taskSettings != null) { generator.writeKey("task_settings"); @@ -172,12 +205,18 @@ public static class Builder extends RequestBase.AbstractBuilder private List input; + @Nullable + private String query; + @Nullable private JsonData taskSettings; @Nullable private TaskType taskType; + @Nullable + private Time timeout; + /** * Required - The inference Id *

@@ -189,7 +228,7 @@ public final Builder inferenceId(String value) { } /** - * Required - Text input to the model. Either a string or an array of strings. + * Required - Inference input. Either a string or an array of strings. *

* API name: {@code input} *

@@ -201,7 +240,7 @@ public final Builder input(List list) { } /** - * Required - Text input to the model. Either a string or an array of strings. + * Required - Inference input. Either a string or an array of strings. *

* API name: {@code input} *

@@ -212,6 +251,16 @@ public final Builder input(String value, String... values) { return this; } + /** + * Query input, required for rerank task. Not required for other tasks. + *

+ * API name: {@code query} + */ + public final Builder query(@Nullable String value) { + this.query = value; + return this; + } + /** * Optional task settings *

@@ -232,6 +281,25 @@ public final Builder taskType(@Nullable TaskType value) { return this; } + /** + * Specifies the amount of time to wait for the inference request to complete. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(@Nullable Time value) { + this.timeout = value; + return this; + } + + /** + * Specifies the amount of time to wait for the inference request to complete. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(Function> fn) { + return this.timeout(fn.apply(new Time.Builder()).build()); + } + @Override protected Builder self() { return this; @@ -261,6 +329,7 @@ public InferenceRequest build() { protected static void setupInferenceRequestDeserializer(ObjectDeserializer op) { op.add(Builder::input, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "input"); + op.add(Builder::query, JsonpDeserializer.stringDeserializer(), "query"); op.add(Builder::taskSettings, JsonData._DESERIALIZER, "task_settings"); } @@ -334,7 +403,11 @@ protected static void setupInferenceRequestDeserializer(ObjectDeserializer { - return Collections.emptyMap(); + Map params = new HashMap<>(); + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; }, SimpleEndpoint.emptyMap(), true, InferenceResponse._DESERIALIZER); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceResult.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceResult.java index 616d2ea5b..ea2615821 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceResult.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/InferenceResult.java @@ -81,6 +81,10 @@ public enum Kind implements JsonEnum { SparseEmbedding("sparse_embedding"), + Completion("completion"), + + Rerank("rerank"), + ; private final String jsonValue; @@ -179,6 +183,40 @@ public List sparseEmbedding() { return TaggedUnionUtils.get(this, Kind.SparseEmbedding); } + /** + * Is this variant instance of kind {@code completion}? + */ + public boolean isCompletion() { + return _kind == Kind.Completion; + } + + /** + * Get the {@code completion} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code completion} kind. + */ + public List completion() { + return TaggedUnionUtils.get(this, Kind.Completion); + } + + /** + * Is this variant instance of kind {@code rerank}? + */ + public boolean isRerank() { + return _kind == Kind.Rerank; + } + + /** + * Get the {@code rerank} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code rerank} kind. + */ + public List rerank() { + return TaggedUnionUtils.get(this, Kind.Rerank); + } + @Override @SuppressWarnings("unchecked") public void serialize(JsonGenerator generator, JsonpMapper mapper) { @@ -216,6 +254,24 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { } generator.writeEnd(); + break; + case Completion : + generator.writeStartArray(); + for (CompletionResult item0 : ((List) this._value)) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + break; + case Rerank : + generator.writeStartArray(); + for (RankedDocument item0 : ((List) this._value)) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + break; } } @@ -255,6 +311,18 @@ public ObjectBuilder sparseEmbedding(List completion(List v) { + this._kind = Kind.Completion; + this._value = v; + return this; + } + + public ObjectBuilder rerank(List v) { + this._kind = Kind.Rerank; + this._value = v; + return this; + } + public InferenceResult build() { _checkSingleUse(); return new InferenceResult(this); @@ -270,6 +338,8 @@ protected static void setupInferenceResultDeserializer(ObjectDeserializer * Variants text_embedding_bytes, text_embedding, - * sparse_embedding are not available here as they don't have a - * dedicated class. Use {@link InferenceResult}'s builder for these. + * sparse_embedding, completion, rerank + * are not available here as they don't have a dedicated class. Use + * {@link InferenceResult}'s builder for these. * */ public class InferenceResultBuilders { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/PutModelRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/PutRequest.java similarity index 76% rename from java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/PutModelRequest.java rename to java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/PutRequest.java index 30c31115d..3de1fbd28 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/PutModelRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/PutRequest.java @@ -56,34 +56,34 @@ // //---------------------------------------------------------------- -// typedef: inference.put_model.Request +// typedef: inference.put.Request /** - * Create an inference service model + * Create an inference endpoint * - * @see API + * @see API * specification */ @JsonpDeserializable -public class PutModelRequest extends RequestBase implements JsonpSerializable { +public class PutRequest extends RequestBase implements JsonpSerializable { private final String inferenceId; @Nullable private final TaskType taskType; - private final ModelConfig modelConfig; + private final InferenceEndpoint inferenceConfig; // --------------------------------------------------------------------------------------------- - private PutModelRequest(Builder builder) { + private PutRequest(Builder builder) { this.inferenceId = ApiTypeHelper.requireNonNull(builder.inferenceId, this, "inferenceId"); this.taskType = builder.taskType; - this.modelConfig = ApiTypeHelper.requireNonNull(builder.modelConfig, this, "modelConfig"); + this.inferenceConfig = ApiTypeHelper.requireNonNull(builder.inferenceConfig, this, "inferenceConfig"); } - public static PutModelRequest of(Function> fn) { + public static PutRequest of(Function> fn) { return fn.apply(new Builder()).build(); } @@ -109,31 +109,31 @@ public final TaskType taskType() { /** * Required - Request body. */ - public final ModelConfig modelConfig() { - return this.modelConfig; + public final InferenceEndpoint inferenceConfig() { + return this.inferenceConfig; } /** * Serialize this value to JSON. */ public void serialize(JsonGenerator generator, JsonpMapper mapper) { - this.modelConfig.serialize(generator, mapper); + this.inferenceConfig.serialize(generator, mapper); } // --------------------------------------------------------------------------------------------- /** - * Builder for {@link PutModelRequest}. + * Builder for {@link PutRequest}. */ - public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { private String inferenceId; @Nullable private TaskType taskType; - private ModelConfig modelConfig; + private InferenceEndpoint inferenceConfig; /** * Required - The inference Id @@ -158,24 +158,24 @@ public final Builder taskType(@Nullable TaskType value) { /** * Required - Request body. */ - public final Builder modelConfig(ModelConfig value) { - this.modelConfig = value; + public final Builder inferenceConfig(InferenceEndpoint value) { + this.inferenceConfig = value; return this; } /** * Required - Request body. */ - public final Builder modelConfig(Function> fn) { - return this.modelConfig(fn.apply(new ModelConfig.Builder()).build()); + public final Builder inferenceConfig(Function> fn) { + return this.inferenceConfig(fn.apply(new InferenceEndpoint.Builder()).build()); } @Override public Builder withJson(JsonParser parser, JsonpMapper mapper) { @SuppressWarnings("unchecked") - ModelConfig value = (ModelConfig) ModelConfig._DESERIALIZER.deserialize(parser, mapper); - return this.modelConfig(value); + InferenceEndpoint value = (InferenceEndpoint) InferenceEndpoint._DESERIALIZER.deserialize(parser, mapper); + return this.inferenceConfig(value); } @Override @@ -184,34 +184,34 @@ protected Builder self() { } /** - * Builds a {@link PutModelRequest}. + * Builds a {@link PutRequest}. * * @throws NullPointerException * if some of the required fields are null. */ - public PutModelRequest build() { + public PutRequest build() { _checkSingleUse(); - return new PutModelRequest(this); + return new PutRequest(this); } } - public static final JsonpDeserializer _DESERIALIZER = createPutModelRequestDeserializer(); - protected static JsonpDeserializer createPutModelRequestDeserializer() { + public static final JsonpDeserializer _DESERIALIZER = createPutRequestDeserializer(); + protected static JsonpDeserializer createPutRequestDeserializer() { - JsonpDeserializer valueDeserializer = ModelConfig._DESERIALIZER; + JsonpDeserializer valueDeserializer = InferenceEndpoint._DESERIALIZER; return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() - .modelConfig(valueDeserializer.deserialize(parser, mapper, event)).build()); + .inferenceConfig(valueDeserializer.deserialize(parser, mapper, event)).build()); } // --------------------------------------------------------------------------------------------- /** - * Endpoint "{@code inference.put_model}". + * Endpoint "{@code inference.put}". */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/inference.put_model", + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/inference.put", // Request method request -> { @@ -276,5 +276,5 @@ protected static JsonpDeserializer createPutModelRequestDeseria request -> { return Collections.emptyMap(); - }, SimpleEndpoint.emptyMap(), true, PutModelResponse._DESERIALIZER); + }, SimpleEndpoint.emptyMap(), true, PutResponse._DESERIALIZER); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/PutModelResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/PutResponse.java similarity index 71% rename from java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/PutModelResponse.java rename to java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/PutResponse.java index 1d25f7476..ec984c519 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/PutModelResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/PutResponse.java @@ -43,63 +43,63 @@ // //---------------------------------------------------------------- -// typedef: inference.put_model.Response +// typedef: inference.put.Response /** * - * @see API + * @see API * specification */ @JsonpDeserializable -public class PutModelResponse extends ModelConfigContainer { +public class PutResponse extends InferenceEndpointInfo { // --------------------------------------------------------------------------------------------- - private PutModelResponse(Builder builder) { + private PutResponse(Builder builder) { super(builder); } - public static PutModelResponse of(Function> fn) { + public static PutResponse of(Function> fn) { return fn.apply(new Builder()).build(); } // --------------------------------------------------------------------------------------------- /** - * Builder for {@link PutModelResponse}. + * Builder for {@link PutResponse}. */ - public static class Builder extends ModelConfigContainer.AbstractBuilder + public static class Builder extends InferenceEndpointInfo.AbstractBuilder implements - ObjectBuilder { + ObjectBuilder { @Override protected Builder self() { return this; } /** - * Builds a {@link PutModelResponse}. + * Builds a {@link PutResponse}. * * @throws NullPointerException * if some of the required fields are null. */ - public PutModelResponse build() { + public PutResponse build() { _checkSingleUse(); - return new PutModelResponse(this); + return new PutResponse(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link PutModelResponse} + * Json deserializer for {@link PutResponse} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - PutModelResponse::setupPutModelResponseDeserializer); + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + PutResponse::setupPutResponseDeserializer); - protected static void setupPutModelResponseDeserializer(ObjectDeserializer op) { - ModelConfigContainer.setupModelConfigContainerDeserializer(op); + protected static void setupPutResponseDeserializer(ObjectDeserializer op) { + InferenceEndpointInfo.setupInferenceEndpointInfoDeserializer(op); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/RankedDocument.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/RankedDocument.java new file mode 100644 index 000000000..53207f3e4 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/RankedDocument.java @@ -0,0 +1,213 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.inference; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Float; +import java.lang.Integer; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: inference._types.RankedDocument + +/** + * The rerank result object representing a single ranked document id: the + * original index of the document in the request score: the score of the + * document relative to the query text: Optional, the text of the document, if + * requested + * + * @see API + * specification + */ +@JsonpDeserializable +public class RankedDocument implements JsonpSerializable { + private final int index; + + private final float score; + + @Nullable + private final String text; + + // --------------------------------------------------------------------------------------------- + + private RankedDocument(Builder builder) { + + this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); + this.score = ApiTypeHelper.requireNonNull(builder.score, this, "score"); + this.text = builder.text; + + } + + public static RankedDocument of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code index} + */ + public final int index() { + return this.index; + } + + /** + * Required - API name: {@code score} + */ + public final float score() { + return this.score; + } + + /** + * API name: {@code text} + */ + @Nullable + public final String text() { + return this.text; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeKey("index"); + generator.write(this.index); + + generator.writeKey("score"); + generator.write(this.score); + + if (this.text != null) { + generator.writeKey("text"); + generator.write(this.text); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link RankedDocument}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Integer index; + + private Float score; + + @Nullable + private String text; + + /** + * Required - API name: {@code index} + */ + public final Builder index(int value) { + this.index = value; + return this; + } + + /** + * Required - API name: {@code score} + */ + public final Builder score(float value) { + this.score = value; + return this; + } + + /** + * API name: {@code text} + */ + public final Builder text(@Nullable String value) { + this.text = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link RankedDocument}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public RankedDocument build() { + _checkSingleUse(); + + return new RankedDocument(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link RankedDocument} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + RankedDocument::setupRankedDocumentDeserializer); + + protected static void setupRankedDocumentDeserializer(ObjectDeserializer op) { + + op.add(Builder::index, JsonpDeserializer.integerDeserializer(), "index"); + op.add(Builder::score, JsonpDeserializer.floatDeserializer(), "score"); + op.add(Builder::text, JsonpDeserializer.stringDeserializer(), "text"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/TaskType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/TaskType.java index f64455e15..cfcc95195 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/TaskType.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/TaskType.java @@ -49,6 +49,10 @@ public enum TaskType implements JsonEnum { TextEmbedding("text_embedding"), + Rerank("rerank"), + + Completion("completion"), + ; private final String jsonValue; diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestAsyncClient.java index bfcb6838c..a5aeaa8e7 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestAsyncClient.java @@ -68,7 +68,7 @@ public ElasticsearchIngestAsyncClient withTransportOptions(@Nullable TransportOp // ----- Endpoint: ingest.delete_pipeline /** - * Deletes a pipeline. + * Deletes one or more existing ingest pipeline. * * @see Documentation @@ -83,7 +83,7 @@ public CompletableFuture deletePipeline(DeletePipelineRe } /** - * Deletes a pipeline. + * Deletes one or more existing ingest pipeline. * * @param fn * a function that initializes a builder to create the @@ -101,7 +101,8 @@ public final CompletableFuture deletePipeline( // ----- Endpoint: ingest.get_pipeline /** - * Returns a pipeline. + * Returns information about one or more ingest pipelines. This API returns a + * local reference of the pipeline. * * @see Documentation @@ -116,7 +117,8 @@ public CompletableFuture getPipeline(GetPipelineRequest req } /** - * Returns a pipeline. + * Returns information about one or more ingest pipelines. This API returns a + * local reference of the pipeline. * * @param fn * a function that initializes a builder to create the @@ -132,7 +134,8 @@ public final CompletableFuture getPipeline( } /** - * Returns a pipeline. + * Returns information about one or more ingest pipelines. This API returns a + * local reference of the pipeline. * * @see Documentation @@ -147,10 +150,13 @@ public CompletableFuture getPipeline() { // ----- Endpoint: ingest.processor_grok /** - * Returns a list of the built-in patterns. + * Extracts structured fields out of a single text field within a document. You + * choose which field to extract matched fields from, as well as the grok + * pattern you expect will match. A grok pattern is like a regular expression + * that supports aliased expressions that can be reused. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/grok-processor.html">Documentation * on elastic.co */ public CompletableFuture processorGrok() { @@ -161,10 +167,11 @@ public CompletableFuture processorGrok() { // ----- Endpoint: ingest.put_pipeline /** - * Creates or updates a pipeline. + * Creates or updates an ingest pipeline. Changes made using this API take + * effect immediately. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ingest.html">Documentation * on elastic.co */ @@ -176,13 +183,14 @@ public CompletableFuture putPipeline(PutPipelineRequest req } /** - * Creates or updates a pipeline. + * Creates or updates an ingest pipeline. Changes made using this API take + * effect immediately. * * @param fn * a function that initializes a builder to create the * {@link PutPipelineRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ingest.html">Documentation * on elastic.co */ @@ -194,7 +202,7 @@ public final CompletableFuture putPipeline( // ----- Endpoint: ingest.simulate /** - * Allows to simulate a pipeline with example documents. + * Executes an ingest pipeline against a set of provided documents. * * @see Documentation @@ -209,7 +217,7 @@ public CompletableFuture simulate(SimulateRequest request) { } /** - * Allows to simulate a pipeline with example documents. + * Executes an ingest pipeline against a set of provided documents. * * @param fn * a function that initializes a builder to create the @@ -225,7 +233,7 @@ public final CompletableFuture simulate( } /** - * Allows to simulate a pipeline with example documents. + * Executes an ingest pipeline against a set of provided documents. * * @see Documentation diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestClient.java index 8b9918abc..b18f9d55f 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestClient.java @@ -68,7 +68,7 @@ public ElasticsearchIngestClient withTransportOptions(@Nullable TransportOptions // ----- Endpoint: ingest.delete_pipeline /** - * Deletes a pipeline. + * Deletes one or more existing ingest pipeline. * * @see Documentation @@ -84,7 +84,7 @@ public DeletePipelineResponse deletePipeline(DeletePipelineRequest request) } /** - * Deletes a pipeline. + * Deletes one or more existing ingest pipeline. * * @param fn * a function that initializes a builder to create the @@ -103,7 +103,8 @@ public final DeletePipelineResponse deletePipeline( // ----- Endpoint: ingest.get_pipeline /** - * Returns a pipeline. + * Returns information about one or more ingest pipelines. This API returns a + * local reference of the pipeline. * * @see Documentation @@ -118,7 +119,8 @@ public GetPipelineResponse getPipeline(GetPipelineRequest request) throws IOExce } /** - * Returns a pipeline. + * Returns information about one or more ingest pipelines. This API returns a + * local reference of the pipeline. * * @param fn * a function that initializes a builder to create the @@ -135,7 +137,8 @@ public final GetPipelineResponse getPipeline( } /** - * Returns a pipeline. + * Returns information about one or more ingest pipelines. This API returns a + * local reference of the pipeline. * * @see Documentation @@ -150,10 +153,13 @@ public GetPipelineResponse getPipeline() throws IOException, ElasticsearchExcept // ----- Endpoint: ingest.processor_grok /** - * Returns a list of the built-in patterns. + * Extracts structured fields out of a single text field within a document. You + * choose which field to extract matched fields from, as well as the grok + * pattern you expect will match. A grok pattern is like a regular expression + * that supports aliased expressions that can be reused. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/grok-processor.html">Documentation * on elastic.co */ public ProcessorGrokResponse processorGrok() throws IOException, ElasticsearchException { @@ -164,10 +170,11 @@ public ProcessorGrokResponse processorGrok() throws IOException, ElasticsearchEx // ----- Endpoint: ingest.put_pipeline /** - * Creates or updates a pipeline. + * Creates or updates an ingest pipeline. Changes made using this API take + * effect immediately. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ingest.html">Documentation * on elastic.co */ @@ -179,13 +186,14 @@ public PutPipelineResponse putPipeline(PutPipelineRequest request) throws IOExce } /** - * Creates or updates a pipeline. + * Creates or updates an ingest pipeline. Changes made using this API take + * effect immediately. * * @param fn * a function that initializes a builder to create the * {@link PutPipelineRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ingest.html">Documentation * on elastic.co */ @@ -198,7 +206,7 @@ public final PutPipelineResponse putPipeline( // ----- Endpoint: ingest.simulate /** - * Allows to simulate a pipeline with example documents. + * Executes an ingest pipeline against a set of provided documents. * * @see Documentation @@ -213,7 +221,7 @@ public SimulateResponse simulate(SimulateRequest request) throws IOException, El } /** - * Allows to simulate a pipeline with example documents. + * Executes an ingest pipeline against a set of provided documents. * * @param fn * a function that initializes a builder to create the @@ -229,7 +237,7 @@ public final SimulateResponse simulate(FunctionDocumentation diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/RemoveProcessor.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/RemoveProcessor.java index 60410b521..4d6b1ebbc 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/RemoveProcessor.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/RemoveProcessor.java @@ -60,6 +60,8 @@ public class RemoveProcessor extends ProcessorBase implements ProcessorVariant { private final List field; + private final List keep; + @Nullable private final Boolean ignoreMissing; @@ -69,6 +71,7 @@ private RemoveProcessor(Builder builder) { super(builder); this.field = ApiTypeHelper.unmodifiableRequired(builder.field, this, "field"); + this.keep = ApiTypeHelper.unmodifiable(builder.keep); this.ignoreMissing = builder.ignoreMissing; } @@ -94,6 +97,16 @@ public final List field() { return this.field; } + /** + * Fields to be kept. When set, all fields other than those specified are + * removed. + *

+ * API name: {@code keep} + */ + public final List keep() { + return this.keep; + } + /** * If true and field does not exist or is * null, the processor quietly exits without modifying the @@ -118,6 +131,16 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { } generator.writeEnd(); + } + if (ApiTypeHelper.isDefined(this.keep)) { + generator.writeKey("keep"); + generator.writeStartArray(); + for (String item0 : this.keep) { + generator.write(item0); + + } + generator.writeEnd(); + } if (this.ignoreMissing != null) { generator.writeKey("ignore_missing"); @@ -138,6 +161,9 @@ public static class Builder extends ProcessorBase.AbstractBuilder ObjectBuilder { private List field; + @Nullable + private List keep; + @Nullable private Boolean ignoreMissing; @@ -165,6 +191,32 @@ public final Builder field(String value, String... values) { return this; } + /** + * Fields to be kept. When set, all fields other than those specified are + * removed. + *

+ * API name: {@code keep} + *

+ * Adds all elements of list to keep. + */ + public final Builder keep(List list) { + this.keep = _listAddAll(this.keep, list); + return this; + } + + /** + * Fields to be kept. When set, all fields other than those specified are + * removed. + *

+ * API name: {@code keep} + *

+ * Adds one or more values to keep. + */ + public final Builder keep(String value, String... values) { + this.keep = _listAdd(this.keep, value, values); + return this; + } + /** * If true and field does not exist or is * null, the processor quietly exits without modifying the @@ -206,6 +258,7 @@ public RemoveProcessor build() { protected static void setupRemoveProcessorDeserializer(ObjectDeserializer op) { ProcessorBase.setupProcessorBaseDeserializer(op); op.add(Builder::field, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "field"); + op.add(Builder::keep, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "keep"); op.add(Builder::ignoreMissing, JsonpDeserializer.booleanDeserializer(), "ignore_missing"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/license/ElasticsearchLicenseAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/license/ElasticsearchLicenseAsyncClient.java index 97107a335..a81e9b927 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/license/ElasticsearchLicenseAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/license/ElasticsearchLicenseAsyncClient.java @@ -70,7 +70,10 @@ public ElasticsearchLicenseAsyncClient withTransportOptions(@Nullable TransportO // ----- Endpoint: license.get /** - * Retrieves licensing information for the cluster + * This API returns information about the type of license, when it was issued, + * and when it expires, for example. For more information about the different + * types of licenses, see https://www.elastic.co/subscriptions. * * @see Documentation @@ -85,7 +88,10 @@ public CompletableFuture get(GetLicenseRequest request) { } /** - * Retrieves licensing information for the cluster + * This API returns information about the type of license, when it was issued, + * and when it expires, for example. For more information about the different + * types of licenses, see https://www.elastic.co/subscriptions. * * @param fn * a function that initializes a builder to create the @@ -101,7 +107,10 @@ public final CompletableFuture get( } /** - * Retrieves licensing information for the cluster + * This API returns information about the type of license, when it was issued, + * and when it expires, for example. For more information about the different + * types of licenses, see https://www.elastic.co/subscriptions. * * @see Documentation diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/license/ElasticsearchLicenseClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/license/ElasticsearchLicenseClient.java index 1ada9532e..8accbf228 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/license/ElasticsearchLicenseClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/license/ElasticsearchLicenseClient.java @@ -68,7 +68,10 @@ public ElasticsearchLicenseClient withTransportOptions(@Nullable TransportOption // ----- Endpoint: license.get /** - * Retrieves licensing information for the cluster + * This API returns information about the type of license, when it was issued, + * and when it expires, for example. For more information about the different + * types of licenses, see https://www.elastic.co/subscriptions. * * @see Documentation @@ -83,7 +86,10 @@ public GetLicenseResponse get(GetLicenseRequest request) throws IOException, Ela } /** - * Retrieves licensing information for the cluster + * This API returns information about the type of license, when it was issued, + * and when it expires, for example. For more information about the different + * types of licenses, see https://www.elastic.co/subscriptions. * * @param fn * a function that initializes a builder to create the @@ -99,7 +105,10 @@ public final GetLicenseResponse get(Functionhttps://www.elastic.co/subscriptions. * * @see Documentation diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/ElasticsearchLogstashAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/ElasticsearchLogstashAsyncClient.java index 148fd4e9d..af70c837a 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/ElasticsearchLogstashAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/ElasticsearchLogstashAsyncClient.java @@ -71,7 +71,7 @@ public ElasticsearchLogstashAsyncClient withTransportOptions(@Nullable Transport // ----- Endpoint: logstash.delete_pipeline /** - * Deletes Logstash Pipelines used by Central Management + * Deletes a pipeline used for Logstash Central Management. * * @see Documentation @@ -86,7 +86,7 @@ public CompletableFuture deletePipeline(DeletePipelineRequest r } /** - * Deletes Logstash Pipelines used by Central Management + * Deletes a pipeline used for Logstash Central Management. * * @param fn * a function that initializes a builder to create the @@ -104,7 +104,7 @@ public final CompletableFuture deletePipeline( // ----- Endpoint: logstash.get_pipeline /** - * Retrieves Logstash Pipelines used by Central Management + * Retrieves pipelines used for Logstash Central Management. * * @see Documentation @@ -119,7 +119,7 @@ public CompletableFuture getPipeline(GetPipelineRequest req } /** - * Retrieves Logstash Pipelines used by Central Management + * Retrieves pipelines used for Logstash Central Management. * * @param fn * a function that initializes a builder to create the @@ -135,7 +135,7 @@ public final CompletableFuture getPipeline( } /** - * Retrieves Logstash Pipelines used by Central Management + * Retrieves pipelines used for Logstash Central Management. * * @see Documentation @@ -150,7 +150,7 @@ public CompletableFuture getPipeline() { // ----- Endpoint: logstash.put_pipeline /** - * Adds and updates Logstash Pipelines used for Central Management + * Creates or updates a pipeline used for Logstash Central Management. * * @see Documentation @@ -165,7 +165,7 @@ public CompletableFuture putPipeline(PutPipelineRequest request } /** - * Adds and updates Logstash Pipelines used for Central Management + * Creates or updates a pipeline used for Logstash Central Management. * * @param fn * a function that initializes a builder to create the diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/ElasticsearchLogstashClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/ElasticsearchLogstashClient.java index 5b762f278..d0fa36a78 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/ElasticsearchLogstashClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/ElasticsearchLogstashClient.java @@ -69,7 +69,7 @@ public ElasticsearchLogstashClient withTransportOptions(@Nullable TransportOptio // ----- Endpoint: logstash.delete_pipeline /** - * Deletes Logstash Pipelines used by Central Management + * Deletes a pipeline used for Logstash Central Management. * * @see Documentation @@ -84,7 +84,7 @@ public BooleanResponse deletePipeline(DeletePipelineRequest request) throws IOEx } /** - * Deletes Logstash Pipelines used by Central Management + * Deletes a pipeline used for Logstash Central Management. * * @param fn * a function that initializes a builder to create the @@ -103,7 +103,7 @@ public final BooleanResponse deletePipeline( // ----- Endpoint: logstash.get_pipeline /** - * Retrieves Logstash Pipelines used by Central Management + * Retrieves pipelines used for Logstash Central Management. * * @see Documentation @@ -118,7 +118,7 @@ public GetPipelineResponse getPipeline(GetPipelineRequest request) throws IOExce } /** - * Retrieves Logstash Pipelines used by Central Management + * Retrieves pipelines used for Logstash Central Management. * * @param fn * a function that initializes a builder to create the @@ -135,7 +135,7 @@ public final GetPipelineResponse getPipeline( } /** - * Retrieves Logstash Pipelines used by Central Management + * Retrieves pipelines used for Logstash Central Management. * * @see Documentation @@ -150,7 +150,7 @@ public GetPipelineResponse getPipeline() throws IOException, ElasticsearchExcept // ----- Endpoint: logstash.put_pipeline /** - * Adds and updates Logstash Pipelines used for Central Management + * Creates or updates a pipeline used for Logstash Central Management. * * @see Documentation @@ -165,7 +165,7 @@ public BooleanResponse putPipeline(PutPipelineRequest request) throws IOExceptio } /** - * Adds and updates Logstash Pipelines used for Central Management + * Creates or updates a pipeline used for Logstash Central Management. * * @param fn * a function that initializes a builder to create the diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/CloseJobRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/CloseJobRequest.java index 1fe12d0ae..5e3f5de09 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/CloseJobRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/CloseJobRequest.java @@ -60,11 +60,11 @@ // typedef: ml.close_job.Request /** - * Closes one or more anomaly detection jobs. A job can be opened and closed - * multiple times throughout its lifecycle. A closed job cannot receive data or - * perform analysis operations, but you can still explore and navigate results. - * When you close a job, it runs housekeeping tasks such as pruning the model - * history, flushing buffers, calculating final results and persisting the model + * Close anomaly detection jobs A job can be opened and closed multiple times + * throughout its lifecycle. A closed job cannot receive data or perform + * analysis operations, but you can still explore and navigate results. When you + * close a job, it runs housekeeping tasks such as pruning the model history, + * flushing buffers, calculating final results and persisting the model * snapshots. Depending upon the size of the job, it could take several minutes * to close and the equivalent time to re-open. After it is closed, the job has * a minimal overhead on the cluster except for maintaining its meta data. diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlAsyncClient.java index 82ff3a9bc..0f1195c5b 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlAsyncClient.java @@ -69,11 +69,23 @@ public ElasticsearchMlAsyncClient withTransportOptions(@Nullable TransportOption // ----- Endpoint: ml.close_job /** - * Closes one or more anomaly detection jobs. A job can be opened and closed - * multiple times throughout its lifecycle. + * Close anomaly detection jobs A job can be opened and closed multiple times + * throughout its lifecycle. A closed job cannot receive data or perform + * analysis operations, but you can still explore and navigate results. When you + * close a job, it runs housekeeping tasks such as pruning the model history, + * flushing buffers, calculating final results and persisting the model + * snapshots. Depending upon the size of the job, it could take several minutes + * to close and the equivalent time to re-open. After it is closed, the job has + * a minimal overhead on the cluster except for maintaining its meta data. + * Therefore it is a best practice to close jobs that are no longer required to + * process data. If you close an anomaly detection job whose datafeed is + * running, the request first tries to stop the datafeed. This behavior is + * equivalent to calling stop datafeed API with the same timeout and force + * parameters as the close job request. When a datafeed that has a specified end + * date stops, it automatically closes its associated job. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-close-job.html">Documentation * on elastic.co */ @@ -85,14 +97,26 @@ public CompletableFuture closeJob(CloseJobRequest request) { } /** - * Closes one or more anomaly detection jobs. A job can be opened and closed - * multiple times throughout its lifecycle. + * Close anomaly detection jobs A job can be opened and closed multiple times + * throughout its lifecycle. A closed job cannot receive data or perform + * analysis operations, but you can still explore and navigate results. When you + * close a job, it runs housekeeping tasks such as pruning the model history, + * flushing buffers, calculating final results and persisting the model + * snapshots. Depending upon the size of the job, it could take several minutes + * to close and the equivalent time to re-open. After it is closed, the job has + * a minimal overhead on the cluster except for maintaining its meta data. + * Therefore it is a best practice to close jobs that are no longer required to + * process data. If you close an anomaly detection job whose datafeed is + * running, the request first tries to stop the datafeed. This behavior is + * equivalent to calling stop datafeed API with the same timeout and force + * parameters as the close job request. When a datafeed that has a specified end + * date stops, it automatically closes its associated job. * * @param fn * a function that initializes a builder to create the * {@link CloseJobRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-close-job.html">Documentation * on elastic.co */ @@ -104,10 +128,10 @@ public final CompletableFuture closeJob( // ----- Endpoint: ml.delete_calendar /** - * Deletes a calendar. + * Removes all scheduled events from a calendar, then deletes it. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-calendar.html">Documentation * on elastic.co */ @@ -119,13 +143,13 @@ public CompletableFuture deleteCalendar(DeleteCalendarRe } /** - * Deletes a calendar. + * Removes all scheduled events from a calendar, then deletes it. * * @param fn * a function that initializes a builder to create the * {@link DeleteCalendarRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-calendar.html">Documentation * on elastic.co */ @@ -140,7 +164,7 @@ public final CompletableFuture deleteCalendar( * Deletes scheduled events from a calendar. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-calendar-event.html">Documentation * on elastic.co */ @@ -158,7 +182,7 @@ public CompletableFuture deleteCalendarEvent(Delete * a function that initializes a builder to create the * {@link DeleteCalendarEventRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-calendar-event.html">Documentation * on elastic.co */ @@ -173,7 +197,7 @@ public final CompletableFuture deleteCalendarEvent( * Deletes anomaly detection jobs from a calendar. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-calendar-job.html">Documentation * on elastic.co */ @@ -191,7 +215,7 @@ public CompletableFuture deleteCalendarJob(DeleteCale * a function that initializes a builder to create the * {@link DeleteCalendarJobRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-calendar-job.html">Documentation * on elastic.co */ @@ -203,10 +227,10 @@ public final CompletableFuture deleteCalendarJob( // ----- Endpoint: ml.delete_data_frame_analytics /** - * Deletes an existing data frame analytics job. + * Deletes a data frame analytics job. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/delete-dfanalytics.html">Documentation * on elastic.co */ @@ -219,13 +243,13 @@ public CompletableFuture deleteDataFrameAnalyt } /** - * Deletes an existing data frame analytics job. + * Deletes a data frame analytics job. * * @param fn * a function that initializes a builder to create the * {@link DeleteDataFrameAnalyticsRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/delete-dfanalytics.html">Documentation * on elastic.co */ @@ -240,7 +264,7 @@ public final CompletableFuture deleteDataFrame * Deletes an existing datafeed. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-datafeed.html">Documentation * on elastic.co */ @@ -258,7 +282,7 @@ public CompletableFuture deleteDatafeed(DeleteDatafeedRe * a function that initializes a builder to create the * {@link DeleteDatafeedRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-datafeed.html">Documentation * on elastic.co */ @@ -270,7 +294,9 @@ public final CompletableFuture deleteDatafeed( // ----- Endpoint: ml.delete_filter /** - * Deletes a filter. + * Deletes a filter. If an anomaly detection job references the filter, you + * cannot delete the filter. You must update or delete the job before you can + * delete the filter. * * @see Documentation @@ -285,7 +311,9 @@ public CompletableFuture deleteFilter(DeleteFilterRequest } /** - * Deletes a filter. + * Deletes a filter. If an anomaly detection job references the filter, you + * cannot delete the filter. You must update or delete the job before you can + * delete the filter. * * @param fn * a function that initializes a builder to create the @@ -303,7 +331,14 @@ public final CompletableFuture deleteFilter( // ----- Endpoint: ml.delete_job /** - * Deletes an existing anomaly detection job. + * Deletes an anomaly detection job. + *

+ * All job configuration, model state and results are deleted. It is not + * currently possible to delete multiple jobs using wildcards or a comma + * separated list. If you delete a job that has a datafeed, the request first + * tries to delete the datafeed. This behavior is equivalent to calling the + * delete datafeed API with the same timeout and force parameters as the delete + * job request. * * @see Documentation @@ -318,7 +353,14 @@ public CompletableFuture deleteJob(DeleteJobRequest request) } /** - * Deletes an existing anomaly detection job. + * Deletes an anomaly detection job. + *

+ * All job configuration, model state and results are deleted. It is not + * currently possible to delete multiple jobs using wildcards or a comma + * separated list. If you delete a job that has a datafeed, the request first + * tries to delete the datafeed. This behavior is equivalent to calling the + * delete datafeed API with the same timeout and force parameters as the delete + * job request. * * @param fn * a function that initializes a builder to create the @@ -371,7 +413,10 @@ public final CompletableFuture deleteTrainedModel( // ----- Endpoint: ml.delete_trained_model_alias /** - * Deletes a model alias that refers to the trained model + * Deletes a trained model alias. This API deletes an existing model alias that + * refers to a trained model. If the model alias is missing or refers to a model + * other than the one identified by the model_id, this API returns + * an error. * * @see Documentation @@ -387,7 +432,10 @@ public CompletableFuture deleteTrainedModelAlia } /** - * Deletes a model alias that refers to the trained model + * Deletes a trained model alias. This API deletes an existing model alias that + * refers to a trained model. If the model alias is missing or refers to a model + * other than the one identified by the model_id, this API returns + * an error. * * @param fn * a function that initializes a builder to create the @@ -405,7 +453,9 @@ public final CompletableFuture deleteTrainedMod // ----- Endpoint: ml.estimate_model_memory /** - * Estimates the model memory + * Makes an estimation of the memory usage for an anomaly detection job model. + * It is based on analysis configuration details for the job and cardinality + * estimates for the fields it references. * * @see Documentation @@ -420,7 +470,9 @@ public CompletableFuture estimateModelMemory(Estima } /** - * Estimates the model memory + * Makes an estimation of the memory usage for an anomaly detection job model. + * It is based on analysis configuration details for the job and cardinality + * estimates for the fields it references. * * @param fn * a function that initializes a builder to create the @@ -436,7 +488,9 @@ public final CompletableFuture estimateModelMemory( } /** - * Estimates the model memory + * Makes an estimation of the memory usage for an anomaly detection job model. + * It is based on analysis configuration details for the job and cardinality + * estimates for the fields it references. * * @see Documentation @@ -451,7 +505,11 @@ public CompletableFuture estimateModelMemory() { // ----- Endpoint: ml.evaluate_data_frame /** - * Evaluates the data frame analytics for an annotated index. + * Evaluates the data frame analytics for an annotated index. The API packages + * together commonly used evaluation metrics for various types of machine + * learning features. This has been designed for use on indexes created by data + * frame analytics. Evaluation requires both a ground truth field and an + * analytics result field to be present. * * @see Documentation @@ -466,7 +524,11 @@ public CompletableFuture evaluateDataFrame(EvaluateDa } /** - * Evaluates the data frame analytics for an annotated index. + * Evaluates the data frame analytics for an annotated index. The API packages + * together commonly used evaluation metrics for various types of machine + * learning features. This has been designed for use on indexes created by data + * frame analytics. Evaluation requires both a ground truth field and an + * analytics result field to be present. * * @param fn * a function that initializes a builder to create the @@ -484,7 +546,14 @@ public final CompletableFuture evaluateDataFrame( // ----- Endpoint: ml.flush_job /** - * Forces any buffered data to be processed by the job. + * Forces any buffered data to be processed by the job. The flush jobs API is + * only applicable when sending data for analysis using the post data API. + * Depending on the content of the buffer, then it might additionally calculate + * new results. Both flush and close operations are similar, however the flush + * is more efficient if you are expecting to send more data for analysis. When + * flushing, the job remains open and is available to continue analyzing data. A + * close operation additionally prunes and persists the model state to disk and + * the job must be opened again before analyzing further data. * * @see Documentation @@ -499,7 +568,14 @@ public CompletableFuture flushJob(FlushJobRequest request) { } /** - * Forces any buffered data to be processed by the job. + * Forces any buffered data to be processed by the job. The flush jobs API is + * only applicable when sending data for analysis using the post data API. + * Depending on the content of the buffer, then it might additionally calculate + * new results. Both flush and close operations are similar, however the flush + * is more efficient if you are expecting to send more data for analysis. When + * flushing, the job remains open and is available to continue analyzing data. A + * close operation additionally prunes and persists the model state to disk and + * the job must be opened again before analyzing further data. * * @param fn * a function that initializes a builder to create the @@ -596,7 +672,10 @@ public CompletableFuture getCalendars() { // ----- Endpoint: ml.get_data_frame_analytics /** - * Retrieves configuration information for data frame analytics jobs. + * Retrieves configuration information for data frame analytics jobs. You can + * get information for multiple data frame analytics jobs in a single API + * request by using a comma-separated list of data frame analytics jobs or a + * wildcard expression. * * @see Documentation @@ -612,7 +691,10 @@ public CompletableFuture getDataFrameAnalytics( } /** - * Retrieves configuration information for data frame analytics jobs. + * Retrieves configuration information for data frame analytics jobs. You can + * get information for multiple data frame analytics jobs in a single API + * request by using a comma-separated list of data frame analytics jobs or a + * wildcard expression. * * @param fn * a function that initializes a builder to create the @@ -628,7 +710,10 @@ public final CompletableFuture getDataFrameAnalyt } /** - * Retrieves configuration information for data frame analytics jobs. + * Retrieves configuration information for data frame analytics jobs. You can + * get information for multiple data frame analytics jobs in a single API + * request by using a comma-separated list of data frame analytics jobs or a + * wildcard expression. * * @see Documentation @@ -690,7 +775,14 @@ public CompletableFuture getDataFrameAnalyti // ----- Endpoint: ml.get_datafeed_stats /** - * Retrieves usage information for datafeeds. + * Retrieves usage information for datafeeds. You can get statistics for + * multiple datafeeds in a single API request by using a comma-separated list of + * datafeeds or a wildcard expression. You can get statistics for all datafeeds + * by using _all, by specifying * as the + * <feed_id>, or by omitting the + * <feed_id>. If the datafeed is stopped, the only + * information you receive is the datafeed_id and the + * state. This API returns a maximum of 10,000 datafeeds. * * @see Documentation @@ -705,7 +797,14 @@ public CompletableFuture getDatafeedStats(GetDatafeedS } /** - * Retrieves usage information for datafeeds. + * Retrieves usage information for datafeeds. You can get statistics for + * multiple datafeeds in a single API request by using a comma-separated list of + * datafeeds or a wildcard expression. You can get statistics for all datafeeds + * by using _all, by specifying * as the + * <feed_id>, or by omitting the + * <feed_id>. If the datafeed is stopped, the only + * information you receive is the datafeed_id and the + * state. This API returns a maximum of 10,000 datafeeds. * * @param fn * a function that initializes a builder to create the @@ -721,7 +820,14 @@ public final CompletableFuture getDatafeedStats( } /** - * Retrieves usage information for datafeeds. + * Retrieves usage information for datafeeds. You can get statistics for + * multiple datafeeds in a single API request by using a comma-separated list of + * datafeeds or a wildcard expression. You can get statistics for all datafeeds + * by using _all, by specifying * as the + * <feed_id>, or by omitting the + * <feed_id>. If the datafeed is stopped, the only + * information you receive is the datafeed_id and the + * state. This API returns a maximum of 10,000 datafeeds. * * @see Documentation @@ -736,7 +842,12 @@ public CompletableFuture getDatafeedStats() { // ----- Endpoint: ml.get_datafeeds /** - * Retrieves configuration information for datafeeds. + * Retrieves configuration information for datafeeds. You can get information + * for multiple datafeeds in a single API request by using a comma-separated + * list of datafeeds or a wildcard expression. You can get information for all + * datafeeds by using _all, by specifying * as the + * <feed_id>, or by omitting the + * <feed_id>. This API returns a maximum of 10,000 datafeeds. * * @see Documentation @@ -751,7 +862,12 @@ public CompletableFuture getDatafeeds(GetDatafeedsRequest } /** - * Retrieves configuration information for datafeeds. + * Retrieves configuration information for datafeeds. You can get information + * for multiple datafeeds in a single API request by using a comma-separated + * list of datafeeds or a wildcard expression. You can get information for all + * datafeeds by using _all, by specifying * as the + * <feed_id>, or by omitting the + * <feed_id>. This API returns a maximum of 10,000 datafeeds. * * @param fn * a function that initializes a builder to create the @@ -767,7 +883,12 @@ public final CompletableFuture getDatafeeds( } /** - * Retrieves configuration information for datafeeds. + * Retrieves configuration information for datafeeds. You can get information + * for multiple datafeeds in a single API request by using a comma-separated + * list of datafeeds or a wildcard expression. You can get information for all + * datafeeds by using _all, by specifying * as the + * <feed_id>, or by omitting the + * <feed_id>. This API returns a maximum of 10,000 datafeeds. * * @see Documentation @@ -782,7 +903,7 @@ public CompletableFuture getDatafeeds() { // ----- Endpoint: ml.get_filters /** - * Retrieves filters. + * Retrieves filters. You can get a single filter or all filters. * * @see Documentation @@ -797,7 +918,7 @@ public CompletableFuture getFilters(GetFiltersRequest reques } /** - * Retrieves filters. + * Retrieves filters. You can get a single filter or all filters. * * @param fn * a function that initializes a builder to create the @@ -813,7 +934,7 @@ public final CompletableFuture getFilters( } /** - * Retrieves filters. + * Retrieves filters. You can get a single filter or all filters. * * @see Documentation @@ -874,7 +995,12 @@ public CompletableFuture getJobStats() { // ----- Endpoint: ml.get_jobs /** - * Retrieves configuration information for anomaly detection jobs. + * Retrieves configuration information for anomaly detection jobs. You can get + * information for multiple anomaly detection jobs in a single API request by + * using a group name, a comma-separated list of jobs, or a wildcard expression. + * You can get information for all anomaly detection jobs by using + * _all, by specifying * as the + * <job_id>, or by omitting the <job_id>. * * @see Documentation @@ -889,7 +1015,12 @@ public CompletableFuture getJobs(GetJobsRequest request) { } /** - * Retrieves configuration information for anomaly detection jobs. + * Retrieves configuration information for anomaly detection jobs. You can get + * information for multiple anomaly detection jobs in a single API request by + * using a group name, a comma-separated list of jobs, or a wildcard expression. + * You can get information for all anomaly detection jobs by using + * _all, by specifying * as the + * <job_id>, or by omitting the <job_id>. * * @param fn * a function that initializes a builder to create the @@ -905,7 +1036,12 @@ public final CompletableFuture getJobs( } /** - * Retrieves configuration information for anomaly detection jobs. + * Retrieves configuration information for anomaly detection jobs. You can get + * information for multiple anomaly detection jobs in a single API request by + * using a group name, a comma-separated list of jobs, or a wildcard expression. + * You can get information for all anomaly detection jobs by using + * _all, by specifying * as the + * <job_id>, or by omitting the <job_id>. * * @see Documentation @@ -922,6 +1058,21 @@ public CompletableFuture getJobs() { /** * Retrieves overall bucket results that summarize the bucket results of * multiple anomaly detection jobs. + *

+ * The overall_score is calculated by combining the scores of all + * the buckets within the overall bucket span. First, the maximum + * anomaly_score per anomaly detection job in the overall bucket is + * calculated. Then the top_n of those scores are averaged to + * result in the overall_score. This means that you can fine-tune + * the overall_score so that it is more or less sensitive to the + * number of jobs that detect an anomaly at the same time. For example, if you + * set top_n to 1, the overall_score is + * the maximum bucket score in the overall bucket. Alternatively, if you set + * top_n to the number of jobs, the overall_score is + * high only when all jobs detect anomalies in that overall bucket. If you set + * the bucket_span parameter (to a value greater than its default), + * the overall_score is the maximum overall_score of + * the overall buckets that have a span equal to the jobs' largest bucket span. * * @see Documentation @@ -938,6 +1089,21 @@ public CompletableFuture getOverallBuckets(GetOverall /** * Retrieves overall bucket results that summarize the bucket results of * multiple anomaly detection jobs. + *

+ * The overall_score is calculated by combining the scores of all + * the buckets within the overall bucket span. First, the maximum + * anomaly_score per anomaly detection job in the overall bucket is + * calculated. Then the top_n of those scores are averaged to + * result in the overall_score. This means that you can fine-tune + * the overall_score so that it is more or less sensitive to the + * number of jobs that detect an anomaly at the same time. For example, if you + * set top_n to 1, the overall_score is + * the maximum bucket score in the overall bucket. Alternatively, if you set + * top_n to the number of jobs, the overall_score is + * high only when all jobs detect anomalies in that overall bucket. If you set + * the bucket_span parameter (to a value greater than its default), + * the overall_score is the maximum overall_score of + * the overall buckets that have a span equal to the jobs' largest bucket span. * * @param fn * a function that initializes a builder to create the @@ -955,7 +1121,7 @@ public final CompletableFuture getOverallBuckets( // ----- Endpoint: ml.get_trained_models /** - * Retrieves configuration information for a trained inference model. + * Retrieves configuration information for a trained model. * * @see Documentation @@ -970,7 +1136,7 @@ public CompletableFuture getTrainedModels(GetTrainedMo } /** - * Retrieves configuration information for a trained inference model. + * Retrieves configuration information for a trained model. * * @param fn * a function that initializes a builder to create the @@ -986,7 +1152,7 @@ public final CompletableFuture getTrainedModels( } /** - * Retrieves configuration information for a trained inference model. + * Retrieves configuration information for a trained model. * * @see Documentation @@ -1001,7 +1167,9 @@ public CompletableFuture getTrainedModels() { // ----- Endpoint: ml.get_trained_models_stats /** - * Retrieves usage information for trained inference models. + * Retrieves usage information for trained models. You can get usage information + * for multiple trained models in a single API request by using a + * comma-separated list of model IDs or a wildcard expression. * * @see Documentation @@ -1017,7 +1185,9 @@ public CompletableFuture getTrainedModelsStats( } /** - * Retrieves usage information for trained inference models. + * Retrieves usage information for trained models. You can get usage information + * for multiple trained models in a single API request by using a + * comma-separated list of model IDs or a wildcard expression. * * @param fn * a function that initializes a builder to create the @@ -1033,7 +1203,9 @@ public final CompletableFuture getTrainedModelsSt } /** - * Retrieves usage information for trained inference models. + * Retrieves usage information for trained models. You can get usage information + * for multiple trained models in a single API request by using a + * comma-separated list of model IDs or a wildcard expression. * * @see Documentation @@ -1048,7 +1220,7 @@ public CompletableFuture getTrainedModelsStats() // ----- Endpoint: ml.infer_trained_model /** - * Evaluate a trained model. + * Evaluates a trained model. * * @see Documentation @@ -1063,7 +1235,7 @@ public CompletableFuture inferTrainedModel(InferTrain } /** - * Evaluate a trained model. + * Evaluates a trained model. * * @param fn * a function that initializes a builder to create the @@ -1081,7 +1253,12 @@ public final CompletableFuture inferTrainedModel( // ----- Endpoint: ml.open_job /** - * Opens one or more anomaly detection jobs. + * Opens one or more anomaly detection jobs. An anomaly detection job must be + * opened in order for it to be ready to receive and analyze data. It can be + * opened and closed multiple times throughout its lifecycle. When you open a + * new job, it starts with an empty model. When you open an existing job, the + * most recent model state is automatically loaded. The job is ready to resume + * its analysis from where it left off, once new data is received. * * @see Documentation @@ -1096,7 +1273,12 @@ public CompletableFuture openJob(OpenJobRequest request) { } /** - * Opens one or more anomaly detection jobs. + * Opens one or more anomaly detection jobs. An anomaly detection job must be + * opened in order for it to be ready to receive and analyze data. It can be + * opened and closed multiple times throughout its lifecycle. When you open a + * new job, it starts with an empty model. When you open an existing job, the + * most recent model state is automatically loaded. The job is ready to resume + * its analysis from where it left off, once new data is received. * * @param fn * a function that initializes a builder to create the @@ -1114,7 +1296,7 @@ public final CompletableFuture openJob( // ----- Endpoint: ml.post_calendar_events /** - * Posts scheduled events in a calendar. + * Adds scheduled events to a calendar. * * @see Documentation @@ -1129,7 +1311,7 @@ public CompletableFuture postCalendarEvents(PostCale } /** - * Posts scheduled events in a calendar. + * Adds scheduled events to a calendar. * * @param fn * a function that initializes a builder to create the @@ -1147,7 +1329,7 @@ public final CompletableFuture postCalendarEvents( // ----- Endpoint: ml.preview_data_frame_analytics /** - * Previews that will be analyzed given a data frame analytics config. + * Previews the extracted features used by a data frame analytics config. * * @see Documentation @@ -1163,7 +1345,7 @@ public CompletableFuture previewDataFrameAnal } /** - * Previews that will be analyzed given a data frame analytics config. + * Previews the extracted features used by a data frame analytics config. * * @param fn * a function that initializes a builder to create the @@ -1179,7 +1361,7 @@ public final CompletableFuture previewDataFra } /** - * Previews that will be analyzed given a data frame analytics config. + * Previews the extracted features used by a data frame analytics config. * * @see Documentation @@ -1194,7 +1376,16 @@ public CompletableFuture previewDataFrameAnal // ----- Endpoint: ml.preview_datafeed /** - * Previews a datafeed. + * Previews a datafeed. This API returns the first "page" of search + * results from a datafeed. You can preview an existing datafeed or provide + * configuration details for a datafeed and anomaly detection job in the API. + * The preview shows the structure of the data that will be passed to the + * anomaly detection engine. IMPORTANT: When Elasticsearch security features are + * enabled, the preview uses the credentials of the user that called the API. + * However, when the datafeed starts it uses the roles of the last user that + * created or updated the datafeed. To get a preview that accurately reflects + * the behavior of the datafeed, use the appropriate credentials. You can also + * use secondary authorization headers to supply the credentials. * * @see Documentation @@ -1206,13 +1397,23 @@ public CompletableFuture> preview @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) PreviewDatafeedRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:ml.preview_datafeed.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:ml.preview_datafeed.Response.TDocument", + getDeserializer(tDocumentClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Previews a datafeed. + * Previews a datafeed. This API returns the first "page" of search + * results from a datafeed. You can preview an existing datafeed or provide + * configuration details for a datafeed and anomaly detection job in the API. + * The preview shows the structure of the data that will be passed to the + * anomaly detection engine. IMPORTANT: When Elasticsearch security features are + * enabled, the preview uses the credentials of the user that called the API. + * However, when the datafeed starts it uses the roles of the last user that + * created or updated the datafeed. To get a preview that accurately reflects + * the behavior of the datafeed, use the appropriate credentials. You can also + * use secondary authorization headers to supply the credentials. * * @param fn * a function that initializes a builder to create the @@ -1229,7 +1430,16 @@ public final CompletableFuture> p } /** - * Previews a datafeed. + * Previews a datafeed. This API returns the first "page" of search + * results from a datafeed. You can preview an existing datafeed or provide + * configuration details for a datafeed and anomaly detection job in the API. + * The preview shows the structure of the data that will be passed to the + * anomaly detection engine. IMPORTANT: When Elasticsearch security features are + * enabled, the preview uses the credentials of the user that called the API. + * However, when the datafeed starts it uses the roles of the last user that + * created or updated the datafeed. To get a preview that accurately reflects + * the behavior of the datafeed, use the appropriate credentials. You can also + * use secondary authorization headers to supply the credentials. * * @see Documentation @@ -1241,13 +1451,23 @@ public CompletableFuture> preview @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) PreviewDatafeedRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:ml.preview_datafeed.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:ml.preview_datafeed.Response.TDocument", + getDeserializer(tDocumentType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Previews a datafeed. + * Previews a datafeed. This API returns the first "page" of search + * results from a datafeed. You can preview an existing datafeed or provide + * configuration details for a datafeed and anomaly detection job in the API. + * The preview shows the structure of the data that will be passed to the + * anomaly detection engine. IMPORTANT: When Elasticsearch security features are + * enabled, the preview uses the credentials of the user that called the API. + * However, when the datafeed starts it uses the roles of the last user that + * created or updated the datafeed. To get a preview that accurately reflects + * the behavior of the datafeed, use the appropriate credentials. You can also + * use secondary authorization headers to supply the credentials. * * @param fn * a function that initializes a builder to create the @@ -1265,7 +1485,7 @@ public final CompletableFuture> p // ----- Endpoint: ml.put_calendar /** - * Instantiates a calendar. + * Creates a calendar. * * @see Documentation @@ -1280,7 +1500,7 @@ public CompletableFuture putCalendar(PutCalendarRequest req } /** - * Instantiates a calendar. + * Creates a calendar. * * @param fn * a function that initializes a builder to create the @@ -1331,10 +1551,12 @@ public final CompletableFuture putCalendarJob( // ----- Endpoint: ml.put_data_frame_analytics /** - * Instantiates a data frame analytics job. + * Instantiates a data frame analytics job. This API creates a data frame + * analytics job that performs an analysis on the source indices and stores the + * outcome in a destination index. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/put-dfanalytics.html">Documentation * on elastic.co */ @@ -1347,13 +1569,15 @@ public CompletableFuture putDataFrameAnalytics( } /** - * Instantiates a data frame analytics job. + * Instantiates a data frame analytics job. This API creates a data frame + * analytics job that performs an analysis on the source indices and stores the + * outcome in a destination index. * * @param fn * a function that initializes a builder to create the * {@link PutDataFrameAnalyticsRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/put-dfanalytics.html">Documentation * on elastic.co */ @@ -1365,7 +1589,13 @@ public final CompletableFuture putDataFrameAnalyt // ----- Endpoint: ml.put_datafeed /** - * Instantiates a datafeed. + * Instantiates a datafeed. Datafeeds retrieve data from Elasticsearch for + * analysis by an anomaly detection job. You can associate only one datafeed + * with each anomaly detection job. The datafeed contains a query that runs at a + * defined interval (frequency). If you are concerned about delayed + * data, you can add a delay + * (query_delay') at each interval. When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead. You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed directly to the .ml-configindex. Do not give userswriteprivileges on the.ml-config` + * index. * * @see Documentation @@ -1380,7 +1610,13 @@ public CompletableFuture putDatafeed(PutDatafeedRequest req } /** - * Instantiates a datafeed. + * Instantiates a datafeed. Datafeeds retrieve data from Elasticsearch for + * analysis by an anomaly detection job. You can associate only one datafeed + * with each anomaly detection job. The datafeed contains a query that runs at a + * defined interval (frequency). If you are concerned about delayed + * data, you can add a delay + * (query_delay') at each interval. When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead. You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed directly to the .ml-configindex. Do not give userswriteprivileges on the.ml-config` + * index. * * @param fn * a function that initializes a builder to create the @@ -1398,7 +1634,9 @@ public final CompletableFuture putDatafeed( // ----- Endpoint: ml.put_filter /** - * Instantiates a filter. + * Instantiates a filter. A filter contains a list of strings. It can be used by + * one or more anomaly detection jobs. Specifically, filters are referenced in + * the custom_rules property of detector configuration objects. * * @see Documentation @@ -1413,7 +1651,9 @@ public CompletableFuture putFilter(PutFilterRequest request) } /** - * Instantiates a filter. + * Instantiates a filter. A filter contains a list of strings. It can be used by + * one or more anomaly detection jobs. Specifically, filters are referenced in + * the custom_rules property of detector configuration objects. * * @param fn * a function that initializes a builder to create the @@ -1431,7 +1671,9 @@ public final CompletableFuture putFilter( // ----- Endpoint: ml.put_job /** - * Instantiates an anomaly detection job. + * Instantiates an anomaly detection job. If you include a + * datafeed_config, you must have read index privileges on the + * source index. * * @see Documentation @@ -1446,7 +1688,9 @@ public CompletableFuture putJob(PutJobRequest request) { } /** - * Instantiates an anomaly detection job. + * Instantiates an anomaly detection job. If you include a + * datafeed_config, you must have read index privileges on the + * source index. * * @param fn * a function that initializes a builder to create the @@ -1464,7 +1708,8 @@ public final CompletableFuture putJob( // ----- Endpoint: ml.put_trained_model /** - * Creates an inference trained model. + * Enables you to supply a trained model that is not created by data frame + * analytics. * * @see Documentation @@ -1479,7 +1724,8 @@ public CompletableFuture putTrainedModel(PutTrainedMode } /** - * Creates an inference trained model. + * Enables you to supply a trained model that is not created by data frame + * analytics. * * @param fn * a function that initializes a builder to create the @@ -1497,8 +1743,19 @@ public final CompletableFuture putTrainedModel( // ----- Endpoint: ml.put_trained_model_alias /** - * Creates a new model alias (or reassigns an existing one) to refer to the - * trained model + * Creates or updates a trained model alias. A trained model alias is a logical + * name used to reference a single trained model. You can use aliases instead of + * trained model identifiers to make it easier to reference your models. For + * example, you can use aliases in inference aggregations and processors. An + * alias must be unique and refer to only a single trained model. However, you + * can have multiple aliases for each trained model. If you use this API to + * update an alias such that it references a different trained model ID and the + * model uses a different type of data frame analytics, an error occurs. For + * example, this situation occurs if you have a trained model for regression + * analysis and a trained model for classification analysis; you cannot reassign + * an alias from one type of trained model to another. If you use this API to + * update an alias and there are very few input fields in common between the old + * and new trained models for the model alias, the API returns a warning. * * @see Documentation @@ -1513,8 +1770,19 @@ public CompletableFuture putTrainedModelAlias(PutT } /** - * Creates a new model alias (or reassigns an existing one) to refer to the - * trained model + * Creates or updates a trained model alias. A trained model alias is a logical + * name used to reference a single trained model. You can use aliases instead of + * trained model identifiers to make it easier to reference your models. For + * example, you can use aliases in inference aggregations and processors. An + * alias must be unique and refer to only a single trained model. However, you + * can have multiple aliases for each trained model. If you use this API to + * update an alias such that it references a different trained model ID and the + * model uses a different type of data frame analytics, an error occurs. For + * example, this situation occurs if you have a trained model for regression + * analysis and a trained model for classification analysis; you cannot reassign + * an alias from one type of trained model to another. If you use this API to + * update an alias and there are very few input fields in common between the old + * and new trained models for the model alias, the API returns a warning. * * @param fn * a function that initializes a builder to create the @@ -1532,7 +1800,7 @@ public final CompletableFuture putTrainedModelAlia // ----- Endpoint: ml.put_trained_model_definition_part /** - * Creates part of a trained model definition + * Creates part of a trained model definition. * * @see Documentation @@ -1548,7 +1816,7 @@ public CompletableFuture putTrainedModelD } /** - * Creates part of a trained model definition + * Creates part of a trained model definition. * * @param fn * a function that initializes a builder to create the @@ -1566,7 +1834,10 @@ public final CompletableFuture putTrained // ----- Endpoint: ml.put_trained_model_vocabulary /** - * Creates a trained model vocabulary + * Creates a trained model vocabulary. This API is supported only for natural + * language processing (NLP) models. The vocabulary is stored in the index as + * described in inference_config.*.vocabulary of the trained model + * definition. * * @see Documentation @@ -1582,7 +1853,10 @@ public CompletableFuture putTrainedModelVocab } /** - * Creates a trained model vocabulary + * Creates a trained model vocabulary. This API is supported only for natural + * language processing (NLP) models. The vocabulary is stored in the index as + * described in inference_config.*.vocabulary of the trained model + * definition. * * @param fn * a function that initializes a builder to create the @@ -1600,7 +1874,10 @@ public final CompletableFuture putTrainedMode // ----- Endpoint: ml.reset_job /** - * Resets an existing anomaly detection job. + * Resets an anomaly detection job. All model state and results are deleted. The + * job is ready to start over as if it had just been created. It is not + * currently possible to reset multiple jobs using wildcards or a comma + * separated list. * * @see Documentation @@ -1615,7 +1892,10 @@ public CompletableFuture resetJob(ResetJobRequest request) { } /** - * Resets an existing anomaly detection job. + * Resets an anomaly detection job. All model state and results are deleted. The + * job is ready to start over as if it had just been created. It is not + * currently possible to reset multiple jobs using wildcards or a comma + * separated list. * * @param fn * a function that initializes a builder to create the @@ -1633,7 +1913,17 @@ public final CompletableFuture resetJob( // ----- Endpoint: ml.start_data_frame_analytics /** - * Starts a data frame analytics job. + * Starts a data frame analytics job. A data frame analytics job can be started + * and stopped multiple times throughout its lifecycle. If the destination index + * does not exist, it is created automatically the first time you start the data + * frame analytics job. The index.number_of_shards and + * index.number_of_replicas settings for the destination index are + * copied from the source index. If there are multiple source indices, the + * destination index copies the highest setting values. The mappings for the + * destination index are also copied from the source indices. If there are any + * mapping conflicts, the job fails to start. If the destination index exists, + * it is used as is. You can therefore set up the destination index in advance + * with custom settings and mappings. * * @see Documentation @@ -1649,7 +1939,17 @@ public CompletableFuture startDataFrameAnalytic } /** - * Starts a data frame analytics job. + * Starts a data frame analytics job. A data frame analytics job can be started + * and stopped multiple times throughout its lifecycle. If the destination index + * does not exist, it is created automatically the first time you start the data + * frame analytics job. The index.number_of_shards and + * index.number_of_replicas settings for the destination index are + * copied from the source index. If there are multiple source indices, the + * destination index copies the highest setting values. The mappings for the + * destination index are also copied from the source indices. If there are any + * mapping conflicts, the job fails to start. If the destination index exists, + * it is used as is. You can therefore set up the destination index in advance + * with custom settings and mappings. * * @param fn * a function that initializes a builder to create the @@ -1668,6 +1968,22 @@ public final CompletableFuture startDataFrameAn /** * Starts one or more datafeeds. + *

+ * A datafeed must be started in order to retrieve data from Elasticsearch. A + * datafeed can be started and stopped multiple times throughout its lifecycle. + *

+ * Before you can start a datafeed, the anomaly detection job must be open. + * Otherwise, an error occurs. + *

+ * If you restart a stopped datafeed, it continues processing input data from + * the next millisecond after it was stopped. If new data was indexed for that + * exact millisecond between stopping and starting, it will be ignored. + *

+ * When Elasticsearch security features are enabled, your datafeed remembers + * which roles the last user to create or update it had at the time of creation + * or update and runs the query using those same roles. If you provided + * secondary authorization headers when you created or updated the datafeed, + * those credentials are used instead. * * @see Documentation @@ -1683,6 +1999,22 @@ public CompletableFuture startDatafeed(StartDatafeedReque /** * Starts one or more datafeeds. + *

+ * A datafeed must be started in order to retrieve data from Elasticsearch. A + * datafeed can be started and stopped multiple times throughout its lifecycle. + *

+ * Before you can start a datafeed, the anomaly detection job must be open. + * Otherwise, an error occurs. + *

+ * If you restart a stopped datafeed, it continues processing input data from + * the next millisecond after it was stopped. If new data was indexed for that + * exact millisecond between stopping and starting, it will be ignored. + *

+ * When Elasticsearch security features are enabled, your datafeed remembers + * which roles the last user to create or update it had at the time of creation + * or update and runs the query using those same roles. If you provided + * secondary authorization headers when you created or updated the datafeed, + * those credentials are used instead. * * @param fn * a function that initializes a builder to create the @@ -1700,7 +2032,8 @@ public final CompletableFuture startDatafeed( // ----- Endpoint: ml.start_trained_model_deployment /** - * Start a trained model deployment. + * Starts a trained model deployment, which allocates the model to every machine + * learning node. * * @see Documentation @@ -1716,7 +2049,8 @@ public CompletableFuture startTrainedModelD } /** - * Start a trained model deployment. + * Starts a trained model deployment, which allocates the model to every machine + * learning node. * * @param fn * a function that initializes a builder to create the @@ -1734,7 +2068,8 @@ public final CompletableFuture startTrained // ----- Endpoint: ml.stop_data_frame_analytics /** - * Stops one or more data frame analytics jobs. + * Stops one or more data frame analytics jobs. A data frame analytics job can + * be started and stopped multiple times throughout its lifecycle. * * @see Documentation @@ -1750,7 +2085,8 @@ public CompletableFuture stopDataFrameAnalytics( } /** - * Stops one or more data frame analytics jobs. + * Stops one or more data frame analytics jobs. A data frame analytics job can + * be started and stopped multiple times throughout its lifecycle. * * @param fn * a function that initializes a builder to create the @@ -1768,7 +2104,9 @@ public final CompletableFuture stopDataFrameAnal // ----- Endpoint: ml.stop_datafeed /** - * Stops one or more datafeeds. + * Stops one or more datafeeds. A datafeed that is stopped ceases to retrieve + * data from Elasticsearch. A datafeed can be started and stopped multiple times + * throughout its lifecycle. * * @see Documentation @@ -1783,7 +2121,9 @@ public CompletableFuture stopDatafeed(StopDatafeedRequest } /** - * Stops one or more datafeeds. + * Stops one or more datafeeds. A datafeed that is stopped ceases to retrieve + * data from Elasticsearch. A datafeed can be started and stopped multiple times + * throughout its lifecycle. * * @param fn * a function that initializes a builder to create the @@ -1801,7 +2141,7 @@ public final CompletableFuture stopDatafeed( // ----- Endpoint: ml.stop_trained_model_deployment /** - * Stop a trained model deployment. + * Stops a trained model deployment. * * @see Documentation @@ -1817,7 +2157,7 @@ public CompletableFuture stopTrainedModelDep } /** - * Stop a trained model deployment. + * Stops a trained model deployment. * * @param fn * a function that initializes a builder to create the @@ -1835,7 +2175,7 @@ public final CompletableFuture stopTrainedMo // ----- Endpoint: ml.update_data_frame_analytics /** - * Updates certain properties of a data frame analytics job. + * Updates an existing data frame analytics job. * * @see Documentation @@ -1851,7 +2191,7 @@ public CompletableFuture updateDataFrameAnalyt } /** - * Updates certain properties of a data frame analytics job. + * Updates an existing data frame analytics job. * * @param fn * a function that initializes a builder to create the @@ -1869,7 +2209,11 @@ public final CompletableFuture updateDataFrame // ----- Endpoint: ml.update_datafeed /** - * Updates certain properties of a datafeed. + * Updates the properties of a datafeed. You must stop and start the datafeed + * for the changes to be applied. When Elasticsearch security features are + * enabled, your datafeed remembers which roles the user who updated it had at + * the time of the update and runs the query using those same roles. If you + * provide secondary authorization headers, those credentials are used instead. * * @see Documentation @@ -1884,7 +2228,11 @@ public CompletableFuture updateDatafeed(UpdateDatafeedRe } /** - * Updates certain properties of a datafeed. + * Updates the properties of a datafeed. You must stop and start the datafeed + * for the changes to be applied. When Elasticsearch security features are + * enabled, your datafeed remembers which roles the user who updated it had at + * the time of the update and runs the query using those same roles. If you + * provide secondary authorization headers, those credentials are used instead. * * @param fn * a function that initializes a builder to create the @@ -1902,7 +2250,8 @@ public final CompletableFuture updateDatafeed( // ----- Endpoint: ml.update_filter /** - * Updates the description of a filter, adds items, or removes items. + * Updates the description of a filter, adds items, or removes items from the + * list. * * @see Documentation @@ -1917,7 +2266,8 @@ public CompletableFuture updateFilter(UpdateFilterRequest } /** - * Updates the description of a filter, adds items, or removes items. + * Updates the description of a filter, adds items, or removes items from the + * list. * * @param fn * a function that initializes a builder to create the @@ -1965,4 +2315,40 @@ public final CompletableFuture updateJob( return updateJob(fn.apply(new UpdateJobRequest.Builder()).build()); } + // ----- Endpoint: ml.update_trained_model_deployment + + /** + * Starts a trained model deployment, which allocates the model to every machine + * learning node. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture updateTrainedModelDeployment( + UpdateTrainedModelDeploymentRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) UpdateTrainedModelDeploymentRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Starts a trained model deployment, which allocates the model to every machine + * learning node. + * + * @param fn + * a function that initializes a builder to create the + * {@link UpdateTrainedModelDeploymentRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture updateTrainedModelDeployment( + Function> fn) { + return updateTrainedModelDeployment(fn.apply(new UpdateTrainedModelDeploymentRequest.Builder()).build()); + } + } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlClient.java index d3ad1e182..256b219c9 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlClient.java @@ -70,11 +70,23 @@ public ElasticsearchMlClient withTransportOptions(@Nullable TransportOptions tra // ----- Endpoint: ml.close_job /** - * Closes one or more anomaly detection jobs. A job can be opened and closed - * multiple times throughout its lifecycle. + * Close anomaly detection jobs A job can be opened and closed multiple times + * throughout its lifecycle. A closed job cannot receive data or perform + * analysis operations, but you can still explore and navigate results. When you + * close a job, it runs housekeeping tasks such as pruning the model history, + * flushing buffers, calculating final results and persisting the model + * snapshots. Depending upon the size of the job, it could take several minutes + * to close and the equivalent time to re-open. After it is closed, the job has + * a minimal overhead on the cluster except for maintaining its meta data. + * Therefore it is a best practice to close jobs that are no longer required to + * process data. If you close an anomaly detection job whose datafeed is + * running, the request first tries to stop the datafeed. This behavior is + * equivalent to calling stop datafeed API with the same timeout and force + * parameters as the close job request. When a datafeed that has a specified end + * date stops, it automatically closes its associated job. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-close-job.html">Documentation * on elastic.co */ @@ -86,14 +98,26 @@ public CloseJobResponse closeJob(CloseJobRequest request) throws IOException, El } /** - * Closes one or more anomaly detection jobs. A job can be opened and closed - * multiple times throughout its lifecycle. + * Close anomaly detection jobs A job can be opened and closed multiple times + * throughout its lifecycle. A closed job cannot receive data or perform + * analysis operations, but you can still explore and navigate results. When you + * close a job, it runs housekeeping tasks such as pruning the model history, + * flushing buffers, calculating final results and persisting the model + * snapshots. Depending upon the size of the job, it could take several minutes + * to close and the equivalent time to re-open. After it is closed, the job has + * a minimal overhead on the cluster except for maintaining its meta data. + * Therefore it is a best practice to close jobs that are no longer required to + * process data. If you close an anomaly detection job whose datafeed is + * running, the request first tries to stop the datafeed. This behavior is + * equivalent to calling stop datafeed API with the same timeout and force + * parameters as the close job request. When a datafeed that has a specified end + * date stops, it automatically closes its associated job. * * @param fn * a function that initializes a builder to create the * {@link CloseJobRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-close-job.html">Documentation * on elastic.co */ @@ -105,10 +129,10 @@ public final CloseJobResponse closeJob(FunctionDocumentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-calendar.html">Documentation * on elastic.co */ @@ -121,13 +145,13 @@ public DeleteCalendarResponse deleteCalendar(DeleteCalendarRequest request) } /** - * Deletes a calendar. + * Removes all scheduled events from a calendar, then deletes it. * * @param fn * a function that initializes a builder to create the * {@link DeleteCalendarRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-calendar.html">Documentation * on elastic.co */ @@ -143,7 +167,7 @@ public final DeleteCalendarResponse deleteCalendar( * Deletes scheduled events from a calendar. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-calendar-event.html">Documentation * on elastic.co */ @@ -162,7 +186,7 @@ public DeleteCalendarEventResponse deleteCalendarEvent(DeleteCalendarEventReques * a function that initializes a builder to create the * {@link DeleteCalendarEventRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-calendar-event.html">Documentation * on elastic.co */ @@ -178,7 +202,7 @@ public final DeleteCalendarEventResponse deleteCalendarEvent( * Deletes anomaly detection jobs from a calendar. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-calendar-job.html">Documentation * on elastic.co */ @@ -197,7 +221,7 @@ public DeleteCalendarJobResponse deleteCalendarJob(DeleteCalendarJobRequest requ * a function that initializes a builder to create the * {@link DeleteCalendarJobRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-calendar-job.html">Documentation * on elastic.co */ @@ -210,10 +234,10 @@ public final DeleteCalendarJobResponse deleteCalendarJob( // ----- Endpoint: ml.delete_data_frame_analytics /** - * Deletes an existing data frame analytics job. + * Deletes a data frame analytics job. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/delete-dfanalytics.html">Documentation * on elastic.co */ @@ -226,13 +250,13 @@ public DeleteDataFrameAnalyticsResponse deleteDataFrameAnalytics(DeleteDataFrame } /** - * Deletes an existing data frame analytics job. + * Deletes a data frame analytics job. * * @param fn * a function that initializes a builder to create the * {@link DeleteDataFrameAnalyticsRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/delete-dfanalytics.html">Documentation * on elastic.co */ @@ -248,7 +272,7 @@ public final DeleteDataFrameAnalyticsResponse deleteDataFrameAnalytics( * Deletes an existing datafeed. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-datafeed.html">Documentation * on elastic.co */ @@ -267,7 +291,7 @@ public DeleteDatafeedResponse deleteDatafeed(DeleteDatafeedRequest request) * a function that initializes a builder to create the * {@link DeleteDatafeedRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/ml-delete-datafeed.html">Documentation * on elastic.co */ @@ -280,7 +304,9 @@ public final DeleteDatafeedResponse deleteDatafeed( // ----- Endpoint: ml.delete_filter /** - * Deletes a filter. + * Deletes a filter. If an anomaly detection job references the filter, you + * cannot delete the filter. You must update or delete the job before you can + * delete the filter. * * @see Documentation @@ -295,7 +321,9 @@ public DeleteFilterResponse deleteFilter(DeleteFilterRequest request) throws IOE } /** - * Deletes a filter. + * Deletes a filter. If an anomaly detection job references the filter, you + * cannot delete the filter. You must update or delete the job before you can + * delete the filter. * * @param fn * a function that initializes a builder to create the @@ -314,7 +342,14 @@ public final DeleteFilterResponse deleteFilter( // ----- Endpoint: ml.delete_job /** - * Deletes an existing anomaly detection job. + * Deletes an anomaly detection job. + *

+ * All job configuration, model state and results are deleted. It is not + * currently possible to delete multiple jobs using wildcards or a comma + * separated list. If you delete a job that has a datafeed, the request first + * tries to delete the datafeed. This behavior is equivalent to calling the + * delete datafeed API with the same timeout and force parameters as the delete + * job request. * * @see Documentation @@ -329,7 +364,14 @@ public DeleteJobResponse deleteJob(DeleteJobRequest request) throws IOException, } /** - * Deletes an existing anomaly detection job. + * Deletes an anomaly detection job. + *

+ * All job configuration, model state and results are deleted. It is not + * currently possible to delete multiple jobs using wildcards or a comma + * separated list. If you delete a job that has a datafeed, the request first + * tries to delete the datafeed. This behavior is equivalent to calling the + * delete datafeed API with the same timeout and force parameters as the delete + * job request. * * @param fn * a function that initializes a builder to create the @@ -384,7 +426,10 @@ public final DeleteTrainedModelResponse deleteTrainedModel( // ----- Endpoint: ml.delete_trained_model_alias /** - * Deletes a model alias that refers to the trained model + * Deletes a trained model alias. This API deletes an existing model alias that + * refers to a trained model. If the model alias is missing or refers to a model + * other than the one identified by the model_id, this API returns + * an error. * * @see Documentation @@ -400,7 +445,10 @@ public DeleteTrainedModelAliasResponse deleteTrainedModelAlias(DeleteTrainedMode } /** - * Deletes a model alias that refers to the trained model + * Deletes a trained model alias. This API deletes an existing model alias that + * refers to a trained model. If the model alias is missing or refers to a model + * other than the one identified by the model_id, this API returns + * an error. * * @param fn * a function that initializes a builder to create the @@ -419,7 +467,9 @@ public final DeleteTrainedModelAliasResponse deleteTrainedModelAlias( // ----- Endpoint: ml.estimate_model_memory /** - * Estimates the model memory + * Makes an estimation of the memory usage for an anomaly detection job model. + * It is based on analysis configuration details for the job and cardinality + * estimates for the fields it references. * * @see Documentation @@ -435,7 +485,9 @@ public EstimateModelMemoryResponse estimateModelMemory(EstimateModelMemoryReques } /** - * Estimates the model memory + * Makes an estimation of the memory usage for an anomaly detection job model. + * It is based on analysis configuration details for the job and cardinality + * estimates for the fields it references. * * @param fn * a function that initializes a builder to create the @@ -452,7 +504,9 @@ public final EstimateModelMemoryResponse estimateModelMemory( } /** - * Estimates the model memory + * Makes an estimation of the memory usage for an anomaly detection job model. + * It is based on analysis configuration details for the job and cardinality + * estimates for the fields it references. * * @see Documentation @@ -467,7 +521,11 @@ public EstimateModelMemoryResponse estimateModelMemory() throws IOException, Ela // ----- Endpoint: ml.evaluate_data_frame /** - * Evaluates the data frame analytics for an annotated index. + * Evaluates the data frame analytics for an annotated index. The API packages + * together commonly used evaluation metrics for various types of machine + * learning features. This has been designed for use on indexes created by data + * frame analytics. Evaluation requires both a ground truth field and an + * analytics result field to be present. * * @see Documentation @@ -483,7 +541,11 @@ public EvaluateDataFrameResponse evaluateDataFrame(EvaluateDataFrameRequest requ } /** - * Evaluates the data frame analytics for an annotated index. + * Evaluates the data frame analytics for an annotated index. The API packages + * together commonly used evaluation metrics for various types of machine + * learning features. This has been designed for use on indexes created by data + * frame analytics. Evaluation requires both a ground truth field and an + * analytics result field to be present. * * @param fn * a function that initializes a builder to create the @@ -502,7 +564,14 @@ public final EvaluateDataFrameResponse evaluateDataFrame( // ----- Endpoint: ml.flush_job /** - * Forces any buffered data to be processed by the job. + * Forces any buffered data to be processed by the job. The flush jobs API is + * only applicable when sending data for analysis using the post data API. + * Depending on the content of the buffer, then it might additionally calculate + * new results. Both flush and close operations are similar, however the flush + * is more efficient if you are expecting to send more data for analysis. When + * flushing, the job remains open and is available to continue analyzing data. A + * close operation additionally prunes and persists the model state to disk and + * the job must be opened again before analyzing further data. * * @see Documentation @@ -517,7 +586,14 @@ public FlushJobResponse flushJob(FlushJobRequest request) throws IOException, El } /** - * Forces any buffered data to be processed by the job. + * Forces any buffered data to be processed by the job. The flush jobs API is + * only applicable when sending data for analysis using the post data API. + * Depending on the content of the buffer, then it might additionally calculate + * new results. Both flush and close operations are similar, however the flush + * is more efficient if you are expecting to send more data for analysis. When + * flushing, the job remains open and is available to continue analyzing data. A + * close operation additionally prunes and persists the model state to disk and + * the job must be opened again before analyzing further data. * * @param fn * a function that initializes a builder to create the @@ -617,7 +693,10 @@ public GetCalendarsResponse getCalendars() throws IOException, ElasticsearchExce // ----- Endpoint: ml.get_data_frame_analytics /** - * Retrieves configuration information for data frame analytics jobs. + * Retrieves configuration information for data frame analytics jobs. You can + * get information for multiple data frame analytics jobs in a single API + * request by using a comma-separated list of data frame analytics jobs or a + * wildcard expression. * * @see Documentation @@ -633,7 +712,10 @@ public GetDataFrameAnalyticsResponse getDataFrameAnalytics(GetDataFrameAnalytics } /** - * Retrieves configuration information for data frame analytics jobs. + * Retrieves configuration information for data frame analytics jobs. You can + * get information for multiple data frame analytics jobs in a single API + * request by using a comma-separated list of data frame analytics jobs or a + * wildcard expression. * * @param fn * a function that initializes a builder to create the @@ -650,7 +732,10 @@ public final GetDataFrameAnalyticsResponse getDataFrameAnalytics( } /** - * Retrieves configuration information for data frame analytics jobs. + * Retrieves configuration information for data frame analytics jobs. You can + * get information for multiple data frame analytics jobs in a single API + * request by using a comma-separated list of data frame analytics jobs or a + * wildcard expression. * * @see Documentation @@ -713,7 +798,14 @@ public GetDataFrameAnalyticsStatsResponse getDataFrameAnalyticsStats() throws IO // ----- Endpoint: ml.get_datafeed_stats /** - * Retrieves usage information for datafeeds. + * Retrieves usage information for datafeeds. You can get statistics for + * multiple datafeeds in a single API request by using a comma-separated list of + * datafeeds or a wildcard expression. You can get statistics for all datafeeds + * by using _all, by specifying * as the + * <feed_id>, or by omitting the + * <feed_id>. If the datafeed is stopped, the only + * information you receive is the datafeed_id and the + * state. This API returns a maximum of 10,000 datafeeds. * * @see Documentation @@ -729,7 +821,14 @@ public GetDatafeedStatsResponse getDatafeedStats(GetDatafeedStatsRequest request } /** - * Retrieves usage information for datafeeds. + * Retrieves usage information for datafeeds. You can get statistics for + * multiple datafeeds in a single API request by using a comma-separated list of + * datafeeds or a wildcard expression. You can get statistics for all datafeeds + * by using _all, by specifying * as the + * <feed_id>, or by omitting the + * <feed_id>. If the datafeed is stopped, the only + * information you receive is the datafeed_id and the + * state. This API returns a maximum of 10,000 datafeeds. * * @param fn * a function that initializes a builder to create the @@ -746,7 +845,14 @@ public final GetDatafeedStatsResponse getDatafeedStats( } /** - * Retrieves usage information for datafeeds. + * Retrieves usage information for datafeeds. You can get statistics for + * multiple datafeeds in a single API request by using a comma-separated list of + * datafeeds or a wildcard expression. You can get statistics for all datafeeds + * by using _all, by specifying * as the + * <feed_id>, or by omitting the + * <feed_id>. If the datafeed is stopped, the only + * information you receive is the datafeed_id and the + * state. This API returns a maximum of 10,000 datafeeds. * * @see Documentation @@ -761,7 +867,12 @@ public GetDatafeedStatsResponse getDatafeedStats() throws IOException, Elasticse // ----- Endpoint: ml.get_datafeeds /** - * Retrieves configuration information for datafeeds. + * Retrieves configuration information for datafeeds. You can get information + * for multiple datafeeds in a single API request by using a comma-separated + * list of datafeeds or a wildcard expression. You can get information for all + * datafeeds by using _all, by specifying * as the + * <feed_id>, or by omitting the + * <feed_id>. This API returns a maximum of 10,000 datafeeds. * * @see Documentation @@ -776,7 +887,12 @@ public GetDatafeedsResponse getDatafeeds(GetDatafeedsRequest request) throws IOE } /** - * Retrieves configuration information for datafeeds. + * Retrieves configuration information for datafeeds. You can get information + * for multiple datafeeds in a single API request by using a comma-separated + * list of datafeeds or a wildcard expression. You can get information for all + * datafeeds by using _all, by specifying * as the + * <feed_id>, or by omitting the + * <feed_id>. This API returns a maximum of 10,000 datafeeds. * * @param fn * a function that initializes a builder to create the @@ -793,7 +909,12 @@ public final GetDatafeedsResponse getDatafeeds( } /** - * Retrieves configuration information for datafeeds. + * Retrieves configuration information for datafeeds. You can get information + * for multiple datafeeds in a single API request by using a comma-separated + * list of datafeeds or a wildcard expression. You can get information for all + * datafeeds by using _all, by specifying * as the + * <feed_id>, or by omitting the + * <feed_id>. This API returns a maximum of 10,000 datafeeds. * * @see Documentation @@ -808,7 +929,7 @@ public GetDatafeedsResponse getDatafeeds() throws IOException, ElasticsearchExce // ----- Endpoint: ml.get_filters /** - * Retrieves filters. + * Retrieves filters. You can get a single filter or all filters. * * @see Documentation @@ -823,7 +944,7 @@ public GetFiltersResponse getFilters(GetFiltersRequest request) throws IOExcepti } /** - * Retrieves filters. + * Retrieves filters. You can get a single filter or all filters. * * @param fn * a function that initializes a builder to create the @@ -839,7 +960,7 @@ public final GetFiltersResponse getFilters(FunctionDocumentation @@ -901,7 +1022,12 @@ public GetJobStatsResponse getJobStats() throws IOException, ElasticsearchExcept // ----- Endpoint: ml.get_jobs /** - * Retrieves configuration information for anomaly detection jobs. + * Retrieves configuration information for anomaly detection jobs. You can get + * information for multiple anomaly detection jobs in a single API request by + * using a group name, a comma-separated list of jobs, or a wildcard expression. + * You can get information for all anomaly detection jobs by using + * _all, by specifying * as the + * <job_id>, or by omitting the <job_id>. * * @see Documentation @@ -916,7 +1042,12 @@ public GetJobsResponse getJobs(GetJobsRequest request) throws IOException, Elast } /** - * Retrieves configuration information for anomaly detection jobs. + * Retrieves configuration information for anomaly detection jobs. You can get + * information for multiple anomaly detection jobs in a single API request by + * using a group name, a comma-separated list of jobs, or a wildcard expression. + * You can get information for all anomaly detection jobs by using + * _all, by specifying * as the + * <job_id>, or by omitting the <job_id>. * * @param fn * a function that initializes a builder to create the @@ -932,7 +1063,12 @@ public final GetJobsResponse getJobs(Function_all, by specifying * as the + * <job_id>, or by omitting the <job_id>. * * @see Documentation @@ -949,6 +1085,21 @@ public GetJobsResponse getJobs() throws IOException, ElasticsearchException { /** * Retrieves overall bucket results that summarize the bucket results of * multiple anomaly detection jobs. + *

+ * The overall_score is calculated by combining the scores of all + * the buckets within the overall bucket span. First, the maximum + * anomaly_score per anomaly detection job in the overall bucket is + * calculated. Then the top_n of those scores are averaged to + * result in the overall_score. This means that you can fine-tune + * the overall_score so that it is more or less sensitive to the + * number of jobs that detect an anomaly at the same time. For example, if you + * set top_n to 1, the overall_score is + * the maximum bucket score in the overall bucket. Alternatively, if you set + * top_n to the number of jobs, the overall_score is + * high only when all jobs detect anomalies in that overall bucket. If you set + * the bucket_span parameter (to a value greater than its default), + * the overall_score is the maximum overall_score of + * the overall buckets that have a span equal to the jobs' largest bucket span. * * @see Documentation @@ -966,6 +1117,21 @@ public GetOverallBucketsResponse getOverallBuckets(GetOverallBucketsRequest requ /** * Retrieves overall bucket results that summarize the bucket results of * multiple anomaly detection jobs. + *

+ * The overall_score is calculated by combining the scores of all + * the buckets within the overall bucket span. First, the maximum + * anomaly_score per anomaly detection job in the overall bucket is + * calculated. Then the top_n of those scores are averaged to + * result in the overall_score. This means that you can fine-tune + * the overall_score so that it is more or less sensitive to the + * number of jobs that detect an anomaly at the same time. For example, if you + * set top_n to 1, the overall_score is + * the maximum bucket score in the overall bucket. Alternatively, if you set + * top_n to the number of jobs, the overall_score is + * high only when all jobs detect anomalies in that overall bucket. If you set + * the bucket_span parameter (to a value greater than its default), + * the overall_score is the maximum overall_score of + * the overall buckets that have a span equal to the jobs' largest bucket span. * * @param fn * a function that initializes a builder to create the @@ -984,7 +1150,7 @@ public final GetOverallBucketsResponse getOverallBuckets( // ----- Endpoint: ml.get_trained_models /** - * Retrieves configuration information for a trained inference model. + * Retrieves configuration information for a trained model. * * @see Documentation @@ -1000,7 +1166,7 @@ public GetTrainedModelsResponse getTrainedModels(GetTrainedModelsRequest request } /** - * Retrieves configuration information for a trained inference model. + * Retrieves configuration information for a trained model. * * @param fn * a function that initializes a builder to create the @@ -1017,7 +1183,7 @@ public final GetTrainedModelsResponse getTrainedModels( } /** - * Retrieves configuration information for a trained inference model. + * Retrieves configuration information for a trained model. * * @see Documentation @@ -1032,7 +1198,9 @@ public GetTrainedModelsResponse getTrainedModels() throws IOException, Elasticse // ----- Endpoint: ml.get_trained_models_stats /** - * Retrieves usage information for trained inference models. + * Retrieves usage information for trained models. You can get usage information + * for multiple trained models in a single API request by using a + * comma-separated list of model IDs or a wildcard expression. * * @see Documentation @@ -1048,7 +1216,9 @@ public GetTrainedModelsStatsResponse getTrainedModelsStats(GetTrainedModelsStats } /** - * Retrieves usage information for trained inference models. + * Retrieves usage information for trained models. You can get usage information + * for multiple trained models in a single API request by using a + * comma-separated list of model IDs or a wildcard expression. * * @param fn * a function that initializes a builder to create the @@ -1065,7 +1235,9 @@ public final GetTrainedModelsStatsResponse getTrainedModelsStats( } /** - * Retrieves usage information for trained inference models. + * Retrieves usage information for trained models. You can get usage information + * for multiple trained models in a single API request by using a + * comma-separated list of model IDs or a wildcard expression. * * @see Documentation @@ -1080,7 +1252,7 @@ public GetTrainedModelsStatsResponse getTrainedModelsStats() throws IOException, // ----- Endpoint: ml.infer_trained_model /** - * Evaluate a trained model. + * Evaluates a trained model. * * @see Documentation @@ -1096,7 +1268,7 @@ public InferTrainedModelResponse inferTrainedModel(InferTrainedModelRequest requ } /** - * Evaluate a trained model. + * Evaluates a trained model. * * @param fn * a function that initializes a builder to create the @@ -1115,7 +1287,12 @@ public final InferTrainedModelResponse inferTrainedModel( // ----- Endpoint: ml.open_job /** - * Opens one or more anomaly detection jobs. + * Opens one or more anomaly detection jobs. An anomaly detection job must be + * opened in order for it to be ready to receive and analyze data. It can be + * opened and closed multiple times throughout its lifecycle. When you open a + * new job, it starts with an empty model. When you open an existing job, the + * most recent model state is automatically loaded. The job is ready to resume + * its analysis from where it left off, once new data is received. * * @see Documentation @@ -1130,7 +1307,12 @@ public OpenJobResponse openJob(OpenJobRequest request) throws IOException, Elast } /** - * Opens one or more anomaly detection jobs. + * Opens one or more anomaly detection jobs. An anomaly detection job must be + * opened in order for it to be ready to receive and analyze data. It can be + * opened and closed multiple times throughout its lifecycle. When you open a + * new job, it starts with an empty model. When you open an existing job, the + * most recent model state is automatically loaded. The job is ready to resume + * its analysis from where it left off, once new data is received. * * @param fn * a function that initializes a builder to create the @@ -1148,7 +1330,7 @@ public final OpenJobResponse openJob(FunctionDocumentation @@ -1164,7 +1346,7 @@ public PostCalendarEventsResponse postCalendarEvents(PostCalendarEventsRequest r } /** - * Posts scheduled events in a calendar. + * Adds scheduled events to a calendar. * * @param fn * a function that initializes a builder to create the @@ -1183,7 +1365,7 @@ public final PostCalendarEventsResponse postCalendarEvents( // ----- Endpoint: ml.preview_data_frame_analytics /** - * Previews that will be analyzed given a data frame analytics config. + * Previews the extracted features used by a data frame analytics config. * * @see Documentation @@ -1199,7 +1381,7 @@ public PreviewDataFrameAnalyticsResponse previewDataFrameAnalytics(PreviewDataFr } /** - * Previews that will be analyzed given a data frame analytics config. + * Previews the extracted features used by a data frame analytics config. * * @param fn * a function that initializes a builder to create the @@ -1216,7 +1398,7 @@ public final PreviewDataFrameAnalyticsResponse previewDataFrameAnalytics( } /** - * Previews that will be analyzed given a data frame analytics config. + * Previews the extracted features used by a data frame analytics config. * * @see Documentation @@ -1231,7 +1413,16 @@ public PreviewDataFrameAnalyticsResponse previewDataFrameAnalytics() throws IOEx // ----- Endpoint: ml.preview_datafeed /** - * Previews a datafeed. + * Previews a datafeed. This API returns the first "page" of search + * results from a datafeed. You can preview an existing datafeed or provide + * configuration details for a datafeed and anomaly detection job in the API. + * The preview shows the structure of the data that will be passed to the + * anomaly detection engine. IMPORTANT: When Elasticsearch security features are + * enabled, the preview uses the credentials of the user that called the API. + * However, when the datafeed starts it uses the roles of the last user that + * created or updated the datafeed. To get a preview that accurately reflects + * the behavior of the datafeed, use the appropriate credentials. You can also + * use secondary authorization headers to supply the credentials. * * @see Documentation @@ -1243,13 +1434,23 @@ public PreviewDatafeedResponse previewDatafeed(PreviewDat @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) PreviewDatafeedRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:ml.preview_datafeed.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:ml.preview_datafeed.Response.TDocument", + getDeserializer(tDocumentClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Previews a datafeed. + * Previews a datafeed. This API returns the first "page" of search + * results from a datafeed. You can preview an existing datafeed or provide + * configuration details for a datafeed and anomaly detection job in the API. + * The preview shows the structure of the data that will be passed to the + * anomaly detection engine. IMPORTANT: When Elasticsearch security features are + * enabled, the preview uses the credentials of the user that called the API. + * However, when the datafeed starts it uses the roles of the last user that + * created or updated the datafeed. To get a preview that accurately reflects + * the behavior of the datafeed, use the appropriate credentials. You can also + * use secondary authorization headers to supply the credentials. * * @param fn * a function that initializes a builder to create the @@ -1266,7 +1467,16 @@ public final PreviewDatafeedResponse previewDatafeed( } /** - * Previews a datafeed. + * Previews a datafeed. This API returns the first "page" of search + * results from a datafeed. You can preview an existing datafeed or provide + * configuration details for a datafeed and anomaly detection job in the API. + * The preview shows the structure of the data that will be passed to the + * anomaly detection engine. IMPORTANT: When Elasticsearch security features are + * enabled, the preview uses the credentials of the user that called the API. + * However, when the datafeed starts it uses the roles of the last user that + * created or updated the datafeed. To get a preview that accurately reflects + * the behavior of the datafeed, use the appropriate credentials. You can also + * use secondary authorization headers to supply the credentials. * * @see Documentation @@ -1278,13 +1488,23 @@ public PreviewDatafeedResponse previewDatafeed(PreviewDat @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) PreviewDatafeedRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:ml.preview_datafeed.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:ml.preview_datafeed.Response.TDocument", + getDeserializer(tDocumentType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Previews a datafeed. + * Previews a datafeed. This API returns the first "page" of search + * results from a datafeed. You can preview an existing datafeed or provide + * configuration details for a datafeed and anomaly detection job in the API. + * The preview shows the structure of the data that will be passed to the + * anomaly detection engine. IMPORTANT: When Elasticsearch security features are + * enabled, the preview uses the credentials of the user that called the API. + * However, when the datafeed starts it uses the roles of the last user that + * created or updated the datafeed. To get a preview that accurately reflects + * the behavior of the datafeed, use the appropriate credentials. You can also + * use secondary authorization headers to supply the credentials. * * @param fn * a function that initializes a builder to create the @@ -1303,7 +1523,7 @@ public final PreviewDatafeedResponse previewDatafeed( // ----- Endpoint: ml.put_calendar /** - * Instantiates a calendar. + * Creates a calendar. * * @see Documentation @@ -1318,7 +1538,7 @@ public PutCalendarResponse putCalendar(PutCalendarRequest request) throws IOExce } /** - * Instantiates a calendar. + * Creates a calendar. * * @param fn * a function that initializes a builder to create the @@ -1372,10 +1592,12 @@ public final PutCalendarJobResponse putCalendarJob( // ----- Endpoint: ml.put_data_frame_analytics /** - * Instantiates a data frame analytics job. + * Instantiates a data frame analytics job. This API creates a data frame + * analytics job that performs an analysis on the source indices and stores the + * outcome in a destination index. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/put-dfanalytics.html">Documentation * on elastic.co */ @@ -1388,13 +1610,15 @@ public PutDataFrameAnalyticsResponse putDataFrameAnalytics(PutDataFrameAnalytics } /** - * Instantiates a data frame analytics job. + * Instantiates a data frame analytics job. This API creates a data frame + * analytics job that performs an analysis on the source indices and stores the + * outcome in a destination index. * * @param fn * a function that initializes a builder to create the * {@link PutDataFrameAnalyticsRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/put-dfanalytics.html">Documentation * on elastic.co */ @@ -1407,7 +1631,13 @@ public final PutDataFrameAnalyticsResponse putDataFrameAnalytics( // ----- Endpoint: ml.put_datafeed /** - * Instantiates a datafeed. + * Instantiates a datafeed. Datafeeds retrieve data from Elasticsearch for + * analysis by an anomaly detection job. You can associate only one datafeed + * with each anomaly detection job. The datafeed contains a query that runs at a + * defined interval (frequency). If you are concerned about delayed + * data, you can add a delay + * (query_delay') at each interval. When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead. You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed directly to the .ml-configindex. Do not give userswriteprivileges on the.ml-config` + * index. * * @see Documentation @@ -1422,7 +1652,13 @@ public PutDatafeedResponse putDatafeed(PutDatafeedRequest request) throws IOExce } /** - * Instantiates a datafeed. + * Instantiates a datafeed. Datafeeds retrieve data from Elasticsearch for + * analysis by an anomaly detection job. You can associate only one datafeed + * with each anomaly detection job. The datafeed contains a query that runs at a + * defined interval (frequency). If you are concerned about delayed + * data, you can add a delay + * (query_delay') at each interval. When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead. You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed directly to the .ml-configindex. Do not give userswriteprivileges on the.ml-config` + * index. * * @param fn * a function that initializes a builder to create the @@ -1441,7 +1677,9 @@ public final PutDatafeedResponse putDatafeed( // ----- Endpoint: ml.put_filter /** - * Instantiates a filter. + * Instantiates a filter. A filter contains a list of strings. It can be used by + * one or more anomaly detection jobs. Specifically, filters are referenced in + * the custom_rules property of detector configuration objects. * * @see Documentation @@ -1456,7 +1694,9 @@ public PutFilterResponse putFilter(PutFilterRequest request) throws IOException, } /** - * Instantiates a filter. + * Instantiates a filter. A filter contains a list of strings. It can be used by + * one or more anomaly detection jobs. Specifically, filters are referenced in + * the custom_rules property of detector configuration objects. * * @param fn * a function that initializes a builder to create the @@ -1474,7 +1714,9 @@ public final PutFilterResponse putFilter(Functiondatafeed_config, you must have read index privileges on the + * source index. * * @see Documentation @@ -1489,7 +1731,9 @@ public PutJobResponse putJob(PutJobRequest request) throws IOException, Elastics } /** - * Instantiates an anomaly detection job. + * Instantiates an anomaly detection job. If you include a + * datafeed_config, you must have read index privileges on the + * source index. * * @param fn * a function that initializes a builder to create the @@ -1507,7 +1751,8 @@ public final PutJobResponse putJob(FunctionDocumentation @@ -1523,7 +1768,8 @@ public PutTrainedModelResponse putTrainedModel(PutTrainedModelRequest request) } /** - * Creates an inference trained model. + * Enables you to supply a trained model that is not created by data frame + * analytics. * * @param fn * a function that initializes a builder to create the @@ -1542,8 +1788,19 @@ public final PutTrainedModelResponse putTrainedModel( // ----- Endpoint: ml.put_trained_model_alias /** - * Creates a new model alias (or reassigns an existing one) to refer to the - * trained model + * Creates or updates a trained model alias. A trained model alias is a logical + * name used to reference a single trained model. You can use aliases instead of + * trained model identifiers to make it easier to reference your models. For + * example, you can use aliases in inference aggregations and processors. An + * alias must be unique and refer to only a single trained model. However, you + * can have multiple aliases for each trained model. If you use this API to + * update an alias such that it references a different trained model ID and the + * model uses a different type of data frame analytics, an error occurs. For + * example, this situation occurs if you have a trained model for regression + * analysis and a trained model for classification analysis; you cannot reassign + * an alias from one type of trained model to another. If you use this API to + * update an alias and there are very few input fields in common between the old + * and new trained models for the model alias, the API returns a warning. * * @see Documentation @@ -1559,8 +1816,19 @@ public PutTrainedModelAliasResponse putTrainedModelAlias(PutTrainedModelAliasReq } /** - * Creates a new model alias (or reassigns an existing one) to refer to the - * trained model + * Creates or updates a trained model alias. A trained model alias is a logical + * name used to reference a single trained model. You can use aliases instead of + * trained model identifiers to make it easier to reference your models. For + * example, you can use aliases in inference aggregations and processors. An + * alias must be unique and refer to only a single trained model. However, you + * can have multiple aliases for each trained model. If you use this API to + * update an alias such that it references a different trained model ID and the + * model uses a different type of data frame analytics, an error occurs. For + * example, this situation occurs if you have a trained model for regression + * analysis and a trained model for classification analysis; you cannot reassign + * an alias from one type of trained model to another. If you use this API to + * update an alias and there are very few input fields in common between the old + * and new trained models for the model alias, the API returns a warning. * * @param fn * a function that initializes a builder to create the @@ -1579,7 +1847,7 @@ public final PutTrainedModelAliasResponse putTrainedModelAlias( // ----- Endpoint: ml.put_trained_model_definition_part /** - * Creates part of a trained model definition + * Creates part of a trained model definition. * * @see Documentation @@ -1595,7 +1863,7 @@ public PutTrainedModelDefinitionPartResponse putTrainedModelDefinitionPart( } /** - * Creates part of a trained model definition + * Creates part of a trained model definition. * * @param fn * a function that initializes a builder to create the @@ -1614,7 +1882,10 @@ public final PutTrainedModelDefinitionPartResponse putTrainedModelDefinitionPart // ----- Endpoint: ml.put_trained_model_vocabulary /** - * Creates a trained model vocabulary + * Creates a trained model vocabulary. This API is supported only for natural + * language processing (NLP) models. The vocabulary is stored in the index as + * described in inference_config.*.vocabulary of the trained model + * definition. * * @see Documentation @@ -1630,7 +1901,10 @@ public PutTrainedModelVocabularyResponse putTrainedModelVocabulary(PutTrainedMod } /** - * Creates a trained model vocabulary + * Creates a trained model vocabulary. This API is supported only for natural + * language processing (NLP) models. The vocabulary is stored in the index as + * described in inference_config.*.vocabulary of the trained model + * definition. * * @param fn * a function that initializes a builder to create the @@ -1649,7 +1923,10 @@ public final PutTrainedModelVocabularyResponse putTrainedModelVocabulary( // ----- Endpoint: ml.reset_job /** - * Resets an existing anomaly detection job. + * Resets an anomaly detection job. All model state and results are deleted. The + * job is ready to start over as if it had just been created. It is not + * currently possible to reset multiple jobs using wildcards or a comma + * separated list. * * @see Documentation @@ -1664,7 +1941,10 @@ public ResetJobResponse resetJob(ResetJobRequest request) throws IOException, El } /** - * Resets an existing anomaly detection job. + * Resets an anomaly detection job. All model state and results are deleted. The + * job is ready to start over as if it had just been created. It is not + * currently possible to reset multiple jobs using wildcards or a comma + * separated list. * * @param fn * a function that initializes a builder to create the @@ -1682,7 +1962,17 @@ public final ResetJobResponse resetJob(Functionindex.number_of_shards and + * index.number_of_replicas settings for the destination index are + * copied from the source index. If there are multiple source indices, the + * destination index copies the highest setting values. The mappings for the + * destination index are also copied from the source indices. If there are any + * mapping conflicts, the job fails to start. If the destination index exists, + * it is used as is. You can therefore set up the destination index in advance + * with custom settings and mappings. * * @see Documentation @@ -1698,7 +1988,17 @@ public StartDataFrameAnalyticsResponse startDataFrameAnalytics(StartDataFrameAna } /** - * Starts a data frame analytics job. + * Starts a data frame analytics job. A data frame analytics job can be started + * and stopped multiple times throughout its lifecycle. If the destination index + * does not exist, it is created automatically the first time you start the data + * frame analytics job. The index.number_of_shards and + * index.number_of_replicas settings for the destination index are + * copied from the source index. If there are multiple source indices, the + * destination index copies the highest setting values. The mappings for the + * destination index are also copied from the source indices. If there are any + * mapping conflicts, the job fails to start. If the destination index exists, + * it is used as is. You can therefore set up the destination index in advance + * with custom settings and mappings. * * @param fn * a function that initializes a builder to create the @@ -1718,6 +2018,22 @@ public final StartDataFrameAnalyticsResponse startDataFrameAnalytics( /** * Starts one or more datafeeds. + *

+ * A datafeed must be started in order to retrieve data from Elasticsearch. A + * datafeed can be started and stopped multiple times throughout its lifecycle. + *

+ * Before you can start a datafeed, the anomaly detection job must be open. + * Otherwise, an error occurs. + *

+ * If you restart a stopped datafeed, it continues processing input data from + * the next millisecond after it was stopped. If new data was indexed for that + * exact millisecond between stopping and starting, it will be ignored. + *

+ * When Elasticsearch security features are enabled, your datafeed remembers + * which roles the last user to create or update it had at the time of creation + * or update and runs the query using those same roles. If you provided + * secondary authorization headers when you created or updated the datafeed, + * those credentials are used instead. * * @see Documentation @@ -1734,6 +2050,22 @@ public StartDatafeedResponse startDatafeed(StartDatafeedRequest request) /** * Starts one or more datafeeds. + *

+ * A datafeed must be started in order to retrieve data from Elasticsearch. A + * datafeed can be started and stopped multiple times throughout its lifecycle. + *

+ * Before you can start a datafeed, the anomaly detection job must be open. + * Otherwise, an error occurs. + *

+ * If you restart a stopped datafeed, it continues processing input data from + * the next millisecond after it was stopped. If new data was indexed for that + * exact millisecond between stopping and starting, it will be ignored. + *

+ * When Elasticsearch security features are enabled, your datafeed remembers + * which roles the last user to create or update it had at the time of creation + * or update and runs the query using those same roles. If you provided + * secondary authorization headers when you created or updated the datafeed, + * those credentials are used instead. * * @param fn * a function that initializes a builder to create the @@ -1752,7 +2084,8 @@ public final StartDatafeedResponse startDatafeed( // ----- Endpoint: ml.start_trained_model_deployment /** - * Start a trained model deployment. + * Starts a trained model deployment, which allocates the model to every machine + * learning node. * * @see Documentation @@ -1768,7 +2101,8 @@ public StartTrainedModelDeploymentResponse startTrainedModelDeployment(StartTrai } /** - * Start a trained model deployment. + * Starts a trained model deployment, which allocates the model to every machine + * learning node. * * @param fn * a function that initializes a builder to create the @@ -1787,7 +2121,8 @@ public final StartTrainedModelDeploymentResponse startTrainedModelDeployment( // ----- Endpoint: ml.stop_data_frame_analytics /** - * Stops one or more data frame analytics jobs. + * Stops one or more data frame analytics jobs. A data frame analytics job can + * be started and stopped multiple times throughout its lifecycle. * * @see Documentation @@ -1803,7 +2138,8 @@ public StopDataFrameAnalyticsResponse stopDataFrameAnalytics(StopDataFrameAnalyt } /** - * Stops one or more data frame analytics jobs. + * Stops one or more data frame analytics jobs. A data frame analytics job can + * be started and stopped multiple times throughout its lifecycle. * * @param fn * a function that initializes a builder to create the @@ -1822,7 +2158,9 @@ public final StopDataFrameAnalyticsResponse stopDataFrameAnalytics( // ----- Endpoint: ml.stop_datafeed /** - * Stops one or more datafeeds. + * Stops one or more datafeeds. A datafeed that is stopped ceases to retrieve + * data from Elasticsearch. A datafeed can be started and stopped multiple times + * throughout its lifecycle. * * @see Documentation @@ -1837,7 +2175,9 @@ public StopDatafeedResponse stopDatafeed(StopDatafeedRequest request) throws IOE } /** - * Stops one or more datafeeds. + * Stops one or more datafeeds. A datafeed that is stopped ceases to retrieve + * data from Elasticsearch. A datafeed can be started and stopped multiple times + * throughout its lifecycle. * * @param fn * a function that initializes a builder to create the @@ -1856,7 +2196,7 @@ public final StopDatafeedResponse stopDatafeed( // ----- Endpoint: ml.stop_trained_model_deployment /** - * Stop a trained model deployment. + * Stops a trained model deployment. * * @see Documentation @@ -1872,7 +2212,7 @@ public StopTrainedModelDeploymentResponse stopTrainedModelDeployment(StopTrained } /** - * Stop a trained model deployment. + * Stops a trained model deployment. * * @param fn * a function that initializes a builder to create the @@ -1891,7 +2231,7 @@ public final StopTrainedModelDeploymentResponse stopTrainedModelDeployment( // ----- Endpoint: ml.update_data_frame_analytics /** - * Updates certain properties of a data frame analytics job. + * Updates an existing data frame analytics job. * * @see Documentation @@ -1907,7 +2247,7 @@ public UpdateDataFrameAnalyticsResponse updateDataFrameAnalytics(UpdateDataFrame } /** - * Updates certain properties of a data frame analytics job. + * Updates an existing data frame analytics job. * * @param fn * a function that initializes a builder to create the @@ -1926,7 +2266,11 @@ public final UpdateDataFrameAnalyticsResponse updateDataFrameAnalytics( // ----- Endpoint: ml.update_datafeed /** - * Updates certain properties of a datafeed. + * Updates the properties of a datafeed. You must stop and start the datafeed + * for the changes to be applied. When Elasticsearch security features are + * enabled, your datafeed remembers which roles the user who updated it had at + * the time of the update and runs the query using those same roles. If you + * provide secondary authorization headers, those credentials are used instead. * * @see Documentation @@ -1942,7 +2286,11 @@ public UpdateDatafeedResponse updateDatafeed(UpdateDatafeedRequest request) } /** - * Updates certain properties of a datafeed. + * Updates the properties of a datafeed. You must stop and start the datafeed + * for the changes to be applied. When Elasticsearch security features are + * enabled, your datafeed remembers which roles the user who updated it had at + * the time of the update and runs the query using those same roles. If you + * provide secondary authorization headers, those credentials are used instead. * * @param fn * a function that initializes a builder to create the @@ -1961,7 +2309,8 @@ public final UpdateDatafeedResponse updateDatafeed( // ----- Endpoint: ml.update_filter /** - * Updates the description of a filter, adds items, or removes items. + * Updates the description of a filter, adds items, or removes items from the + * list. * * @see Documentation @@ -1976,7 +2325,8 @@ public UpdateFilterResponse updateFilter(UpdateFilterRequest request) throws IOE } /** - * Updates the description of a filter, adds items, or removes items. + * Updates the description of a filter, adds items, or removes items from the + * list. * * @param fn * a function that initializes a builder to create the @@ -2025,4 +2375,41 @@ public final UpdateJobResponse updateJob(FunctionDocumentation + * on elastic.co + */ + + public UpdateTrainedModelDeploymentResponse updateTrainedModelDeployment( + UpdateTrainedModelDeploymentRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) UpdateTrainedModelDeploymentRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Starts a trained model deployment, which allocates the model to every machine + * learning node. + * + * @param fn + * a function that initializes a builder to create the + * {@link UpdateTrainedModelDeploymentRequest} + * @see Documentation + * on elastic.co + */ + + public final UpdateTrainedModelDeploymentResponse updateTrainedModelDeployment( + Function> fn) + throws IOException, ElasticsearchException { + return updateTrainedModelDeployment(fn.apply(new UpdateTrainedModelDeploymentRequest.Builder()).build()); + } + } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetTrainedModelsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetTrainedModelsRequest.java index 2f9d243c7..0b1ab0cc1 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetTrainedModelsRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetTrainedModelsRequest.java @@ -27,15 +27,18 @@ import co.elastic.clients.json.ObjectDeserializer; import co.elastic.clients.transport.Endpoint; import co.elastic.clients.transport.endpoints.SimpleEndpoint; +import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import jakarta.json.stream.JsonGenerator; import java.lang.Boolean; import java.lang.Integer; import java.lang.String; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Function; +import java.util.stream.Collectors; import javax.annotation.Nullable; //---------------------------------------------------------------- @@ -78,14 +81,12 @@ public class GetTrainedModelsRequest extends RequestBase { @Nullable private final Include include; - @Nullable - private final String modelId; + private final List modelId; @Nullable private final Integer size; - @Nullable - private final String tags; + private final List tags; // --------------------------------------------------------------------------------------------- @@ -96,9 +97,9 @@ private GetTrainedModelsRequest(Builder builder) { this.excludeGenerated = builder.excludeGenerated; this.from = builder.from; this.include = builder.include; - this.modelId = builder.modelId; + this.modelId = ApiTypeHelper.unmodifiable(builder.modelId); this.size = builder.size; - this.tags = builder.tags; + this.tags = ApiTypeHelper.unmodifiable(builder.tags); } @@ -168,12 +169,14 @@ public final Include include() { } /** - * The unique identifier of the trained model. + * The unique identifier of the trained model or a model alias. + *

+ * You can get information for multiple trained models in a single API request + * by using a comma-separated list of model IDs or a wildcard expression. *

* API name: {@code model_id} */ - @Nullable - public final String modelId() { + public final List modelId() { return this.modelId; } @@ -194,8 +197,7 @@ public final Integer size() { *

* API name: {@code tags} */ - @Nullable - public final String tags() { + public final List tags() { return this.tags; } @@ -224,13 +226,13 @@ public static class Builder extends RequestBase.AbstractBuilder private Include include; @Nullable - private String modelId; + private List modelId; @Nullable private Integer size; @Nullable - private String tags; + private List tags; /** * Specifies what to do when the request: @@ -294,12 +296,32 @@ public final Builder include(@Nullable Include value) { } /** - * The unique identifier of the trained model. + * The unique identifier of the trained model or a model alias. + *

+ * You can get information for multiple trained models in a single API request + * by using a comma-separated list of model IDs or a wildcard expression. + *

+ * API name: {@code model_id} + *

+ * Adds all elements of list to modelId. + */ + public final Builder modelId(List list) { + this.modelId = _listAddAll(this.modelId, list); + return this; + } + + /** + * The unique identifier of the trained model or a model alias. + *

+ * You can get information for multiple trained models in a single API request + * by using a comma-separated list of model IDs or a wildcard expression. *

* API name: {@code model_id} + *

+ * Adds one or more values to modelId. */ - public final Builder modelId(@Nullable String value) { - this.modelId = value; + public final Builder modelId(String value, String... values) { + this.modelId = _listAdd(this.modelId, value, values); return this; } @@ -319,9 +341,25 @@ public final Builder size(@Nullable Integer value) { * are returned. *

* API name: {@code tags} + *

+ * Adds all elements of list to tags. + */ + public final Builder tags(List list) { + this.tags = _listAddAll(this.tags, list); + return this; + } + + /** + * A comma delimited string of tags. A trained model can have many tags, or + * none. When supplied, only trained models that contain all the supplied tags + * are returned. + *

+ * API name: {@code tags} + *

+ * Adds one or more values to tags. */ - public final Builder tags(@Nullable String value) { - this.tags = value; + public final Builder tags(String value, String... values) { + this.tags = _listAdd(this.tags, value, values); return this; } @@ -363,7 +401,7 @@ public GetTrainedModelsRequest build() { int propsSet = 0; - if (request.modelId() != null) + if (ApiTypeHelper.isDefined(request.modelId())) propsSet |= _modelId; if (propsSet == (_modelId)) { @@ -371,7 +409,8 @@ public GetTrainedModelsRequest build() { buf.append("/_ml"); buf.append("/trained_models"); buf.append("/"); - SimpleEndpoint.pathEncode(request.modelId, buf); + SimpleEndpoint.pathEncode(request.modelId.stream().map(v -> v).collect(Collectors.joining(",")), + buf); return buf.toString(); } if (propsSet == 0) { @@ -391,11 +430,11 @@ public GetTrainedModelsRequest build() { int propsSet = 0; - if (request.modelId() != null) + if (ApiTypeHelper.isDefined(request.modelId())) propsSet |= _modelId; if (propsSet == (_modelId)) { - params.put("modelId", request.modelId); + params.put("modelId", request.modelId.stream().map(v -> v).collect(Collectors.joining(","))); } if (propsSet == 0) { } @@ -423,8 +462,8 @@ public GetTrainedModelsRequest build() { if (request.allowNoMatch != null) { params.put("allow_no_match", String.valueOf(request.allowNoMatch)); } - if (request.tags != null) { - params.put("tags", request.tags); + if (ApiTypeHelper.isDefined(request.tags)) { + params.put("tags", request.tags.stream().map(v -> v).collect(Collectors.joining(","))); } return params; diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PreviewDatafeedResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PreviewDatafeedResponse.java index 34a97d94a..4466457c8 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PreviewDatafeedResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PreviewDatafeedResponse.java @@ -183,7 +183,7 @@ public PreviewDatafeedResponse build() { * deserializers provided by the calling {@code JsonMapper}. */ public static final JsonpDeserializer> _DESERIALIZER = createPreviewDatafeedResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:ml.preview_datafeed.TDocument")); + new NamedDeserializer<>("co.elastic.clients:Deserializer:ml.preview_datafeed.Response.TDocument")); public static JsonpDeserializer> createPreviewDatafeedResponseDeserializer( JsonpDeserializer tDocumentDeserializer) { diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutCalendarJobRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutCalendarJobRequest.java index ecbf088cc..7f7015320 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutCalendarJobRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutCalendarJobRequest.java @@ -33,9 +33,11 @@ import java.lang.String; import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Function; +import java.util.stream.Collectors; import javax.annotation.Nullable; //---------------------------------------------------------------- @@ -65,14 +67,14 @@ public class PutCalendarJobRequest extends RequestBase { private final String calendarId; - private final String jobId; + private final List jobId; // --------------------------------------------------------------------------------------------- private PutCalendarJobRequest(Builder builder) { this.calendarId = ApiTypeHelper.requireNonNull(builder.calendarId, this, "calendarId"); - this.jobId = ApiTypeHelper.requireNonNull(builder.jobId, this, "jobId"); + this.jobId = ApiTypeHelper.unmodifiableRequired(builder.jobId, this, "jobId"); } @@ -95,7 +97,7 @@ public final String calendarId() { *

* API name: {@code job_id} */ - public final String jobId() { + public final List jobId() { return this.jobId; } @@ -110,7 +112,7 @@ public static class Builder extends RequestBase.AbstractBuilder ObjectBuilder { private String calendarId; - private String jobId; + private List jobId; /** * Required - A string that uniquely identifies a calendar. @@ -127,9 +129,24 @@ public final Builder calendarId(String value) { * identifier, a group name, or a comma-separated list of jobs or groups. *

* API name: {@code job_id} + *

+ * Adds all elements of list to jobId. + */ + public final Builder jobId(List list) { + this.jobId = _listAddAll(this.jobId, list); + return this; + } + + /** + * Required - An identifier for the anomaly detection jobs. It can be a job + * identifier, a group name, or a comma-separated list of jobs or groups. + *

+ * API name: {@code job_id} + *

+ * Adds one or more values to jobId. */ - public final Builder jobId(String value) { - this.jobId = value; + public final Builder jobId(String value, String... values) { + this.jobId = _listAdd(this.jobId, value, values); return this; } @@ -183,7 +200,7 @@ public PutCalendarJobRequest build() { SimpleEndpoint.pathEncode(request.calendarId, buf); buf.append("/jobs"); buf.append("/"); - SimpleEndpoint.pathEncode(request.jobId, buf); + SimpleEndpoint.pathEncode(request.jobId.stream().map(v -> v).collect(Collectors.joining(",")), buf); return buf.toString(); } throw SimpleEndpoint.noPathTemplateFound("path"); @@ -203,7 +220,7 @@ public PutCalendarJobRequest build() { if (propsSet == (_calendarId | _jobId)) { params.put("calendarId", request.calendarId); - params.put("jobId", request.jobId); + params.put("jobId", request.jobId.stream().map(v -> v).collect(Collectors.joining(","))); } return params; }, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutTrainedModelRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutTrainedModelRequest.java index 933adbbc7..4c17d7248 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutTrainedModelRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutTrainedModelRequest.java @@ -103,8 +103,14 @@ public class PutTrainedModelRequest extends RequestBase implements JsonpSerializ @Nullable private final String platformArchitecture; + @Nullable + private final TrainedModelPrefixStrings prefixStrings; + private final List tags; + @Nullable + private final Boolean waitForCompletion; + // --------------------------------------------------------------------------------------------- private PutTrainedModelRequest(Builder builder) { @@ -120,7 +126,9 @@ private PutTrainedModelRequest(Builder builder) { this.modelSizeBytes = builder.modelSizeBytes; this.modelType = builder.modelType; this.platformArchitecture = builder.platformArchitecture; + this.prefixStrings = builder.prefixStrings; this.tags = ApiTypeHelper.unmodifiable(builder.tags); + this.waitForCompletion = builder.waitForCompletion; } @@ -255,6 +263,16 @@ public final String platformArchitecture() { return this.platformArchitecture; } + /** + * Optional prefix strings applied at inference + *

+ * API name: {@code prefix_strings} + */ + @Nullable + public final TrainedModelPrefixStrings prefixStrings() { + return this.prefixStrings; + } + /** * An array of tags to organize the model. *

@@ -264,6 +282,16 @@ public final List tags() { return this.tags; } + /** + * Whether to wait for all child operations (e.g. model download) to complete. + *

+ * API name: {@code wait_for_completion} + */ + @Nullable + public final Boolean waitForCompletion() { + return this.waitForCompletion; + } + /** * Serialize this object to JSON. */ @@ -318,6 +346,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("platform_architecture"); generator.write(this.platformArchitecture); + } + if (this.prefixStrings != null) { + generator.writeKey("prefix_strings"); + this.prefixStrings.serialize(generator, mapper); + } if (ApiTypeHelper.isDefined(this.tags)) { generator.writeKey("tags"); @@ -373,9 +406,15 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private String platformArchitecture; + @Nullable + private TrainedModelPrefixStrings prefixStrings; + @Nullable private List tags; + @Nullable + private Boolean waitForCompletion; + /** * The compressed (GZipped and Base64 encoded) inference definition of the * model. If compressed_definition is specified, then definition cannot be @@ -536,6 +575,26 @@ public final Builder platformArchitecture(@Nullable String value) { return this; } + /** + * Optional prefix strings applied at inference + *

+ * API name: {@code prefix_strings} + */ + public final Builder prefixStrings(@Nullable TrainedModelPrefixStrings value) { + this.prefixStrings = value; + return this; + } + + /** + * Optional prefix strings applied at inference + *

+ * API name: {@code prefix_strings} + */ + public final Builder prefixStrings( + Function> fn) { + return this.prefixStrings(fn.apply(new TrainedModelPrefixStrings.Builder()).build()); + } + /** * An array of tags to organize the model. *

@@ -560,6 +619,16 @@ public final Builder tags(String value, String... values) { return this; } + /** + * Whether to wait for all child operations (e.g. model download) to complete. + *

+ * API name: {@code wait_for_completion} + */ + public final Builder waitForCompletion(@Nullable Boolean value) { + this.waitForCompletion = value; + return this; + } + @Override protected Builder self() { return this; @@ -598,6 +667,7 @@ protected static void setupPutTrainedModelRequestDeserializer( op.add(Builder::modelSizeBytes, JsonpDeserializer.longDeserializer(), "model_size_bytes"); op.add(Builder::modelType, TrainedModelType._DESERIALIZER, "model_type"); op.add(Builder::platformArchitecture, JsonpDeserializer.stringDeserializer(), "platform_architecture"); + op.add(Builder::prefixStrings, TrainedModelPrefixStrings._DESERIALIZER, "prefix_strings"); op.add(Builder::tags, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "tags"); } @@ -654,6 +724,9 @@ protected static void setupPutTrainedModelRequestDeserializer( // Request parameters request -> { Map params = new HashMap<>(); + if (request.waitForCompletion != null) { + params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); + } if (request.deferDefinitionDecompression != null) { params.put("defer_definition_decompression", String.valueOf(request.deferDefinitionDecompression)); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelPrefixStrings.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelPrefixStrings.java index 4055149d4..5bfde5862 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelPrefixStrings.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelPrefixStrings.java @@ -26,7 +26,6 @@ import co.elastic.clients.json.JsonpUtils; import co.elastic.clients.json.ObjectBuilderDeserializer; import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; @@ -60,16 +59,18 @@ */ @JsonpDeserializable public class TrainedModelPrefixStrings implements JsonpSerializable { + @Nullable private final String ingest; + @Nullable private final String search; // --------------------------------------------------------------------------------------------- private TrainedModelPrefixStrings(Builder builder) { - this.ingest = ApiTypeHelper.requireNonNull(builder.ingest, this, "ingest"); - this.search = ApiTypeHelper.requireNonNull(builder.search, this, "search"); + this.ingest = builder.ingest; + this.search = builder.search; } @@ -78,19 +79,21 @@ public static TrainedModelPrefixStrings of(Function * API name: {@code ingest} */ + @Nullable public final String ingest() { return this.ingest; } /** - * Required - String prepended to input at search + * String prepended to input at search *

* API name: {@code search} */ + @Nullable public final String search() { return this.search; } @@ -106,11 +109,16 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey("ingest"); - generator.write(this.ingest); + if (this.ingest != null) { + generator.writeKey("ingest"); + generator.write(this.ingest); - generator.writeKey("search"); - generator.write(this.search); + } + if (this.search != null) { + generator.writeKey("search"); + generator.write(this.search); + + } } @@ -128,26 +136,28 @@ public String toString() { public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable private String ingest; + @Nullable private String search; /** - * Required - String prepended to input at ingest + * String prepended to input at ingest *

* API name: {@code ingest} */ - public final Builder ingest(String value) { + public final Builder ingest(@Nullable String value) { this.ingest = value; return this; } /** - * Required - String prepended to input at search + * String prepended to input at search *

* API name: {@code search} */ - public final Builder search(String value) { + public final Builder search(@Nullable String value) { this.search = value; return this; } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateTrainedModelDeploymentRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateTrainedModelDeploymentRequest.java new file mode 100644 index 000000000..7a35ee534 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateTrainedModelDeploymentRequest.java @@ -0,0 +1,264 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.ml; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.endpoints.SimpleEndpoint; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.Integer; +import java.lang.String; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: ml.update_trained_model_deployment.Request + +/** + * Starts a trained model deployment, which allocates the model to every machine + * learning node. + * + * @see API + * specification + */ +@JsonpDeserializable +public class UpdateTrainedModelDeploymentRequest extends RequestBase implements JsonpSerializable { + private final String modelId; + + @Nullable + private final Integer numberOfAllocations; + + // --------------------------------------------------------------------------------------------- + + private UpdateTrainedModelDeploymentRequest(Builder builder) { + + this.modelId = ApiTypeHelper.requireNonNull(builder.modelId, this, "modelId"); + this.numberOfAllocations = builder.numberOfAllocations; + + } + + public static UpdateTrainedModelDeploymentRequest of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - The unique identifier of the trained model. Currently, only + * PyTorch models are supported. + *

+ * API name: {@code model_id} + */ + public final String modelId() { + return this.modelId; + } + + /** + * The number of model allocations on each node where the model is deployed. All + * allocations on a node share the same copy of the model in memory but use a + * separate set of threads to evaluate the model. Increasing this value + * generally increases the throughput. If this setting is greater than the + * number of hardware threads it will automatically be changed to a value less + * than the number of hardware threads. + *

+ * API name: {@code number_of_allocations} + */ + @Nullable + public final Integer numberOfAllocations() { + return this.numberOfAllocations; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + if (this.numberOfAllocations != null) { + generator.writeKey("number_of_allocations"); + generator.write(this.numberOfAllocations); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link UpdateTrainedModelDeploymentRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + private String modelId; + + @Nullable + private Integer numberOfAllocations; + + /** + * Required - The unique identifier of the trained model. Currently, only + * PyTorch models are supported. + *

+ * API name: {@code model_id} + */ + public final Builder modelId(String value) { + this.modelId = value; + return this; + } + + /** + * The number of model allocations on each node where the model is deployed. All + * allocations on a node share the same copy of the model in memory but use a + * separate set of threads to evaluate the model. Increasing this value + * generally increases the throughput. If this setting is greater than the + * number of hardware threads it will automatically be changed to a value less + * than the number of hardware threads. + *

+ * API name: {@code number_of_allocations} + */ + public final Builder numberOfAllocations(@Nullable Integer value) { + this.numberOfAllocations = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link UpdateTrainedModelDeploymentRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public UpdateTrainedModelDeploymentRequest build() { + _checkSingleUse(); + + return new UpdateTrainedModelDeploymentRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link UpdateTrainedModelDeploymentRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, + UpdateTrainedModelDeploymentRequest::setupUpdateTrainedModelDeploymentRequestDeserializer); + + protected static void setupUpdateTrainedModelDeploymentRequestDeserializer( + ObjectDeserializer op) { + + op.add(Builder::numberOfAllocations, JsonpDeserializer.integerDeserializer(), "number_of_allocations"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ml.update_trained_model_deployment}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/ml.update_trained_model_deployment", + + // Request method + request -> { + return "POST"; + + }, + + // Request path + request -> { + final int _modelId = 1 << 0; + + int propsSet = 0; + + propsSet |= _modelId; + + if (propsSet == (_modelId)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_ml"); + buf.append("/trained_models"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.modelId, buf); + buf.append("/deployment"); + buf.append("/_update"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _modelId = 1 << 0; + + int propsSet = 0; + + propsSet |= _modelId; + + if (propsSet == (_modelId)) { + params.put("modelId", request.modelId); + } + return params; + }, + + // Request parameters + request -> { + return Collections.emptyMap(); + + }, SimpleEndpoint.emptyMap(), true, UpdateTrainedModelDeploymentResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateTrainedModelDeploymentResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateTrainedModelDeploymentResponse.java new file mode 100644 index 000000000..b1a30d1b5 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateTrainedModelDeploymentResponse.java @@ -0,0 +1,166 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.ml; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: ml.update_trained_model_deployment.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class UpdateTrainedModelDeploymentResponse implements JsonpSerializable { + private final TrainedModelAssignment assignment; + + // --------------------------------------------------------------------------------------------- + + private UpdateTrainedModelDeploymentResponse(Builder builder) { + + this.assignment = ApiTypeHelper.requireNonNull(builder.assignment, this, "assignment"); + + } + + public static UpdateTrainedModelDeploymentResponse of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code assignment} + */ + public final TrainedModelAssignment assignment() { + return this.assignment; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeKey("assignment"); + this.assignment.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link UpdateTrainedModelDeploymentResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private TrainedModelAssignment assignment; + + /** + * Required - API name: {@code assignment} + */ + public final Builder assignment(TrainedModelAssignment value) { + this.assignment = value; + return this; + } + + /** + * Required - API name: {@code assignment} + */ + public final Builder assignment( + Function> fn) { + return this.assignment(fn.apply(new TrainedModelAssignment.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link UpdateTrainedModelDeploymentResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public UpdateTrainedModelDeploymentResponse build() { + _checkSingleUse(); + + return new UpdateTrainedModelDeploymentResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link UpdateTrainedModelDeploymentResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, + UpdateTrainedModelDeploymentResponse::setupUpdateTrainedModelDeploymentResponseDeserializer); + + protected static void setupUpdateTrainedModelDeploymentResponseDeserializer( + ObjectDeserializer op) { + + op.add(Builder::assignment, TrainedModelAssignment._DESERIALIZER, "assignment"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/nodes/NodesResponseBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/nodes/NodesResponseBase.java deleted file mode 100644 index 7b825a9d9..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/nodes/NodesResponseBase.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.nodes; - -import co.elastic.clients.elasticsearch._types.NodeStatistics; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: nodes._types.NodesResponseBase - -/** - * - * @see API - * specification - */ - -public abstract class NodesResponseBase implements JsonpSerializable { - @Nullable - private final NodeStatistics nodeStats; - - // --------------------------------------------------------------------------------------------- - - protected NodesResponseBase(AbstractBuilder builder) { - - this.nodeStats = builder.nodeStats; - - } - - /** - * Contains statistics about the number of nodes selected by the request’s node - * filters. - *

- * API name: {@code _nodes} - */ - @Nullable - public final NodeStatistics nodeStats() { - return this.nodeStats; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - if (this.nodeStats != null) { - generator.writeKey("_nodes"); - this.nodeStats.serialize(generator, mapper); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - public abstract static class AbstractBuilder> - extends - WithJsonObjectBuilderBase { - @Nullable - private NodeStatistics nodeStats; - - /** - * Contains statistics about the number of nodes selected by the request’s node - * filters. - *

- * API name: {@code _nodes} - */ - public final BuilderT nodeStats(@Nullable NodeStatistics value) { - this.nodeStats = value; - return self(); - } - - /** - * Contains statistics about the number of nodes selected by the request’s node - * filters. - *

- * API name: {@code _nodes} - */ - public final BuilderT nodeStats(Function> fn) { - return this.nodeStats(fn.apply(new NodeStatistics.Builder()).build()); - } - - protected abstract BuilderT self(); - - } - - // --------------------------------------------------------------------------------------------- - protected static > void setupNodesResponseBaseDeserializer( - ObjectDeserializer op) { - - op.add(AbstractBuilder::nodeStats, NodeStatistics._DESERIALIZER, "_nodes"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/DeleteQueryRuleRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/DeleteQueryRuleRequest.java new file mode 100644 index 000000000..3996fcc28 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/DeleteQueryRuleRequest.java @@ -0,0 +1,217 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.query_rule; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.endpoints.SimpleEndpoint; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: query_rule.delete.Request + +/** + * Deletes a query rule within a query ruleset. + * + * @see API + * specification + */ + +public class DeleteQueryRuleRequest extends RequestBase { + private final String ruleId; + + private final String rulesetId; + + // --------------------------------------------------------------------------------------------- + + private DeleteQueryRuleRequest(Builder builder) { + + this.ruleId = ApiTypeHelper.requireNonNull(builder.ruleId, this, "ruleId"); + this.rulesetId = ApiTypeHelper.requireNonNull(builder.rulesetId, this, "rulesetId"); + + } + + public static DeleteQueryRuleRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - The unique identifier of the query rule within the specified + * ruleset to delete + *

+ * API name: {@code rule_id} + */ + public final String ruleId() { + return this.ruleId; + } + + /** + * Required - The unique identifier of the query ruleset containing the rule to + * delete + *

+ * API name: {@code ruleset_id} + */ + public final String rulesetId() { + return this.rulesetId; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteQueryRuleRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + private String ruleId; + + private String rulesetId; + + /** + * Required - The unique identifier of the query rule within the specified + * ruleset to delete + *

+ * API name: {@code rule_id} + */ + public final Builder ruleId(String value) { + this.ruleId = value; + return this; + } + + /** + * Required - The unique identifier of the query ruleset containing the rule to + * delete + *

+ * API name: {@code ruleset_id} + */ + public final Builder rulesetId(String value) { + this.rulesetId = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteQueryRuleRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteQueryRuleRequest build() { + _checkSingleUse(); + + return new DeleteQueryRuleRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code query_rule.delete}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/query_rule.delete", + + // Request method + request -> { + return "DELETE"; + + }, + + // Request path + request -> { + final int _ruleId = 1 << 0; + final int _rulesetId = 1 << 1; + + int propsSet = 0; + + propsSet |= _ruleId; + propsSet |= _rulesetId; + + if (propsSet == (_rulesetId | _ruleId)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_query_rules"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.rulesetId, buf); + buf.append("/_rule"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.ruleId, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _ruleId = 1 << 0; + final int _rulesetId = 1 << 1; + + int propsSet = 0; + + propsSet |= _ruleId; + propsSet |= _rulesetId; + + if (propsSet == (_rulesetId | _ruleId)) { + params.put("rulesetId", request.rulesetId); + params.put("ruleId", request.ruleId); + } + return params; + }, + + // Request parameters + request -> { + return Collections.emptyMap(); + + }, SimpleEndpoint.emptyMap(), false, DeleteQueryRuleResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteModelResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/DeleteQueryRuleResponse.java similarity index 72% rename from java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteModelResponse.java rename to java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/DeleteQueryRuleResponse.java index b479ad40b..ef00ab908 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/inference/DeleteModelResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/DeleteQueryRuleResponse.java @@ -17,7 +17,7 @@ * under the License. */ -package co.elastic.clients.elasticsearch.inference; +package co.elastic.clients.elasticsearch.query_rule; import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; import co.elastic.clients.json.JsonpDeserializable; @@ -44,62 +44,63 @@ // //---------------------------------------------------------------- -// typedef: inference.delete_model.Response +// typedef: query_rule.delete.Response /** * - * @see API + * @see API * specification */ @JsonpDeserializable -public class DeleteModelResponse extends AcknowledgedResponseBase { +public class DeleteQueryRuleResponse extends AcknowledgedResponseBase { // --------------------------------------------------------------------------------------------- - private DeleteModelResponse(Builder builder) { + private DeleteQueryRuleResponse(Builder builder) { super(builder); } - public static DeleteModelResponse of(Function> fn) { + public static DeleteQueryRuleResponse of(Function> fn) { return fn.apply(new Builder()).build(); } // --------------------------------------------------------------------------------------------- /** - * Builder for {@link DeleteModelResponse}. + * Builder for {@link DeleteQueryRuleResponse}. */ public static class Builder extends AcknowledgedResponseBase.AbstractBuilder implements - ObjectBuilder { + ObjectBuilder { @Override protected Builder self() { return this; } /** - * Builds a {@link DeleteModelResponse}. + * Builds a {@link DeleteQueryRuleResponse}. * * @throws NullPointerException * if some of the required fields are null. */ - public DeleteModelResponse build() { + public DeleteQueryRuleResponse build() { _checkSingleUse(); - return new DeleteModelResponse(this); + return new DeleteQueryRuleResponse(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link DeleteModelResponse} + * Json deserializer for {@link DeleteQueryRuleResponse} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, DeleteModelResponse::setupDeleteModelResponseDeserializer); + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DeleteQueryRuleResponse::setupDeleteQueryRuleResponseDeserializer); - protected static void setupDeleteModelResponseDeserializer(ObjectDeserializer op) { + protected static void setupDeleteQueryRuleResponseDeserializer( + ObjectDeserializer op) { AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/ElasticsearchQueryRuleAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/ElasticsearchQueryRuleAsyncClient.java new file mode 100644 index 000000000..2812f2f87 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/ElasticsearchQueryRuleAsyncClient.java @@ -0,0 +1,168 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.query_rule; + +import co.elastic.clients.ApiClient; +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.transport.ElasticsearchTransport; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.JsonEndpoint; +import co.elastic.clients.transport.Transport; +import co.elastic.clients.transport.TransportOptions; +import co.elastic.clients.util.ObjectBuilder; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Client for the query_rule namespace. + */ +public class ElasticsearchQueryRuleAsyncClient + extends + ApiClient { + + public ElasticsearchQueryRuleAsyncClient(ElasticsearchTransport transport) { + super(transport, null); + } + + public ElasticsearchQueryRuleAsyncClient(ElasticsearchTransport transport, + @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + @Override + public ElasticsearchQueryRuleAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) { + return new ElasticsearchQueryRuleAsyncClient(this.transport, transportOptions); + } + + // ----- Endpoint: query_rule.delete + + /** + * Deletes a query rule within a query ruleset. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture delete(DeleteQueryRuleRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteQueryRuleRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Deletes a query rule within a query ruleset. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteQueryRuleRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture delete( + Function> fn) { + return delete(fn.apply(new DeleteQueryRuleRequest.Builder()).build()); + } + + // ----- Endpoint: query_rule.get + + /** + * Returns the details about a query rule within a query ruleset + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture get(GetQueryRuleRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetQueryRuleRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns the details about a query rule within a query ruleset + * + * @param fn + * a function that initializes a builder to create the + * {@link GetQueryRuleRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture get( + Function> fn) { + return get(fn.apply(new GetQueryRuleRequest.Builder()).build()); + } + + // ----- Endpoint: query_rule.put + + /** + * Creates or updates a query rule within a query ruleset. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture put(PutRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Creates or updates a query rule within a query ruleset. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture put(Function> fn) { + return put(fn.apply(new PutRequest.Builder()).build()); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/ElasticsearchQueryRuleClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/ElasticsearchQueryRuleClient.java new file mode 100644 index 000000000..0077ca489 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/ElasticsearchQueryRuleClient.java @@ -0,0 +1,168 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.query_rule; + +import co.elastic.clients.ApiClient; +import co.elastic.clients.elasticsearch._types.ElasticsearchException; +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.transport.ElasticsearchTransport; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.JsonEndpoint; +import co.elastic.clients.transport.Transport; +import co.elastic.clients.transport.TransportOptions; +import co.elastic.clients.util.ObjectBuilder; +import java.io.IOException; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Client for the query_rule namespace. + */ +public class ElasticsearchQueryRuleClient extends ApiClient { + + public ElasticsearchQueryRuleClient(ElasticsearchTransport transport) { + super(transport, null); + } + + public ElasticsearchQueryRuleClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + @Override + public ElasticsearchQueryRuleClient withTransportOptions(@Nullable TransportOptions transportOptions) { + return new ElasticsearchQueryRuleClient(this.transport, transportOptions); + } + + // ----- Endpoint: query_rule.delete + + /** + * Deletes a query rule within a query ruleset. + * + * @see Documentation + * on elastic.co + */ + + public DeleteQueryRuleResponse delete(DeleteQueryRuleRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteQueryRuleRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Deletes a query rule within a query ruleset. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteQueryRuleRequest} + * @see Documentation + * on elastic.co + */ + + public final DeleteQueryRuleResponse delete( + Function> fn) + throws IOException, ElasticsearchException { + return delete(fn.apply(new DeleteQueryRuleRequest.Builder()).build()); + } + + // ----- Endpoint: query_rule.get + + /** + * Returns the details about a query rule within a query ruleset + * + * @see Documentation + * on elastic.co + */ + + public GetQueryRuleResponse get(GetQueryRuleRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetQueryRuleRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns the details about a query rule within a query ruleset + * + * @param fn + * a function that initializes a builder to create the + * {@link GetQueryRuleRequest} + * @see Documentation + * on elastic.co + */ + + public final GetQueryRuleResponse get(Function> fn) + throws IOException, ElasticsearchException { + return get(fn.apply(new GetQueryRuleRequest.Builder()).build()); + } + + // ----- Endpoint: query_rule.put + + /** + * Creates or updates a query rule within a query ruleset. + * + * @see Documentation + * on elastic.co + */ + + public PutResponse put(PutRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Creates or updates a query rule within a query ruleset. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutRequest} + * @see Documentation + * on elastic.co + */ + + public final PutResponse put(Function> fn) + throws IOException, ElasticsearchException { + return put(fn.apply(new PutRequest.Builder()).build()); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/GetQueryRuleRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/GetQueryRuleRequest.java new file mode 100644 index 000000000..45587e958 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/GetQueryRuleRequest.java @@ -0,0 +1,217 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.query_rule; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.endpoints.SimpleEndpoint; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: query_rule.get.Request + +/** + * Returns the details about a query rule within a query ruleset + * + * @see API + * specification + */ + +public class GetQueryRuleRequest extends RequestBase { + private final String ruleId; + + private final String rulesetId; + + // --------------------------------------------------------------------------------------------- + + private GetQueryRuleRequest(Builder builder) { + + this.ruleId = ApiTypeHelper.requireNonNull(builder.ruleId, this, "ruleId"); + this.rulesetId = ApiTypeHelper.requireNonNull(builder.rulesetId, this, "rulesetId"); + + } + + public static GetQueryRuleRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - The unique identifier of the query rule within the specified + * ruleset to retrieve + *

+ * API name: {@code rule_id} + */ + public final String ruleId() { + return this.ruleId; + } + + /** + * Required - The unique identifier of the query ruleset containing the rule to + * retrieve + *

+ * API name: {@code ruleset_id} + */ + public final String rulesetId() { + return this.rulesetId; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetQueryRuleRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + private String ruleId; + + private String rulesetId; + + /** + * Required - The unique identifier of the query rule within the specified + * ruleset to retrieve + *

+ * API name: {@code rule_id} + */ + public final Builder ruleId(String value) { + this.ruleId = value; + return this; + } + + /** + * Required - The unique identifier of the query ruleset containing the rule to + * retrieve + *

+ * API name: {@code ruleset_id} + */ + public final Builder rulesetId(String value) { + this.rulesetId = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetQueryRuleRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetQueryRuleRequest build() { + _checkSingleUse(); + + return new GetQueryRuleRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code query_rule.get}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/query_rule.get", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _ruleId = 1 << 0; + final int _rulesetId = 1 << 1; + + int propsSet = 0; + + propsSet |= _ruleId; + propsSet |= _rulesetId; + + if (propsSet == (_rulesetId | _ruleId)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_query_rules"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.rulesetId, buf); + buf.append("/_rule"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.ruleId, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _ruleId = 1 << 0; + final int _rulesetId = 1 << 1; + + int propsSet = 0; + + propsSet |= _ruleId; + propsSet |= _rulesetId; + + if (propsSet == (_rulesetId | _ruleId)) { + params.put("rulesetId", request.rulesetId); + params.put("ruleId", request.ruleId); + } + return params; + }, + + // Request parameters + request -> { + return Collections.emptyMap(); + + }, SimpleEndpoint.emptyMap(), false, GetQueryRuleResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ClusterStatsResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/GetQueryRuleResponse.java similarity index 53% rename from java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ClusterStatsResponse.java rename to java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/GetQueryRuleResponse.java index 7f377d8f8..c25fb20de 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ClusterStatsResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/GetQueryRuleResponse.java @@ -17,13 +17,9 @@ * under the License. */ -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- +package co.elastic.clients.elasticsearch.query_rule; -package co.elastic.clients.elasticsearch.cluster; - -import co.elastic.clients.elasticsearch.cluster.stats.StatsResponseBase; +import co.elastic.clients.elasticsearch.query_ruleset.QueryRule; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.ObjectBuilderDeserializer; @@ -33,63 +29,78 @@ import java.util.Objects; import java.util.function.Function; -// typedef: cluster.stats.Response +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: query_rule.get.Response /** * - * @see API + * @see API * specification */ @JsonpDeserializable -public class ClusterStatsResponse extends StatsResponseBase { +public class GetQueryRuleResponse extends QueryRule { // --------------------------------------------------------------------------------------------- - private ClusterStatsResponse(Builder builder) { + private GetQueryRuleResponse(Builder builder) { super(builder); } - public static ClusterStatsResponse of(Function> fn) { + public static GetQueryRuleResponse of(Function> fn) { return fn.apply(new Builder()).build(); } // --------------------------------------------------------------------------------------------- /** - * Builder for {@link ClusterStatsResponse}. + * Builder for {@link GetQueryRuleResponse}. */ - public static class Builder extends StatsResponseBase.AbstractBuilder + public static class Builder extends QueryRule.AbstractBuilder implements - ObjectBuilder { + ObjectBuilder { @Override protected Builder self() { return this; } /** - * Builds a {@link ClusterStatsResponse}. + * Builds a {@link GetQueryRuleResponse}. * * @throws NullPointerException * if some of the required fields are null. */ - public ClusterStatsResponse build() { + public GetQueryRuleResponse build() { _checkSingleUse(); - return new ClusterStatsResponse(this); + return new GetQueryRuleResponse(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link ClusterStatsResponse} + * Json deserializer for {@link GetQueryRuleResponse} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ClusterStatsResponse::setupClusterStatsResponseDeserializer); + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, GetQueryRuleResponse::setupGetQueryRuleResponseDeserializer); - protected static void setupClusterStatsResponseDeserializer(ObjectDeserializer op) { - StatsResponseBase.setupStatsResponseBaseDeserializer(op); + protected static void setupGetQueryRuleResponseDeserializer(ObjectDeserializer op) { + QueryRule.setupQueryRuleDeserializer(op); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/PutRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/PutRequest.java new file mode 100644 index 000000000..9522700ff --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/PutRequest.java @@ -0,0 +1,354 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.query_rule; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch.query_ruleset.QueryRuleActions; +import co.elastic.clients.elasticsearch.query_ruleset.QueryRuleCriteria; +import co.elastic.clients.elasticsearch.query_ruleset.QueryRuleType; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.endpoints.SimpleEndpoint; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: query_rule.put.Request + +/** + * Creates or updates a query rule within a query ruleset. + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutRequest extends RequestBase implements JsonpSerializable { + private final QueryRuleActions actions; + + private final List criteria; + + private final String ruleId; + + private final String rulesetId; + + private final QueryRuleType type; + + // --------------------------------------------------------------------------------------------- + + private PutRequest(Builder builder) { + + this.actions = ApiTypeHelper.requireNonNull(builder.actions, this, "actions"); + this.criteria = ApiTypeHelper.unmodifiableRequired(builder.criteria, this, "criteria"); + this.ruleId = ApiTypeHelper.requireNonNull(builder.ruleId, this, "ruleId"); + this.rulesetId = ApiTypeHelper.requireNonNull(builder.rulesetId, this, "rulesetId"); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + + } + + public static PutRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code actions} + */ + public final QueryRuleActions actions() { + return this.actions; + } + + /** + * Required - API name: {@code criteria} + */ + public final List criteria() { + return this.criteria; + } + + /** + * Required - The unique identifier of the query rule within the specified + * ruleset to be created or updated + *

+ * API name: {@code rule_id} + */ + public final String ruleId() { + return this.ruleId; + } + + /** + * Required - The unique identifier of the query ruleset containing the rule to + * be created or updated + *

+ * API name: {@code ruleset_id} + */ + public final String rulesetId() { + return this.rulesetId; + } + + /** + * Required - API name: {@code type} + */ + public final QueryRuleType type() { + return this.type; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeKey("actions"); + this.actions.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.criteria)) { + generator.writeKey("criteria"); + generator.writeStartArray(); + for (QueryRuleCriteria item0 : this.criteria) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + generator.writeKey("type"); + this.type.serialize(generator, mapper); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + private QueryRuleActions actions; + + private List criteria; + + private String ruleId; + + private String rulesetId; + + private QueryRuleType type; + + /** + * Required - API name: {@code actions} + */ + public final Builder actions(QueryRuleActions value) { + this.actions = value; + return this; + } + + /** + * Required - API name: {@code actions} + */ + public final Builder actions(Function> fn) { + return this.actions(fn.apply(new QueryRuleActions.Builder()).build()); + } + + /** + * Required - API name: {@code criteria} + *

+ * Adds all elements of list to criteria. + */ + public final Builder criteria(List list) { + this.criteria = _listAddAll(this.criteria, list); + return this; + } + + /** + * Required - API name: {@code criteria} + *

+ * Adds one or more values to criteria. + */ + public final Builder criteria(QueryRuleCriteria value, QueryRuleCriteria... values) { + this.criteria = _listAdd(this.criteria, value, values); + return this; + } + + /** + * Required - API name: {@code criteria} + *

+ * Adds a value to criteria using a builder lambda. + */ + public final Builder criteria(Function> fn) { + return criteria(fn.apply(new QueryRuleCriteria.Builder()).build()); + } + + /** + * Required - The unique identifier of the query rule within the specified + * ruleset to be created or updated + *

+ * API name: {@code rule_id} + */ + public final Builder ruleId(String value) { + this.ruleId = value; + return this; + } + + /** + * Required - The unique identifier of the query ruleset containing the rule to + * be created or updated + *

+ * API name: {@code ruleset_id} + */ + public final Builder rulesetId(String value) { + this.rulesetId = value; + return this; + } + + /** + * Required - API name: {@code type} + */ + public final Builder type(QueryRuleType value) { + this.type = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutRequest build() { + _checkSingleUse(); + + return new PutRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + PutRequest::setupPutRequestDeserializer); + + protected static void setupPutRequestDeserializer(ObjectDeserializer op) { + + op.add(Builder::actions, QueryRuleActions._DESERIALIZER, "actions"); + op.add(Builder::criteria, JsonpDeserializer.arrayDeserializer(QueryRuleCriteria._DESERIALIZER), "criteria"); + op.add(Builder::type, QueryRuleType._DESERIALIZER, "type"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code query_rule.put}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/query_rule.put", + + // Request method + request -> { + return "PUT"; + + }, + + // Request path + request -> { + final int _ruleId = 1 << 0; + final int _rulesetId = 1 << 1; + + int propsSet = 0; + + propsSet |= _ruleId; + propsSet |= _rulesetId; + + if (propsSet == (_rulesetId | _ruleId)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_query_rules"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.rulesetId, buf); + buf.append("/_rule"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.ruleId, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _ruleId = 1 << 0; + final int _rulesetId = 1 << 1; + + int propsSet = 0; + + propsSet |= _ruleId; + propsSet |= _rulesetId; + + if (propsSet == (_rulesetId | _ruleId)) { + params.put("rulesetId", request.rulesetId); + params.put("ruleId", request.ruleId); + } + return params; + }, + + // Request parameters + request -> { + return Collections.emptyMap(); + + }, SimpleEndpoint.emptyMap(), true, PutResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClusterNode.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/PutResponse.java similarity index 57% rename from java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClusterNode.java rename to java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/PutResponse.java index 77240741e..16b1db7a3 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClusterNode.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_rule/PutResponse.java @@ -17,12 +17,9 @@ * under the License. */ -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.security; +package co.elastic.clients.elasticsearch.query_rule; +import co.elastic.clients.elasticsearch._types.Result; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -34,39 +31,53 @@ import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; -import java.lang.String; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; -// typedef: security._types.ClusterNode +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: query_rule.put.Response /** * - * @see API + * @see API * specification */ @JsonpDeserializable -public class ClusterNode implements JsonpSerializable { - private final String name; +public class PutResponse implements JsonpSerializable { + private final Result result; // --------------------------------------------------------------------------------------------- - private ClusterNode(Builder builder) { + private PutResponse(Builder builder) { - this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.result = ApiTypeHelper.requireNonNull(builder.result, this, "result"); } - public static ClusterNode of(Function> fn) { + public static PutResponse of(Function> fn) { return fn.apply(new Builder()).build(); } /** - * Required - API name: {@code name} + * Required - API name: {@code result} */ - public final String name() { - return this.name; + public final Result result() { + return this.result; } /** @@ -80,8 +91,8 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - generator.writeKey("name"); - generator.write(this.name); + generator.writeKey("result"); + this.result.serialize(generator, mapper); } @@ -93,17 +104,17 @@ public String toString() { // --------------------------------------------------------------------------------------------- /** - * Builder for {@link ClusterNode}. + * Builder for {@link PutResponse}. */ - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private String name; + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Result result; /** - * Required - API name: {@code name} + * Required - API name: {@code result} */ - public final Builder name(String value) { - this.name = value; + public final Builder result(Result value) { + this.result = value; return this; } @@ -113,29 +124,29 @@ protected Builder self() { } /** - * Builds a {@link ClusterNode}. + * Builds a {@link PutResponse}. * * @throws NullPointerException * if some of the required fields are null. */ - public ClusterNode build() { + public PutResponse build() { _checkSingleUse(); - return new ClusterNode(this); + return new PutResponse(this); } } // --------------------------------------------------------------------------------------------- /** - * Json deserializer for {@link ClusterNode} + * Json deserializer for {@link PutResponse} */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, - ClusterNode::setupClusterNodeDeserializer); + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + PutResponse::setupPutResponseDeserializer); - protected static void setupClusterNodeDeserializer(ObjectDeserializer op) { + protected static void setupPutResponseDeserializer(ObjectDeserializer op) { - op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::result, Result._DESERIALIZER, "result"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/ElasticsearchQueryRulesetAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/ElasticsearchQueryRulesetAsyncClient.java index 8d249f4fa..2a451ea37 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/ElasticsearchQueryRulesetAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/ElasticsearchQueryRulesetAsyncClient.java @@ -103,7 +103,7 @@ public final CompletableFuture delete( // ----- Endpoint: query_ruleset.get /** - * Returns the details about a query ruleset. + * Returns the details about a query ruleset * * @see Documentation @@ -118,7 +118,7 @@ public CompletableFuture get(GetQueryRulesetRequest req } /** - * Returns the details about a query ruleset. + * Returns the details about a query ruleset * * @param fn * a function that initializes a builder to create the @@ -136,7 +136,7 @@ public final CompletableFuture get( // ----- Endpoint: query_ruleset.list /** - * Lists query rulesets. + * Returns summarized information about existing query rulesets. * * @see Documentation @@ -151,7 +151,7 @@ public CompletableFuture list(ListRequest request) { } /** - * Lists query rulesets. + * Returns summarized information about existing query rulesets. * * @param fn * a function that initializes a builder to create the @@ -166,7 +166,7 @@ public final CompletableFuture list(FunctionDocumentation diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/ElasticsearchQueryRulesetClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/ElasticsearchQueryRulesetClient.java index 05b95f685..7c5b2381e 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/ElasticsearchQueryRulesetClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/ElasticsearchQueryRulesetClient.java @@ -106,7 +106,7 @@ public final DeleteQueryRulesetResponse delete( // ----- Endpoint: query_ruleset.get /** - * Returns the details about a query ruleset. + * Returns the details about a query ruleset * * @see Documentation @@ -121,7 +121,7 @@ public GetQueryRulesetResponse get(GetQueryRulesetRequest request) throws IOExce } /** - * Returns the details about a query ruleset. + * Returns the details about a query ruleset * * @param fn * a function that initializes a builder to create the @@ -140,7 +140,7 @@ public final GetQueryRulesetResponse get( // ----- Endpoint: query_ruleset.list /** - * Lists query rulesets. + * Returns summarized information about existing query rulesets. * * @see Documentation @@ -155,7 +155,7 @@ public ListResponse list(ListRequest request) throws IOException, ElasticsearchE } /** - * Lists query rulesets. + * Returns summarized information about existing query rulesets. * * @param fn * a function that initializes a builder to create the @@ -171,7 +171,7 @@ public final ListResponse list(FunctionDocumentation diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRule.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRule.java index 962bc86bf..6f87c45f2 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRule.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRule.java @@ -70,7 +70,7 @@ public class QueryRule implements JsonpSerializable { // --------------------------------------------------------------------------------------------- - private QueryRule(Builder builder) { + protected QueryRule(AbstractBuilder builder) { this.ruleId = ApiTypeHelper.requireNonNull(builder.ruleId, this, "ruleId"); this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); @@ -79,7 +79,7 @@ private QueryRule(Builder builder) { } - public static QueryRule of(Function> fn) { + public static QueryRule queryRuleOf(Function> fn) { return fn.apply(new Builder()).build(); } @@ -153,7 +153,28 @@ public String toString() { * Builder for {@link QueryRule}. */ - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + public static class Builder extends QueryRule.AbstractBuilder implements ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link QueryRule}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public QueryRule build() { + _checkSingleUse(); + + return new QueryRule(this); + } + } + + public abstract static class AbstractBuilder> + extends + WithJsonObjectBuilderBase { private String ruleId; private QueryRuleType type; @@ -165,17 +186,17 @@ public static class Builder extends WithJsonObjectBuilderBase implement /** * Required - API name: {@code rule_id} */ - public final Builder ruleId(String value) { + public final BuilderT ruleId(String value) { this.ruleId = value; - return this; + return self(); } /** * Required - API name: {@code type} */ - public final Builder type(QueryRuleType value) { + public final BuilderT type(QueryRuleType value) { this.type = value; - return this; + return self(); } /** @@ -183,9 +204,9 @@ public final Builder type(QueryRuleType value) { *

* Adds all elements of list to criteria. */ - public final Builder criteria(List list) { + public final BuilderT criteria(List list) { this.criteria = _listAddAll(this.criteria, list); - return this; + return self(); } /** @@ -193,9 +214,9 @@ public final Builder criteria(List list) { *

* Adds one or more values to criteria. */ - public final Builder criteria(QueryRuleCriteria value, QueryRuleCriteria... values) { + public final BuilderT criteria(QueryRuleCriteria value, QueryRuleCriteria... values) { this.criteria = _listAdd(this.criteria, value, values); - return this; + return self(); } /** @@ -203,41 +224,27 @@ public final Builder criteria(QueryRuleCriteria value, QueryRuleCriteria... valu *

* Adds a value to criteria using a builder lambda. */ - public final Builder criteria(Function> fn) { + public final BuilderT criteria(Function> fn) { return criteria(fn.apply(new QueryRuleCriteria.Builder()).build()); } /** * Required - API name: {@code actions} */ - public final Builder actions(QueryRuleActions value) { + public final BuilderT actions(QueryRuleActions value) { this.actions = value; - return this; + return self(); } /** * Required - API name: {@code actions} */ - public final Builder actions(Function> fn) { + public final BuilderT actions(Function> fn) { return this.actions(fn.apply(new QueryRuleActions.Builder()).build()); } - @Override - protected Builder self() { - return this; - } + protected abstract BuilderT self(); - /** - * Builds a {@link QueryRule}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public QueryRule build() { - _checkSingleUse(); - - return new QueryRule(this); - } } // --------------------------------------------------------------------------------------------- @@ -248,12 +255,14 @@ public QueryRule build() { public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, QueryRule::setupQueryRuleDeserializer); - protected static void setupQueryRuleDeserializer(ObjectDeserializer op) { + protected static > void setupQueryRuleDeserializer( + ObjectDeserializer op) { - op.add(Builder::ruleId, JsonpDeserializer.stringDeserializer(), "rule_id"); - op.add(Builder::type, QueryRuleType._DESERIALIZER, "type"); - op.add(Builder::criteria, JsonpDeserializer.arrayDeserializer(QueryRuleCriteria._DESERIALIZER), "criteria"); - op.add(Builder::actions, QueryRuleActions._DESERIALIZER, "actions"); + op.add(AbstractBuilder::ruleId, JsonpDeserializer.stringDeserializer(), "rule_id"); + op.add(AbstractBuilder::type, QueryRuleType._DESERIALIZER, "type"); + op.add(AbstractBuilder::criteria, JsonpDeserializer.arrayDeserializer(QueryRuleCriteria._DESERIALIZER), + "criteria"); + op.add(AbstractBuilder::actions, QueryRuleActions._DESERIALIZER, "actions"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRuleCriteria.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRuleCriteria.java index 830147759..f89884b40 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRuleCriteria.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRuleCriteria.java @@ -64,6 +64,7 @@ public class QueryRuleCriteria implements JsonpSerializable { private final QueryRuleCriteriaType type; + @Nullable private final String metadata; private final List values; @@ -73,7 +74,7 @@ public class QueryRuleCriteria implements JsonpSerializable { private QueryRuleCriteria(Builder builder) { this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); - this.metadata = ApiTypeHelper.requireNonNull(builder.metadata, this, "metadata"); + this.metadata = builder.metadata; this.values = ApiTypeHelper.unmodifiable(builder.values); } @@ -90,8 +91,9 @@ public final QueryRuleCriteriaType type() { } /** - * Required - API name: {@code metadata} + * API name: {@code metadata} */ + @Nullable public final String metadata() { return this.metadata; } @@ -116,9 +118,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("type"); this.type.serialize(generator, mapper); - generator.writeKey("metadata"); - generator.write(this.metadata); + if (this.metadata != null) { + generator.writeKey("metadata"); + generator.write(this.metadata); + } if (ApiTypeHelper.isDefined(this.values)) { generator.writeKey("values"); generator.writeStartArray(); @@ -146,6 +150,7 @@ public String toString() { public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { private QueryRuleCriteriaType type; + @Nullable private String metadata; @Nullable @@ -160,9 +165,9 @@ public final Builder type(QueryRuleCriteriaType value) { } /** - * Required - API name: {@code metadata} + * API name: {@code metadata} */ - public final Builder metadata(String value) { + public final Builder metadata(@Nullable String value) { this.metadata = value; return this; } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRuleCriteriaType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRuleCriteriaType.java index 2a8155eb3..11d163d0e 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRuleCriteriaType.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRuleCriteriaType.java @@ -66,6 +66,8 @@ public enum QueryRuleCriteriaType implements JsonEnum { Gte("gte"), + Always("always"), + ; private final String jsonValue; diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/list/QueryRulesetListItem.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/list/QueryRulesetListItem.java index 32cacf1e8..2b31fa52d 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/list/QueryRulesetListItem.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/list/QueryRulesetListItem.java @@ -32,6 +32,7 @@ import jakarta.json.stream.JsonGenerator; import java.lang.Integer; import java.lang.String; +import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -63,14 +64,18 @@ public class QueryRulesetListItem implements JsonpSerializable { private final String rulesetId; - private final int rulesCount; + private final int ruleTotalCount; + + private final Map ruleCriteriaTypesCounts; // --------------------------------------------------------------------------------------------- private QueryRulesetListItem(Builder builder) { this.rulesetId = ApiTypeHelper.requireNonNull(builder.rulesetId, this, "rulesetId"); - this.rulesCount = ApiTypeHelper.requireNonNull(builder.rulesCount, this, "rulesCount"); + this.ruleTotalCount = ApiTypeHelper.requireNonNull(builder.ruleTotalCount, this, "ruleTotalCount"); + this.ruleCriteriaTypesCounts = ApiTypeHelper.unmodifiableRequired(builder.ruleCriteriaTypesCounts, this, + "ruleCriteriaTypesCounts"); } @@ -90,10 +95,19 @@ public final String rulesetId() { /** * Required - The number of rules associated with this ruleset *

- * API name: {@code rules_count} + * API name: {@code rule_total_count} */ - public final int rulesCount() { - return this.rulesCount; + public final int ruleTotalCount() { + return this.ruleTotalCount; + } + + /** + * Required - A map of criteria type to the number of rules of that type + *

+ * API name: {@code rule_criteria_types_counts} + */ + public final Map ruleCriteriaTypesCounts() { + return this.ruleCriteriaTypesCounts; } /** @@ -110,8 +124,20 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("ruleset_id"); generator.write(this.rulesetId); - generator.writeKey("rules_count"); - generator.write(this.rulesCount); + generator.writeKey("rule_total_count"); + generator.write(this.ruleTotalCount); + + if (ApiTypeHelper.isDefined(this.ruleCriteriaTypesCounts)) { + generator.writeKey("rule_criteria_types_counts"); + generator.writeStartObject(); + for (Map.Entry item0 : this.ruleCriteriaTypesCounts.entrySet()) { + generator.writeKey(item0.getKey()); + generator.write(item0.getValue()); + + } + generator.writeEnd(); + + } } @@ -131,7 +157,9 @@ public static class Builder extends WithJsonObjectBuilderBase ObjectBuilder { private String rulesetId; - private Integer rulesCount; + private Integer ruleTotalCount; + + private Map ruleCriteriaTypesCounts; /** * Required - Ruleset unique identifier @@ -146,10 +174,34 @@ public final Builder rulesetId(String value) { /** * Required - The number of rules associated with this ruleset *

- * API name: {@code rules_count} + * API name: {@code rule_total_count} + */ + public final Builder ruleTotalCount(int value) { + this.ruleTotalCount = value; + return this; + } + + /** + * Required - A map of criteria type to the number of rules of that type + *

+ * API name: {@code rule_criteria_types_counts} + *

+ * Adds all entries of map to ruleCriteriaTypesCounts. + */ + public final Builder ruleCriteriaTypesCounts(Map map) { + this.ruleCriteriaTypesCounts = _mapPutAll(this.ruleCriteriaTypesCounts, map); + return this; + } + + /** + * Required - A map of criteria type to the number of rules of that type + *

+ * API name: {@code rule_criteria_types_counts} + *

+ * Adds an entry to ruleCriteriaTypesCounts. */ - public final Builder rulesCount(int value) { - this.rulesCount = value; + public final Builder ruleCriteriaTypesCounts(String key, String value) { + this.ruleCriteriaTypesCounts = _mapPut(this.ruleCriteriaTypesCounts, key, value); return this; } @@ -182,7 +234,10 @@ public QueryRulesetListItem build() { protected static void setupQueryRulesetListItemDeserializer(ObjectDeserializer op) { op.add(Builder::rulesetId, JsonpDeserializer.stringDeserializer(), "ruleset_id"); - op.add(Builder::rulesCount, JsonpDeserializer.integerDeserializer(), "rules_count"); + op.add(Builder::ruleTotalCount, JsonpDeserializer.integerDeserializer(), "rule_total_count"); + op.add(Builder::ruleCriteriaTypesCounts, + JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), + "rule_criteria_types_counts"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/ElasticsearchSearchApplicationAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/ElasticsearchSearchApplicationAsyncClient.java index 60e770e46..0b7e599ee 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/ElasticsearchSearchApplicationAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/ElasticsearchSearchApplicationAsyncClient.java @@ -139,7 +139,7 @@ public final CompletableFuture deleteBehavior // ----- Endpoint: search_application.get /** - * Returns the details about a search application. + * Returns the details about a search application * * @see Documentation @@ -154,7 +154,7 @@ public CompletableFuture get(GetSearchApplicationR } /** - * Returns the details about a search application. + * Returns the details about a search application * * @param fn * a function that initializes a builder to create the @@ -330,7 +330,7 @@ public final CompletableFuture putBehavioralAnal // ----- Endpoint: search_application.search /** - * Perform a search against a search application + * Perform a search against a search application. * * @see Documentation @@ -342,13 +342,14 @@ public CompletableFuture> @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchApplicationSearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:search_application.search.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:search_application.search.Response.TDocument", + getDeserializer(tDocumentClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Perform a search against a search application + * Perform a search against a search application. * * @param fn * a function that initializes a builder to create the @@ -365,7 +366,7 @@ public final CompletableFutureDocumentation @@ -377,13 +378,14 @@ public CompletableFuture> @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchApplicationSearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:search_application.search.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:search_application.search.Response.TDocument", + getDeserializer(tDocumentType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); } /** - * Perform a search against a search application + * Perform a search against a search application. * * @param fn * a function that initializes a builder to create the diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/ElasticsearchSearchApplicationClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/ElasticsearchSearchApplicationClient.java index 56b722362..43e0cabcc 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/ElasticsearchSearchApplicationClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/ElasticsearchSearchApplicationClient.java @@ -143,7 +143,7 @@ public final DeleteBehavioralAnalyticsResponse deleteBehavioralAnalytics( // ----- Endpoint: search_application.get /** - * Returns the details about a search application. + * Returns the details about a search application * * @see Documentation @@ -159,7 +159,7 @@ public GetSearchApplicationResponse get(GetSearchApplicationRequest request) } /** - * Returns the details about a search application. + * Returns the details about a search application * * @param fn * a function that initializes a builder to create the @@ -340,7 +340,7 @@ public final PutBehavioralAnalyticsResponse putBehavioralAnalytics( // ----- Endpoint: search_application.search /** - * Perform a search against a search application + * Perform a search against a search application. * * @see Documentation @@ -352,13 +352,14 @@ public SearchApplicationSearchResponse search(SearchAppli @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchApplicationSearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:search_application.search.TDocument", getDeserializer(tDocumentClass)); + "co.elastic.clients:Deserializer:search_application.search.Response.TDocument", + getDeserializer(tDocumentClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Perform a search against a search application + * Perform a search against a search application. * * @param fn * a function that initializes a builder to create the @@ -375,7 +376,7 @@ public final SearchApplicationSearchResponse search( } /** - * Perform a search against a search application + * Perform a search against a search application. * * @see Documentation @@ -387,13 +388,14 @@ public SearchApplicationSearchResponse search(SearchAppli @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchApplicationSearchRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:search_application.search.TDocument", getDeserializer(tDocumentType)); + "co.elastic.clients:Deserializer:search_application.search.Response.TDocument", + getDeserializer(tDocumentType)); return this.transport.performRequest(request, endpoint, this.transportOptions); } /** - * Perform a search against a search application + * Perform a search against a search application. * * @param fn * a function that initializes a builder to create the diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/SearchApplicationSearchResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/SearchApplicationSearchResponse.java index 73b9b56cb..dd22a7643 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/SearchApplicationSearchResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/SearchApplicationSearchResponse.java @@ -112,8 +112,8 @@ public static JsonpDeserializer> _DESERIALIZER = JsonpDeserializer - .lazy(() -> createSearchApplicationSearchResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:search_application.search.TDocument"))); + .lazy(() -> createSearchApplicationSearchResponseDeserializer(new NamedDeserializer<>( + "co.elastic.clients:Deserializer:search_application.search.Response.TDocument"))); protected static void setupSearchApplicationSearchResponseDeserializer( ObjectDeserializer> op, diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ApiKey.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ApiKey.java index f0b08b58c..60ef53c24 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ApiKey.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ApiKey.java @@ -82,9 +82,15 @@ public class ApiKey implements JsonpSerializable { @Nullable private final String realm; + @Nullable + private final String realmType; + @Nullable private final String username; + @Nullable + private final String profileUid; + private final Map metadata; private final Map roleDescriptors; @@ -103,7 +109,9 @@ private ApiKey(Builder builder) { this.invalidated = builder.invalidated; this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); this.realm = builder.realm; + this.realmType = builder.realmType; this.username = builder.username; + this.profileUid = builder.profileUid; this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); this.roleDescriptors = ApiTypeHelper.unmodifiable(builder.roleDescriptors); this.limitedBy = ApiTypeHelper.unmodifiable(builder.limitedBy); @@ -174,6 +182,16 @@ public final String realm() { return this.realm; } + /** + * Realm type of the principal for which this API key was created + *

+ * API name: {@code realm_type} + */ + @Nullable + public final String realmType() { + return this.realmType; + } + /** * Principal for which this API key was created *

@@ -184,6 +202,17 @@ public final String username() { return this.username; } + /** + * The profile uid for the API key owner principal, if requested and if it + * exists + *

+ * API name: {@code profile_uid} + */ + @Nullable + public final String profileUid() { + return this.profileUid; + } + /** * Metadata of the API key *

@@ -259,11 +288,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("realm"); generator.write(this.realm); + } + if (this.realmType != null) { + generator.writeKey("realm_type"); + generator.write(this.realmType); + } if (this.username != null) { generator.writeKey("username"); generator.write(this.username); + } + if (this.profileUid != null) { + generator.writeKey("profile_uid"); + generator.write(this.profileUid); + } if (ApiTypeHelper.isDefined(this.metadata)) { generator.writeKey("metadata"); @@ -346,9 +385,15 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private String realm; + @Nullable + private String realmType; + @Nullable private String username; + @Nullable + private String profileUid; + @Nullable private Map metadata; @@ -422,6 +467,16 @@ public final Builder realm(@Nullable String value) { return this; } + /** + * Realm type of the principal for which this API key was created + *

+ * API name: {@code realm_type} + */ + public final Builder realmType(@Nullable String value) { + this.realmType = value; + return this; + } + /** * Principal for which this API key was created *

@@ -432,6 +487,17 @@ public final Builder username(@Nullable String value) { return this; } + /** + * The profile uid for the API key owner principal, if requested and if it + * exists + *

+ * API name: {@code profile_uid} + */ + public final Builder profileUid(@Nullable String value) { + this.profileUid = value; + return this; + } + /** * Metadata of the API key *

@@ -651,7 +717,9 @@ protected static void setupApiKeyDeserializer(ObjectDeserializer op.add(Builder::invalidated, JsonpDeserializer.booleanDeserializer(), "invalidated"); op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); op.add(Builder::realm, JsonpDeserializer.stringDeserializer(), "realm"); + op.add(Builder::realmType, JsonpDeserializer.stringDeserializer(), "realm_type"); op.add(Builder::username, JsonpDeserializer.stringDeserializer(), "username"); + op.add(Builder::profileUid, JsonpDeserializer.stringDeserializer(), "profile_uid"); op.add(Builder::metadata, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "metadata"); op.add(Builder::roleDescriptors, JsonpDeserializer.stringMapDeserializer(RoleDescriptor._DESERIALIZER), "role_descriptors"); diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClearApiKeyCacheRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClearApiKeyCacheRequest.java deleted file mode 100644 index 56f69b4e8..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClearApiKeyCacheRequest.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.security; - -import co.elastic.clients.elasticsearch._types.ErrorResponse; -import co.elastic.clients.elasticsearch._types.RequestBase; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.transport.Endpoint; -import co.elastic.clients.transport.endpoints.SimpleEndpoint; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import java.util.stream.Collectors; -import javax.annotation.Nullable; - -// typedef: security.clear_api_key_cache.Request - -/** - * Evicts a subset of all entries from the API key cache. The cache is also - * automatically cleared on state changes of the security index. - * - * @see API - * specification - */ - -public class ClearApiKeyCacheRequest extends RequestBase { - private final List ids; - - // --------------------------------------------------------------------------------------------- - - private ClearApiKeyCacheRequest(Builder builder) { - - this.ids = ApiTypeHelper.unmodifiableRequired(builder.ids, this, "ids"); - - } - - public static ClearApiKeyCacheRequest of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - Comma-separated list of API key IDs to evict from the API key - * cache. To evict all API keys, use *. Does not support other - * wildcard patterns. - *

- * API name: {@code ids} - */ - public final List ids() { - return this.ids; - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClearApiKeyCacheRequest}. - */ - - public static class Builder extends RequestBase.AbstractBuilder - implements - ObjectBuilder { - private List ids; - - /** - * Required - Comma-separated list of API key IDs to evict from the API key - * cache. To evict all API keys, use *. Does not support other - * wildcard patterns. - *

- * API name: {@code ids} - *

- * Adds all elements of list to ids. - */ - public final Builder ids(List list) { - this.ids = _listAddAll(this.ids, list); - return this; - } - - /** - * Required - Comma-separated list of API key IDs to evict from the API key - * cache. To evict all API keys, use *. Does not support other - * wildcard patterns. - *

- * API name: {@code ids} - *

- * Adds one or more values to ids. - */ - public final Builder ids(String value, String... values) { - this.ids = _listAdd(this.ids, value, values); - return this; - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClearApiKeyCacheRequest}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClearApiKeyCacheRequest build() { - _checkSingleUse(); - - return new ClearApiKeyCacheRequest(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Endpoint "{@code security.clear_api_key_cache}". - */ - public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( - "es/security.clear_api_key_cache", - - // Request method - request -> { - return "POST"; - - }, - - // Request path - request -> { - final int _ids = 1 << 0; - - int propsSet = 0; - - propsSet |= _ids; - - if (propsSet == (_ids)) { - StringBuilder buf = new StringBuilder(); - buf.append("/_security"); - buf.append("/api_key"); - buf.append("/"); - SimpleEndpoint.pathEncode(request.ids.stream().map(v -> v).collect(Collectors.joining(",")), buf); - buf.append("/_clear_cache"); - return buf.toString(); - } - throw SimpleEndpoint.noPathTemplateFound("path"); - - }, - - // Path parameters - request -> { - Map params = new HashMap<>(); - final int _ids = 1 << 0; - - int propsSet = 0; - - propsSet |= _ids; - - if (propsSet == (_ids)) { - params.put("ids", request.ids.stream().map(v -> v).collect(Collectors.joining(","))); - } - return params; - }, - - // Request parameters - request -> { - return Collections.emptyMap(); - - }, SimpleEndpoint.emptyMap(), false, ClearApiKeyCacheResponse._DESERIALIZER); -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClearApiKeyCacheResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClearApiKeyCacheResponse.java deleted file mode 100644 index 04fe93fed..000000000 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClearApiKeyCacheResponse.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Licensed to Elasticsearch B.V. under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch B.V. licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -//---------------------------------------------------- -// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. -//---------------------------------------------------- - -package co.elastic.clients.elasticsearch.security; - -import co.elastic.clients.elasticsearch._types.NodeStatistics; -import co.elastic.clients.json.JsonpDeserializable; -import co.elastic.clients.json.JsonpDeserializer; -import co.elastic.clients.json.JsonpMapper; -import co.elastic.clients.json.JsonpSerializable; -import co.elastic.clients.json.JsonpUtils; -import co.elastic.clients.json.ObjectBuilderDeserializer; -import co.elastic.clients.json.ObjectDeserializer; -import co.elastic.clients.util.ApiTypeHelper; -import co.elastic.clients.util.ObjectBuilder; -import co.elastic.clients.util.WithJsonObjectBuilderBase; -import jakarta.json.stream.JsonGenerator; -import java.lang.String; -import java.util.Map; -import java.util.Objects; -import java.util.function.Function; -import javax.annotation.Nullable; - -// typedef: security.clear_api_key_cache.Response - -/** - * - * @see API - * specification - */ -@JsonpDeserializable -public class ClearApiKeyCacheResponse implements JsonpSerializable { - private final NodeStatistics nodeStats; - - private final String clusterName; - - private final Map nodes; - - // --------------------------------------------------------------------------------------------- - - private ClearApiKeyCacheResponse(Builder builder) { - - this.nodeStats = ApiTypeHelper.requireNonNull(builder.nodeStats, this, "nodeStats"); - this.clusterName = ApiTypeHelper.requireNonNull(builder.clusterName, this, "clusterName"); - this.nodes = ApiTypeHelper.unmodifiableRequired(builder.nodes, this, "nodes"); - - } - - public static ClearApiKeyCacheResponse of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Required - API name: {@code _nodes} - */ - public final NodeStatistics nodeStats() { - return this.nodeStats; - } - - /** - * Required - API name: {@code cluster_name} - */ - public final String clusterName() { - return this.clusterName; - } - - /** - * Required - API name: {@code nodes} - */ - public final Map nodes() { - return this.nodes; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.writeKey("_nodes"); - this.nodeStats.serialize(generator, mapper); - - generator.writeKey("cluster_name"); - generator.write(this.clusterName); - - if (ApiTypeHelper.isDefined(this.nodes)) { - generator.writeKey("nodes"); - generator.writeStartObject(); - for (Map.Entry item0 : this.nodes.entrySet()) { - generator.writeKey(item0.getKey()); - item0.getValue().serialize(generator, mapper); - - } - generator.writeEnd(); - - } - - } - - @Override - public String toString() { - return JsonpUtils.toString(this); - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ClearApiKeyCacheResponse}. - */ - - public static class Builder extends WithJsonObjectBuilderBase - implements - ObjectBuilder { - private NodeStatistics nodeStats; - - private String clusterName; - - private Map nodes; - - /** - * Required - API name: {@code _nodes} - */ - public final Builder nodeStats(NodeStatistics value) { - this.nodeStats = value; - return this; - } - - /** - * Required - API name: {@code _nodes} - */ - public final Builder nodeStats(Function> fn) { - return this.nodeStats(fn.apply(new NodeStatistics.Builder()).build()); - } - - /** - * Required - API name: {@code cluster_name} - */ - public final Builder clusterName(String value) { - this.clusterName = value; - return this; - } - - /** - * Required - API name: {@code nodes} - *

- * Adds all entries of map to nodes. - */ - public final Builder nodes(Map map) { - this.nodes = _mapPutAll(this.nodes, map); - return this; - } - - /** - * Required - API name: {@code nodes} - *

- * Adds an entry to nodes. - */ - public final Builder nodes(String key, ClusterNode value) { - this.nodes = _mapPut(this.nodes, key, value); - return this; - } - - /** - * Required - API name: {@code nodes} - *

- * Adds an entry to nodes using a builder lambda. - */ - public final Builder nodes(String key, Function> fn) { - return nodes(key, fn.apply(new ClusterNode.Builder()).build()); - } - - @Override - protected Builder self() { - return this; - } - - /** - * Builds a {@link ClearApiKeyCacheResponse}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ClearApiKeyCacheResponse build() { - _checkSingleUse(); - - return new ClearApiKeyCacheResponse(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ClearApiKeyCacheResponse} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer - .lazy(Builder::new, ClearApiKeyCacheResponse::setupClearApiKeyCacheResponseDeserializer); - - protected static void setupClearApiKeyCacheResponseDeserializer( - ObjectDeserializer op) { - - op.add(Builder::nodeStats, NodeStatistics._DESERIALIZER, "_nodes"); - op.add(Builder::clusterName, JsonpDeserializer.stringDeserializer(), "cluster_name"); - op.add(Builder::nodes, JsonpDeserializer.stringMapDeserializer(ClusterNode._DESERIALIZER), "nodes"); - - } - -} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClusterPrivilege.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClusterPrivilege.java index d0fff2f06..794f8038b 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClusterPrivilege.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClusterPrivilege.java @@ -50,75 +50,55 @@ public enum ClusterPrivilege implements JsonEnum { CancelTask("cancel_task"), - CreateSnapshot("create_snapshot"), - - GrantApiKey("grant_api_key"), - Manage("manage"), ManageApiKey("manage_api_key"), - ManageCcr("manage_ccr"), + ManageBehavioralAnalytics("manage_behavioral_analytics"), ManageEnrich("manage_enrich"), - ManageIlm("manage_ilm"), - ManageIndexTemplates("manage_index_templates"), + ManageInference("manage_inference"), + ManageIngestPipelines("manage_ingest_pipelines"), ManageLogstashPipelines("manage_logstash_pipelines"), ManageMl("manage_ml"), - ManageOidc("manage_oidc"), - ManageOwnApiKey("manage_own_api_key"), ManagePipeline("manage_pipeline"), - ManageRollup("manage_rollup"), - - ManageSaml("manage_saml"), - - ManageSecurity("manage_security"), + ManageSearchApplication("manage_search_application"), - ManageServiceAccount("manage_service_account"), + ManageSearchQueryRules("manage_search_query_rules"), - ManageSlm("manage_slm"), + ManageSearchSynonyms("manage_search_synonyms"), - ManageToken("manage_token"), + ManageSecurity("manage_security"), ManageTransform("manage_transform"), - ManageUserProfile("manage_user_profile"), - - ManageWatcher("manage_watcher"), - Monitor("monitor"), - MonitorMl("monitor_ml"), - - MonitorRollup("monitor_rollup"), + MonitorEnrich("monitor_enrich"), - MonitorSnapshot("monitor_snapshot"), + MonitorInference("monitor_inference"), - MonitorTextStructure("monitor_text_structure"), + MonitorMl("monitor_ml"), MonitorTransform("monitor_transform"), - MonitorWatcher("monitor_watcher"), + None("none"), - ReadCcr("read_ccr"), - - ReadIlm("read_ilm"), + PostBehavioralAnalyticsEvent("post_behavioral_analytics_event"), ReadPipeline("read_pipeline"), - ReadSlm("read_slm"), - - TransportClient("transport_client"), + ReadSecurity("read_security"), ; diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ElasticsearchSecurityAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ElasticsearchSecurityAsyncClient.java index e86d803b1..d584bcb5b 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ElasticsearchSecurityAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ElasticsearchSecurityAsyncClient.java @@ -70,8 +70,12 @@ public ElasticsearchSecurityAsyncClient withTransportOptions(@Nullable Transport // ----- Endpoint: security.authenticate /** - * Enables authentication as a user and retrieve information about the - * authenticated user. + * Enables you to submit a request with a basic auth header to authenticate a + * user and retrieve information about the authenticated user. A successful call + * returns a JSON structure that shows user information such as their username, + * the roles that are assigned to the user, any assigned metadata, and + * information about the realms that authenticated and authorized the user. If + * the user cannot be authenticated, this API returns a 401 status code. * * @see Documentation @@ -85,7 +89,11 @@ public CompletableFuture authenticate() { // ----- Endpoint: security.create_api_key /** - * Creates an API key for access without requiring basic authentication. + * Creates an API key for access without requiring basic authentication. A + * successful request returns a JSON structure that contains the API key, its + * unique id, and its name. If applicable, it also returns expiration + * information for the API key in milliseconds. NOTE: By default, API keys never + * expire. You can specify expiration information when you create the API keys. * * @see Documentation @@ -100,7 +108,11 @@ public CompletableFuture createApiKey(CreateApiKeyRequest } /** - * Creates an API key for access without requiring basic authentication. + * Creates an API key for access without requiring basic authentication. A + * successful request returns a JSON structure that contains the API key, its + * unique id, and its name. If applicable, it also returns expiration + * information for the API key in milliseconds. NOTE: By default, API keys never + * expire. You can specify expiration information when you create the API keys. * * @param fn * a function that initializes a builder to create the @@ -116,7 +128,11 @@ public final CompletableFuture createApiKey( } /** - * Creates an API key for access without requiring basic authentication. + * Creates an API key for access without requiring basic authentication. A + * successful request returns a JSON structure that contains the API key, its + * unique id, and its name. If applicable, it also returns expiration + * information for the API key in milliseconds. NOTE: By default, API keys never + * expire. You can specify expiration information when you create the API keys. * * @see Documentation @@ -131,7 +147,12 @@ public CompletableFuture createApiKey() { // ----- Endpoint: security.get_api_key /** - * Retrieves information for one or more API keys. + * Retrieves information for one or more API keys. NOTE: If you have only the + * manage_own_api_key privilege, this API returns only the API keys + * that you own. If you have read_security, + * manage_api_key or greater privileges (including + * manage_security), this API returns all API keys regardless of + * ownership. * * @see Documentation @@ -146,7 +167,12 @@ public CompletableFuture getApiKey(GetApiKeyRequest request) } /** - * Retrieves information for one or more API keys. + * Retrieves information for one or more API keys. NOTE: If you have only the + * manage_own_api_key privilege, this API returns only the API keys + * that you own. If you have read_security, + * manage_api_key or greater privileges (including + * manage_security), this API returns all API keys regardless of + * ownership. * * @param fn * a function that initializes a builder to create the @@ -162,7 +188,12 @@ public final CompletableFuture getApiKey( } /** - * Retrieves information for one or more API keys. + * Retrieves information for one or more API keys. NOTE: If you have only the + * manage_own_api_key privilege, this API returns only the API keys + * that you own. If you have read_security, + * manage_api_key or greater privileges (including + * manage_security), this API returns all API keys regardless of + * ownership. * * @see Documentation @@ -223,8 +254,19 @@ public CompletableFuture hasPrivileges() { // ----- Endpoint: security.invalidate_api_key /** - * Invalidates one or more API keys. - * + * Invalidates one or more API keys. The manage_api_key privilege + * allows deleting any API keys. The manage_own_api_key only allows + * deleting API keys that are owned by the user. In addition, with the + * manage_own_api_key privilege, an invalidation request must be + * issued in one of the three formats: + *

+ * * @see Documentation * on elastic.co @@ -238,8 +280,19 @@ public CompletableFuture invalidateApiKey(InvalidateAp } /** - * Invalidates one or more API keys. - * + * Invalidates one or more API keys. The manage_api_key privilege + * allows deleting any API keys. The manage_own_api_key only allows + * deleting API keys that are owned by the user. In addition, with the + * manage_own_api_key privilege, an invalidation request must be + * issued in one of the three formats: + *
    + *
  • Set the parameter owner=true.
  • + *
  • Or, set both username and realm_name to match + * the user’s identity.
  • + *
  • Or, if the request is issued by an API key, i.e. an API key invalidates + * itself, specify its ID in the ids field.
  • + *
+ * * @param fn * a function that initializes a builder to create the * {@link InvalidateApiKeyRequest} @@ -254,8 +307,19 @@ public final CompletableFuture invalidateApiKey( } /** - * Invalidates one or more API keys. - * + * Invalidates one or more API keys. The manage_api_key privilege + * allows deleting any API keys. The manage_own_api_key only allows + * deleting API keys that are owned by the user. In addition, with the + * manage_own_api_key privilege, an invalidation request must be + * issued in one of the three formats: + *
    + *
  • Set the parameter owner=true.
  • + *
  • Or, set both username and realm_name to match + * the user’s identity.
  • + *
  • Or, if the request is issued by an API key, i.e. an API key invalidates + * itself, specify its ID in the ids field.
  • + *
+ * * @see Documentation * on elastic.co @@ -269,7 +333,8 @@ public CompletableFuture invalidateApiKey() { // ----- Endpoint: security.query_api_keys /** - * Retrieves information for API keys using a subset of query DSL + * Retrieves information for API keys in a paginated manner. You can optionally + * filter the results with a query. * * @see Documentation @@ -284,7 +349,8 @@ public CompletableFuture queryApiKeys(QueryApiKeysRequest } /** - * Retrieves information for API keys using a subset of query DSL + * Retrieves information for API keys in a paginated manner. You can optionally + * filter the results with a query. * * @param fn * a function that initializes a builder to create the @@ -300,7 +366,8 @@ public final CompletableFuture queryApiKeys( } /** - * Retrieves information for API keys using a subset of query DSL + * Retrieves information for API keys in a paginated manner. You can optionally + * filter the results with a query. * * @see Documentation @@ -315,7 +382,24 @@ public CompletableFuture queryApiKeys() { // ----- Endpoint: security.update_api_key /** - * Updates attributes of an existing API key. + * Updates attributes of an existing API key. Users can only update API keys + * that they created or that were granted to them. Use this API to update API + * keys created by the create API Key or grant API Key APIs. If you need to + * apply the same update to many API keys, you can use bulk update API Keys to + * reduce overhead. It’s not possible to update expired API keys, or API keys + * that have been invalidated by invalidate API Key. This API supports updates + * to an API key’s access scope and metadata. The access scope of an API key is + * derived from the role_descriptors you specify in the request, + * and a snapshot of the owner user’s permissions at the time of the request. + * The snapshot of the owner’s permissions is updated automatically on every + * call. If you don’t specify role_descriptors in the request, a + * call to this API might still change the API key’s access scope. This change + * can occur if the owner user’s permissions have changed since the API key was + * created or last modified. To update another user’s API key, use the + * run_as feature to submit a request on behalf of another user. + * IMPORTANT: It’s not possible to use an API key as the authentication + * credential for this API. To update an API key, the owner user’s credentials + * are required. * * @see Documentation @@ -330,7 +414,24 @@ public CompletableFuture updateApiKey(UpdateApiKeyRequest } /** - * Updates attributes of an existing API key. + * Updates attributes of an existing API key. Users can only update API keys + * that they created or that were granted to them. Use this API to update API + * keys created by the create API Key or grant API Key APIs. If you need to + * apply the same update to many API keys, you can use bulk update API Keys to + * reduce overhead. It’s not possible to update expired API keys, or API keys + * that have been invalidated by invalidate API Key. This API supports updates + * to an API key’s access scope and metadata. The access scope of an API key is + * derived from the role_descriptors you specify in the request, + * and a snapshot of the owner user’s permissions at the time of the request. + * The snapshot of the owner’s permissions is updated automatically on every + * call. If you don’t specify role_descriptors in the request, a + * call to this API might still change the API key’s access scope. This change + * can occur if the owner user’s permissions have changed since the API key was + * created or last modified. To update another user’s API key, use the + * run_as feature to submit a request on behalf of another user. + * IMPORTANT: It’s not possible to use an API key as the authentication + * credential for this API. To update an API key, the owner user’s credentials + * are required. * * @param fn * a function that initializes a builder to create the diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ElasticsearchSecurityClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ElasticsearchSecurityClient.java index b7e4d4b92..1684239c2 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ElasticsearchSecurityClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ElasticsearchSecurityClient.java @@ -68,8 +68,12 @@ public ElasticsearchSecurityClient withTransportOptions(@Nullable TransportOptio // ----- Endpoint: security.authenticate /** - * Enables authentication as a user and retrieve information about the - * authenticated user. + * Enables you to submit a request with a basic auth header to authenticate a + * user and retrieve information about the authenticated user. A successful call + * returns a JSON structure that shows user information such as their username, + * the roles that are assigned to the user, any assigned metadata, and + * information about the realms that authenticated and authorized the user. If + * the user cannot be authenticated, this API returns a 401 status code. * * @see Documentation @@ -83,7 +87,11 @@ public AuthenticateResponse authenticate() throws IOException, ElasticsearchExce // ----- Endpoint: security.create_api_key /** - * Creates an API key for access without requiring basic authentication. + * Creates an API key for access without requiring basic authentication. A + * successful request returns a JSON structure that contains the API key, its + * unique id, and its name. If applicable, it also returns expiration + * information for the API key in milliseconds. NOTE: By default, API keys never + * expire. You can specify expiration information when you create the API keys. * * @see Documentation @@ -98,7 +106,11 @@ public CreateApiKeyResponse createApiKey(CreateApiKeyRequest request) throws IOE } /** - * Creates an API key for access without requiring basic authentication. + * Creates an API key for access without requiring basic authentication. A + * successful request returns a JSON structure that contains the API key, its + * unique id, and its name. If applicable, it also returns expiration + * information for the API key in milliseconds. NOTE: By default, API keys never + * expire. You can specify expiration information when you create the API keys. * * @param fn * a function that initializes a builder to create the @@ -115,7 +127,11 @@ public final CreateApiKeyResponse createApiKey( } /** - * Creates an API key for access without requiring basic authentication. + * Creates an API key for access without requiring basic authentication. A + * successful request returns a JSON structure that contains the API key, its + * unique id, and its name. If applicable, it also returns expiration + * information for the API key in milliseconds. NOTE: By default, API keys never + * expire. You can specify expiration information when you create the API keys. * * @see Documentation @@ -130,7 +146,12 @@ public CreateApiKeyResponse createApiKey() throws IOException, ElasticsearchExce // ----- Endpoint: security.get_api_key /** - * Retrieves information for one or more API keys. + * Retrieves information for one or more API keys. NOTE: If you have only the + * manage_own_api_key privilege, this API returns only the API keys + * that you own. If you have read_security, + * manage_api_key or greater privileges (including + * manage_security), this API returns all API keys regardless of + * ownership. * * @see Documentation @@ -145,7 +166,12 @@ public GetApiKeyResponse getApiKey(GetApiKeyRequest request) throws IOException, } /** - * Retrieves information for one or more API keys. + * Retrieves information for one or more API keys. NOTE: If you have only the + * manage_own_api_key privilege, this API returns only the API keys + * that you own. If you have read_security, + * manage_api_key or greater privileges (including + * manage_security), this API returns all API keys regardless of + * ownership. * * @param fn * a function that initializes a builder to create the @@ -161,7 +187,12 @@ public final GetApiKeyResponse getApiKey(Functionmanage_own_api_key privilege, this API returns only the API keys + * that you own. If you have read_security, + * manage_api_key or greater privileges (including + * manage_security), this API returns all API keys regardless of + * ownership. * * @see Documentation @@ -224,8 +255,19 @@ public HasPrivilegesResponse hasPrivileges() throws IOException, ElasticsearchEx // ----- Endpoint: security.invalidate_api_key /** - * Invalidates one or more API keys. - * + * Invalidates one or more API keys. The manage_api_key privilege + * allows deleting any API keys. The manage_own_api_key only allows + * deleting API keys that are owned by the user. In addition, with the + * manage_own_api_key privilege, an invalidation request must be + * issued in one of the three formats: + *
    + *
  • Set the parameter owner=true.
  • + *
  • Or, set both username and realm_name to match + * the user’s identity.
  • + *
  • Or, if the request is issued by an API key, i.e. an API key invalidates + * itself, specify its ID in the ids field.
  • + *
+ * * @see
Documentation * on elastic.co @@ -240,8 +282,19 @@ public InvalidateApiKeyResponse invalidateApiKey(InvalidateApiKeyRequest request } /** - * Invalidates one or more API keys. - * + * Invalidates one or more API keys. The manage_api_key privilege + * allows deleting any API keys. The manage_own_api_key only allows + * deleting API keys that are owned by the user. In addition, with the + * manage_own_api_key privilege, an invalidation request must be + * issued in one of the three formats: + *
    + *
  • Set the parameter owner=true.
  • + *
  • Or, set both username and realm_name to match + * the user’s identity.
  • + *
  • Or, if the request is issued by an API key, i.e. an API key invalidates + * itself, specify its ID in the ids field.
  • + *
+ * * @param fn * a function that initializes a builder to create the * {@link InvalidateApiKeyRequest} @@ -257,8 +310,19 @@ public final InvalidateApiKeyResponse invalidateApiKey( } /** - * Invalidates one or more API keys. - * + * Invalidates one or more API keys. The manage_api_key privilege + * allows deleting any API keys. The manage_own_api_key only allows + * deleting API keys that are owned by the user. In addition, with the + * manage_own_api_key privilege, an invalidation request must be + * issued in one of the three formats: + *
    + *
  • Set the parameter owner=true.
  • + *
  • Or, set both username and realm_name to match + * the user’s identity.
  • + *
  • Or, if the request is issued by an API key, i.e. an API key invalidates + * itself, specify its ID in the ids field.
  • + *
+ * * @see Documentation * on elastic.co @@ -272,7 +336,8 @@ public InvalidateApiKeyResponse invalidateApiKey() throws IOException, Elasticse // ----- Endpoint: security.query_api_keys /** - * Retrieves information for API keys using a subset of query DSL + * Retrieves information for API keys in a paginated manner. You can optionally + * filter the results with a query. * * @see Documentation @@ -287,7 +352,8 @@ public QueryApiKeysResponse queryApiKeys(QueryApiKeysRequest request) throws IOE } /** - * Retrieves information for API keys using a subset of query DSL + * Retrieves information for API keys in a paginated manner. You can optionally + * filter the results with a query. * * @param fn * a function that initializes a builder to create the @@ -304,7 +370,8 @@ public final QueryApiKeysResponse queryApiKeys( } /** - * Retrieves information for API keys using a subset of query DSL + * Retrieves information for API keys in a paginated manner. You can optionally + * filter the results with a query. * * @see Documentation @@ -319,7 +386,24 @@ public QueryApiKeysResponse queryApiKeys() throws IOException, ElasticsearchExce // ----- Endpoint: security.update_api_key /** - * Updates attributes of an existing API key. + * Updates attributes of an existing API key. Users can only update API keys + * that they created or that were granted to them. Use this API to update API + * keys created by the create API Key or grant API Key APIs. If you need to + * apply the same update to many API keys, you can use bulk update API Keys to + * reduce overhead. It’s not possible to update expired API keys, or API keys + * that have been invalidated by invalidate API Key. This API supports updates + * to an API key’s access scope and metadata. The access scope of an API key is + * derived from the role_descriptors you specify in the request, + * and a snapshot of the owner user’s permissions at the time of the request. + * The snapshot of the owner’s permissions is updated automatically on every + * call. If you don’t specify role_descriptors in the request, a + * call to this API might still change the API key’s access scope. This change + * can occur if the owner user’s permissions have changed since the API key was + * created or last modified. To update another user’s API key, use the + * run_as feature to submit a request on behalf of another user. + * IMPORTANT: It’s not possible to use an API key as the authentication + * credential for this API. To update an API key, the owner user’s credentials + * are required. * * @see Documentation @@ -334,7 +418,24 @@ public UpdateApiKeyResponse updateApiKey(UpdateApiKeyRequest request) throws IOE } /** - * Updates attributes of an existing API key. + * Updates attributes of an existing API key. Users can only update API keys + * that they created or that were granted to them. Use this API to update API + * keys created by the create API Key or grant API Key APIs. If you need to + * apply the same update to many API keys, you can use bulk update API Keys to + * reduce overhead. It’s not possible to update expired API keys, or API keys + * that have been invalidated by invalidate API Key. This API supports updates + * to an API key’s access scope and metadata. The access scope of an API key is + * derived from the role_descriptors you specify in the request, + * and a snapshot of the owner user’s permissions at the time of the request. + * The snapshot of the owner’s permissions is updated automatically on every + * call. If you don’t specify role_descriptors in the request, a + * call to this API might still change the API key’s access scope. This change + * can occur if the owner user’s permissions have changed since the API key was + * created or last modified. To update another user’s API key, use the + * run_as feature to submit a request on behalf of another user. + * IMPORTANT: It’s not possible to use an API key as the authentication + * credential for this API. To update an API key, the owner user’s credentials + * are required. * * @param fn * a function that initializes a builder to create the diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/GetApiKeyRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/GetApiKeyRequest.java index 4c2b575e8..be99892a0 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/GetApiKeyRequest.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/GetApiKeyRequest.java @@ -89,6 +89,9 @@ public class GetApiKeyRequest extends RequestBase { @Nullable private final Boolean withLimitedBy; + @Nullable + private final Boolean withProfileUid; + // --------------------------------------------------------------------------------------------- private GetApiKeyRequest(Builder builder) { @@ -100,6 +103,7 @@ private GetApiKeyRequest(Builder builder) { this.realmName = builder.realmName; this.username = builder.username; this.withLimitedBy = builder.withLimitedBy; + this.withProfileUid = builder.withProfileUid; } @@ -194,6 +198,17 @@ public final Boolean withLimitedBy() { return this.withLimitedBy; } + /** + * Determines whether to also retrieve the profile uid, for the API key owner + * principal, if it exists. + *

+ * API name: {@code with_profile_uid} + */ + @Nullable + public final Boolean withProfileUid() { + return this.withProfileUid; + } + // --------------------------------------------------------------------------------------------- /** @@ -224,6 +239,9 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private Boolean withLimitedBy; + @Nullable + private Boolean withProfileUid; + /** * A boolean flag that can be used to query API keys that are currently active. * An API key is considered active if it is neither invalidated, nor expired at @@ -311,6 +329,17 @@ public final Builder withLimitedBy(@Nullable Boolean value) { return this; } + /** + * Determines whether to also retrieve the profile uid, for the API key owner + * principal, if it exists. + *

+ * API name: {@code with_profile_uid} + */ + public final Builder withProfileUid(@Nullable Boolean value) { + this.withProfileUid = value; + return this; + } + @Override protected Builder self() { return this; @@ -372,6 +401,9 @@ public GetApiKeyRequest build() { if (request.realmName != null) { params.put("realm_name", request.realmName); } + if (request.withProfileUid != null) { + params.put("with_profile_uid", String.valueOf(request.withProfileUid)); + } if (request.username != null) { params.put("username", request.username); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/IndexPrivilege.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/IndexPrivilege.java index 4394e1bd7..f669d0ecf 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/IndexPrivilege.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/IndexPrivilege.java @@ -45,8 +45,6 @@ */ @JsonpDeserializable public enum IndexPrivilege implements JsonEnum { - None("none"), - All("all"), AutoConfigure("auto_configure"), @@ -67,17 +65,13 @@ public enum IndexPrivilege implements JsonEnum { Manage("manage"), - ManageFollowIndex("manage_follow_index"), - - ManageIlm("manage_ilm"), - - ManageLeaderIndex("manage_leader_index"), + ManageDataStreamLifecycle("manage_data_stream_lifecycle"), Monitor("monitor"), - Read("read"), + None("none"), - ReadCrossCluster("read_cross_cluster"), + Read("read"), ViewIndexMetadata("view_index_metadata"), diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/IndicesPrivileges.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/IndicesPrivileges.java index 01324a6f2..280ad829e 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/IndicesPrivileges.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/IndicesPrivileges.java @@ -31,7 +31,6 @@ import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; -import java.lang.Boolean; import java.lang.String; import java.util.List; import java.util.Objects; @@ -73,9 +72,6 @@ public class IndicesPrivileges implements JsonpSerializable { @Nullable private final Query query; - @Nullable - private final Boolean allowRestrictedIndices; - // --------------------------------------------------------------------------------------------- private IndicesPrivileges(Builder builder) { @@ -84,7 +80,6 @@ private IndicesPrivileges(Builder builder) { this.names = ApiTypeHelper.unmodifiableRequired(builder.names, this, "names"); this.privileges = ApiTypeHelper.unmodifiableRequired(builder.privileges, this, "privileges"); this.query = builder.query; - this.allowRestrictedIndices = builder.allowRestrictedIndices; } @@ -136,21 +131,6 @@ public final Query query() { return this.query; } - /** - * Set to true if using wildcard or regular expressions for - * patterns that cover restricted indices. Implicitly, restricted indices have - * limited privileges that can cause pattern tests to fail. If restricted - * indices are explicitly included in the names list, Elasticsearch - * checks privileges against these indices regardless of the value set for - * allow_restricted_indices. - *

- * API name: {@code allow_restricted_indices} - */ - @Nullable - public final Boolean allowRestrictedIndices() { - return this.allowRestrictedIndices; - } - /** * Serialize this object to JSON. */ @@ -192,11 +172,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(JsonpUtils.toJsonString(this.query, mapper)); } - if (this.allowRestrictedIndices != null) { - generator.writeKey("allow_restricted_indices"); - generator.write(this.allowRestrictedIndices); - - } } @@ -222,9 +197,6 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private Query query; - @Nullable - private Boolean allowRestrictedIndices; - /** * The document fields that the owners of the role have read access to. *

@@ -323,21 +295,6 @@ public final Builder query(Function> fn) { return this.query(fn.apply(new Query.Builder()).build()); } - /** - * Set to true if using wildcard or regular expressions for - * patterns that cover restricted indices. Implicitly, restricted indices have - * limited privileges that can cause pattern tests to fail. If restricted - * indices are explicitly included in the names list, Elasticsearch - * checks privileges against these indices regardless of the value set for - * allow_restricted_indices. - *

- * API name: {@code allow_restricted_indices} - */ - public final Builder allowRestrictedIndices(@Nullable Boolean value) { - this.allowRestrictedIndices = value; - return this; - } - @Override protected Builder self() { return this; @@ -371,7 +328,6 @@ protected static void setupIndicesPrivilegesDeserializer(ObjectDeserializer aggregations; + @Nullable private final Integer from; @Nullable - private final Query query; + private final ApiKeyQuery query; private final List searchAfter; @@ -88,16 +92,21 @@ public class QueryApiKeysRequest extends RequestBase implements JsonpSerializabl @Nullable private final Boolean withLimitedBy; + @Nullable + private final Boolean withProfileUid; + // --------------------------------------------------------------------------------------------- private QueryApiKeysRequest(Builder builder) { + this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations); this.from = builder.from; this.query = builder.query; this.searchAfter = ApiTypeHelper.unmodifiable(builder.searchAfter); this.size = builder.size; this.sort = ApiTypeHelper.unmodifiable(builder.sort); this.withLimitedBy = builder.withLimitedBy; + this.withProfileUid = builder.withProfileUid; } @@ -105,6 +114,22 @@ public static QueryApiKeysRequest of(Functionterms, range, date_range, + * missing, cardinality, value_count, + * composite, filter, and filters. + * Additionally, aggregations only run over the same subset of fields that query + * works with. + *

+ * API name: {@code aggregations} + */ + public final Map aggregations() { + return this.aggregations; + } + /** * Starting document offset. By default, you cannot page through more than * 10,000 hits using the from and size parameters. To page through more hits, @@ -118,16 +143,22 @@ public final Integer from() { } /** - * A query to filter which API keys to return. The query supports a subset of - * query types, including match_all, bool, - * term, terms, ids, prefix, - * wildcard, and range. You can query all public - * information associated with an API key. + * A query to filter which API keys to return. If the query parameter is + * missing, it is equivalent to a match_all query. The query + * supports a subset of query types, including match_all, + * bool, term, terms, match, + * ids, prefix, wildcard, + * exists, range, and + * simple_query_string. You can query the following public + * information associated with an API key: id, type, + * name, creation, expiration, + * invalidated, invalidation, username, + * realm, and metadata. *

* API name: {@code query} */ @Nullable - public final Query query() { + public final ApiKeyQuery query() { return this.query; } @@ -175,6 +206,17 @@ public final Boolean withLimitedBy() { return this.withLimitedBy; } + /** + * Determines whether to also retrieve the profile uid, for the API key owner + * principal, if it exists. + *

+ * API name: {@code with_profile_uid} + */ + @Nullable + public final Boolean withProfileUid() { + return this.withProfileUid; + } + /** * Serialize this object to JSON. */ @@ -186,6 +228,17 @@ public void serialize(JsonGenerator generator, JsonpMapper mapper) { protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + if (ApiTypeHelper.isDefined(this.aggregations)) { + generator.writeKey("aggregations"); + generator.writeStartObject(); + for (Map.Entry item0 : this.aggregations.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } if (this.from != null) { generator.writeKey("from"); generator.write(this.from); @@ -233,11 +286,14 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private Map aggregations; + @Nullable private Integer from; @Nullable - private Query query; + private ApiKeyQuery query; @Nullable private List searchAfter; @@ -251,6 +307,66 @@ public static class Builder extends RequestBase.AbstractBuilder @Nullable private Boolean withLimitedBy; + @Nullable + private Boolean withProfileUid; + + /** + * Any aggregations to run over the corpus of returned API keys. Aggregations + * and queries work together. Aggregations are computed only on the API keys + * that match the query. This supports only a subset of aggregation types, + * namely: terms, range, date_range, + * missing, cardinality, value_count, + * composite, filter, and filters. + * Additionally, aggregations only run over the same subset of fields that query + * works with. + *

+ * API name: {@code aggregations} + *

+ * Adds all entries of map to aggregations. + */ + public final Builder aggregations(Map map) { + this.aggregations = _mapPutAll(this.aggregations, map); + return this; + } + + /** + * Any aggregations to run over the corpus of returned API keys. Aggregations + * and queries work together. Aggregations are computed only on the API keys + * that match the query. This supports only a subset of aggregation types, + * namely: terms, range, date_range, + * missing, cardinality, value_count, + * composite, filter, and filters. + * Additionally, aggregations only run over the same subset of fields that query + * works with. + *

+ * API name: {@code aggregations} + *

+ * Adds an entry to aggregations. + */ + public final Builder aggregations(String key, ApiKeyAggregation value) { + this.aggregations = _mapPut(this.aggregations, key, value); + return this; + } + + /** + * Any aggregations to run over the corpus of returned API keys. Aggregations + * and queries work together. Aggregations are computed only on the API keys + * that match the query. This supports only a subset of aggregation types, + * namely: terms, range, date_range, + * missing, cardinality, value_count, + * composite, filter, and filters. + * Additionally, aggregations only run over the same subset of fields that query + * works with. + *

+ * API name: {@code aggregations} + *

+ * Adds an entry to aggregations using a builder lambda. + */ + public final Builder aggregations(String key, + Function> fn) { + return aggregations(key, fn.apply(new ApiKeyAggregation.Builder()).build()); + } + /** * Starting document offset. By default, you cannot page through more than * 10,000 hits using the from and size parameters. To page through more hits, @@ -264,30 +380,42 @@ public final Builder from(@Nullable Integer value) { } /** - * A query to filter which API keys to return. The query supports a subset of - * query types, including match_all, bool, - * term, terms, ids, prefix, - * wildcard, and range. You can query all public - * information associated with an API key. + * A query to filter which API keys to return. If the query parameter is + * missing, it is equivalent to a match_all query. The query + * supports a subset of query types, including match_all, + * bool, term, terms, match, + * ids, prefix, wildcard, + * exists, range, and + * simple_query_string. You can query the following public + * information associated with an API key: id, type, + * name, creation, expiration, + * invalidated, invalidation, username, + * realm, and metadata. *

* API name: {@code query} */ - public final Builder query(@Nullable Query value) { + public final Builder query(@Nullable ApiKeyQuery value) { this.query = value; return this; } /** - * A query to filter which API keys to return. The query supports a subset of - * query types, including match_all, bool, - * term, terms, ids, prefix, - * wildcard, and range. You can query all public - * information associated with an API key. + * A query to filter which API keys to return. If the query parameter is + * missing, it is equivalent to a match_all query. The query + * supports a subset of query types, including match_all, + * bool, term, terms, match, + * ids, prefix, wildcard, + * exists, range, and + * simple_query_string. You can query the following public + * information associated with an API key: id, type, + * name, creation, expiration, + * invalidated, invalidation, username, + * realm, and metadata. *

* API name: {@code query} */ - public final Builder query(Function> fn) { - return this.query(fn.apply(new Query.Builder()).build()); + public final Builder query(Function> fn) { + return this.query(fn.apply(new ApiKeyQuery.Builder()).build()); } /** @@ -458,6 +586,17 @@ public final Builder withLimitedBy(@Nullable Boolean value) { return this; } + /** + * Determines whether to also retrieve the profile uid, for the API key owner + * principal, if it exists. + *

+ * API name: {@code with_profile_uid} + */ + public final Builder withProfileUid(@Nullable Boolean value) { + this.withProfileUid = value; + return this; + } + @Override protected Builder self() { return this; @@ -486,8 +625,10 @@ public QueryApiKeysRequest build() { protected static void setupQueryApiKeysRequestDeserializer(ObjectDeserializer op) { + op.add(Builder::aggregations, JsonpDeserializer.stringMapDeserializer(ApiKeyAggregation._DESERIALIZER), + "aggregations", "aggs"); op.add(Builder::from, JsonpDeserializer.integerDeserializer(), "from"); - op.add(Builder::query, Query._DESERIALIZER, "query"); + op.add(Builder::query, ApiKeyQuery._DESERIALIZER, "query"); op.add(Builder::searchAfter, JsonpDeserializer.arrayDeserializer(FieldValue._DESERIALIZER), "search_after"); op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); op.add(Builder::sort, JsonpDeserializer.arrayDeserializer(SortOptions._DESERIALIZER), "sort"); @@ -522,6 +663,10 @@ protected static void setupQueryApiKeysRequestDeserializer(ObjectDeserializer { Map params = new HashMap<>(); + params.put("typed_keys", "true"); + if (request.withProfileUid != null) { + params.put("with_profile_uid", String.valueOf(request.withProfileUid)); + } if (request.withLimitedBy != null) { params.put("with_limited_by", String.valueOf(request.withLimitedBy)); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/QueryApiKeysResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/QueryApiKeysResponse.java index 264a0df97..28e720cb3 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/QueryApiKeysResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/QueryApiKeysResponse.java @@ -19,6 +19,8 @@ package co.elastic.clients.elasticsearch.security; +import co.elastic.clients.elasticsearch.security.query_api_keys.ApiKeyAggregate; +import co.elastic.clients.json.ExternallyTaggedUnion; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -31,7 +33,9 @@ import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; import java.lang.Integer; +import java.lang.String; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.function.Function; import javax.annotation.Nullable; @@ -67,6 +71,8 @@ public class QueryApiKeysResponse implements JsonpSerializable { private final List apiKeys; + private final Map aggregations; + // --------------------------------------------------------------------------------------------- private QueryApiKeysResponse(Builder builder) { @@ -74,6 +80,7 @@ private QueryApiKeysResponse(Builder builder) { this.total = ApiTypeHelper.requireNonNull(builder.total, this, "total"); this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); this.apiKeys = ApiTypeHelper.unmodifiableRequired(builder.apiKeys, this, "apiKeys"); + this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations); } @@ -108,6 +115,15 @@ public final List apiKeys() { return this.apiKeys; } + /** + * The aggregations result, if requested. + *

+ * API name: {@code aggregations} + */ + public final Map aggregations() { + return this.aggregations; + } + /** * Serialize this object to JSON. */ @@ -135,6 +151,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } + if (ApiTypeHelper.isDefined(this.aggregations)) { + generator.writeKey("aggregations"); + ExternallyTaggedUnion.serializeTypedKeys(this.aggregations, generator, mapper); + + } } @@ -158,6 +179,9 @@ public static class Builder extends WithJsonObjectBuilderBase private List apiKeys; + @Nullable + private Map aggregations; + /** * Required - The total number of API keys found. *

@@ -213,6 +237,42 @@ public final Builder apiKeys(Function> fn) return apiKeys(fn.apply(new ApiKey.Builder()).build()); } + /** + * The aggregations result, if requested. + *

+ * API name: {@code aggregations} + *

+ * Adds all entries of map to aggregations. + */ + public final Builder aggregations(Map map) { + this.aggregations = _mapPutAll(this.aggregations, map); + return this; + } + + /** + * The aggregations result, if requested. + *

+ * API name: {@code aggregations} + *

+ * Adds an entry to aggregations. + */ + public final Builder aggregations(String key, ApiKeyAggregate value) { + this.aggregations = _mapPut(this.aggregations, key, value); + return this; + } + + /** + * The aggregations result, if requested. + *

+ * API name: {@code aggregations} + *

+ * Adds an entry to aggregations using a builder lambda. + */ + public final Builder aggregations(String key, + Function> fn) { + return aggregations(key, fn.apply(new ApiKeyAggregate.Builder()).build()); + } + @Override protected Builder self() { return this; @@ -244,6 +304,7 @@ protected static void setupQueryApiKeysResponseDeserializer(ObjectDeserializerAPI + * specification + */ + +public class ApiKeyAggregate implements OpenTaggedUnion, JsonpSerializable { + + /** + * {@link ApiKeyAggregate} variant kinds. + * + * @see API + * specification + */ + + public enum Kind implements JsonEnum { + Cardinality("cardinality"), + + Composite("composite"), + + DateRange("date_range"), + + Dterms("dterms"), + + Filter("filter"), + + Filters("filters"), + + Lterms("lterms"), + + Missing("missing"), + + MultiTerms("multi_terms"), + + Range("range"), + + Sterms("sterms"), + + Umterms("umterms"), + + ValueCount("value_count"), + + /** A custom {@code ApiKeyAggregate} defined by a plugin */ + _Custom(null) + + ; + + private final String jsonValue; + + Kind(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + public ApiKeyAggregate(ApiKeyAggregateVariant value) { + + this._kind = ApiTypeHelper.requireNonNull(value._apiKeyAggregateKind(), this, ""); + this._value = ApiTypeHelper.requireNonNull(value, this, ""); + this._customKind = null; + + } + + private ApiKeyAggregate(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + this._customKind = builder._customKind; + + } + + public static ApiKeyAggregate of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Build a custom plugin-defined {@code ApiKeyAggregate}, given its kind and + * some JSON data + */ + public ApiKeyAggregate(String kind, JsonData value) { + this._kind = Kind._Custom; + this._value = value; + this._customKind = kind; + } + + /** + * Is this variant instance of kind {@code cardinality}? + */ + public boolean isCardinality() { + return _kind == Kind.Cardinality; + } + + /** + * Get the {@code cardinality} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code cardinality} kind. + */ + public CardinalityAggregate cardinality() { + return TaggedUnionUtils.get(this, Kind.Cardinality); + } + + /** + * Is this variant instance of kind {@code composite}? + */ + public boolean isComposite() { + return _kind == Kind.Composite; + } + + /** + * Get the {@code composite} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code composite} kind. + */ + public CompositeAggregate composite() { + return TaggedUnionUtils.get(this, Kind.Composite); + } + + /** + * Is this variant instance of kind {@code date_range}? + */ + public boolean isDateRange() { + return _kind == Kind.DateRange; + } + + /** + * Get the {@code date_range} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code date_range} kind. + */ + public DateRangeAggregate dateRange() { + return TaggedUnionUtils.get(this, Kind.DateRange); + } + + /** + * Is this variant instance of kind {@code dterms}? + */ + public boolean isDterms() { + return _kind == Kind.Dterms; + } + + /** + * Get the {@code dterms} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code dterms} kind. + */ + public DoubleTermsAggregate dterms() { + return TaggedUnionUtils.get(this, Kind.Dterms); + } + + /** + * Is this variant instance of kind {@code filter}? + */ + public boolean isFilter() { + return _kind == Kind.Filter; + } + + /** + * Get the {@code filter} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code filter} kind. + */ + public FilterAggregate filter() { + return TaggedUnionUtils.get(this, Kind.Filter); + } + + /** + * Is this variant instance of kind {@code filters}? + */ + public boolean isFilters() { + return _kind == Kind.Filters; + } + + /** + * Get the {@code filters} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code filters} kind. + */ + public FiltersAggregate filters() { + return TaggedUnionUtils.get(this, Kind.Filters); + } + + /** + * Is this variant instance of kind {@code lterms}? + */ + public boolean isLterms() { + return _kind == Kind.Lterms; + } + + /** + * Get the {@code lterms} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code lterms} kind. + */ + public LongTermsAggregate lterms() { + return TaggedUnionUtils.get(this, Kind.Lterms); + } + + /** + * Is this variant instance of kind {@code missing}? + */ + public boolean isMissing() { + return _kind == Kind.Missing; + } + + /** + * Get the {@code missing} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code missing} kind. + */ + public MissingAggregate missing() { + return TaggedUnionUtils.get(this, Kind.Missing); + } + + /** + * Is this variant instance of kind {@code multi_terms}? + */ + public boolean isMultiTerms() { + return _kind == Kind.MultiTerms; + } + + /** + * Get the {@code multi_terms} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code multi_terms} kind. + */ + public MultiTermsAggregate multiTerms() { + return TaggedUnionUtils.get(this, Kind.MultiTerms); + } + + /** + * Is this variant instance of kind {@code range}? + */ + public boolean isRange() { + return _kind == Kind.Range; + } + + /** + * Get the {@code range} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code range} kind. + */ + public RangeAggregate range() { + return TaggedUnionUtils.get(this, Kind.Range); + } + + /** + * Is this variant instance of kind {@code sterms}? + */ + public boolean isSterms() { + return _kind == Kind.Sterms; + } + + /** + * Get the {@code sterms} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code sterms} kind. + */ + public StringTermsAggregate sterms() { + return TaggedUnionUtils.get(this, Kind.Sterms); + } + + /** + * Is this variant instance of kind {@code umterms}? + */ + public boolean isUmterms() { + return _kind == Kind.Umterms; + } + + /** + * Get the {@code umterms} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code umterms} kind. + */ + public UnmappedTermsAggregate umterms() { + return TaggedUnionUtils.get(this, Kind.Umterms); + } + + /** + * Is this variant instance of kind {@code value_count}? + */ + public boolean isValueCount() { + return _kind == Kind.ValueCount; + } + + /** + * Get the {@code value_count} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code value_count} kind. + */ + public ValueCountAggregate valueCount() { + return TaggedUnionUtils.get(this, Kind.ValueCount); + } + + @Nullable + private final String _customKind; + + /** + * Is this a custom {@code ApiKeyAggregate} defined by a plugin? + */ + public boolean _isCustom() { + return _kind == Kind._Custom; + } + + /** + * Get the actual kind when {@code _kind()} equals {@link Kind#_Custom} + * (plugin-defined variant). + */ + @Nullable + public final String _customKind() { + return _customKind; + } + + /** + * Get the custom plugin-defined variant value. + * + * @throws IllegalStateException + * if the current variant is not {@link Kind#_Custom}. + */ + public JsonData _custom() { + return TaggedUnionUtils.get(this, Kind._Custom); + } + + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + + mapper.serialize(_value, generator); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + private Kind _kind; + private Object _value; + private String _customKind; + + public ObjectBuilder cardinality(CardinalityAggregate v) { + this._kind = Kind.Cardinality; + this._value = v; + return this; + } + + public ObjectBuilder cardinality( + Function> fn) { + return this.cardinality(fn.apply(new CardinalityAggregate.Builder()).build()); + } + + public ObjectBuilder composite(CompositeAggregate v) { + this._kind = Kind.Composite; + this._value = v; + return this; + } + + public ObjectBuilder composite( + Function> fn) { + return this.composite(fn.apply(new CompositeAggregate.Builder()).build()); + } + + public ObjectBuilder dateRange(DateRangeAggregate v) { + this._kind = Kind.DateRange; + this._value = v; + return this; + } + + public ObjectBuilder dateRange( + Function> fn) { + return this.dateRange(fn.apply(new DateRangeAggregate.Builder()).build()); + } + + public ObjectBuilder dterms(DoubleTermsAggregate v) { + this._kind = Kind.Dterms; + this._value = v; + return this; + } + + public ObjectBuilder dterms( + Function> fn) { + return this.dterms(fn.apply(new DoubleTermsAggregate.Builder()).build()); + } + + public ObjectBuilder filter(FilterAggregate v) { + this._kind = Kind.Filter; + this._value = v; + return this; + } + + public ObjectBuilder filter( + Function> fn) { + return this.filter(fn.apply(new FilterAggregate.Builder()).build()); + } + + public ObjectBuilder filters(FiltersAggregate v) { + this._kind = Kind.Filters; + this._value = v; + return this; + } + + public ObjectBuilder filters( + Function> fn) { + return this.filters(fn.apply(new FiltersAggregate.Builder()).build()); + } + + public ObjectBuilder lterms(LongTermsAggregate v) { + this._kind = Kind.Lterms; + this._value = v; + return this; + } + + public ObjectBuilder lterms( + Function> fn) { + return this.lterms(fn.apply(new LongTermsAggregate.Builder()).build()); + } + + public ObjectBuilder missing(MissingAggregate v) { + this._kind = Kind.Missing; + this._value = v; + return this; + } + + public ObjectBuilder missing( + Function> fn) { + return this.missing(fn.apply(new MissingAggregate.Builder()).build()); + } + + public ObjectBuilder multiTerms(MultiTermsAggregate v) { + this._kind = Kind.MultiTerms; + this._value = v; + return this; + } + + public ObjectBuilder multiTerms( + Function> fn) { + return this.multiTerms(fn.apply(new MultiTermsAggregate.Builder()).build()); + } + + public ObjectBuilder range(RangeAggregate v) { + this._kind = Kind.Range; + this._value = v; + return this; + } + + public ObjectBuilder range( + Function> fn) { + return this.range(fn.apply(new RangeAggregate.Builder()).build()); + } + + public ObjectBuilder sterms(StringTermsAggregate v) { + this._kind = Kind.Sterms; + this._value = v; + return this; + } + + public ObjectBuilder sterms( + Function> fn) { + return this.sterms(fn.apply(new StringTermsAggregate.Builder()).build()); + } + + public ObjectBuilder umterms(UnmappedTermsAggregate v) { + this._kind = Kind.Umterms; + this._value = v; + return this; + } + + public ObjectBuilder umterms( + Function> fn) { + return this.umterms(fn.apply(new UnmappedTermsAggregate.Builder()).build()); + } + + public ObjectBuilder valueCount(ValueCountAggregate v) { + this._kind = Kind.ValueCount; + this._value = v; + return this; + } + + public ObjectBuilder valueCount( + Function> fn) { + return this.valueCount(fn.apply(new ValueCountAggregate.Builder()).build()); + } + + /** + * Define this {@code ApiKeyAggregate} as a plugin-defined variant. + * + * @param name + * the plugin-defined identifier + * @param data + * the data for this custom {@code ApiKeyAggregate}. It is converted + * internally to {@link JsonData}. + */ + public ObjectBuilder _custom(String name, Object data) { + this._kind = Kind._Custom; + this._customKind = name; + this._value = JsonData.of(data); + return this; + } + + public ApiKeyAggregate build() { + _checkSingleUse(); + return new ApiKeyAggregate(this); + } + + } + + public static final ExternallyTaggedUnion.TypedKeysDeserializer _TYPED_KEYS_DESERIALIZER; + + static { + Map> deserializers = new HashMap<>(); + deserializers.put("cardinality", CardinalityAggregate._DESERIALIZER); + deserializers.put("composite", CompositeAggregate._DESERIALIZER); + deserializers.put("date_range", DateRangeAggregate._DESERIALIZER); + deserializers.put("dterms", DoubleTermsAggregate._DESERIALIZER); + deserializers.put("filter", FilterAggregate._DESERIALIZER); + deserializers.put("filters", FiltersAggregate._DESERIALIZER); + deserializers.put("lterms", LongTermsAggregate._DESERIALIZER); + deserializers.put("missing", MissingAggregate._DESERIALIZER); + deserializers.put("multi_terms", MultiTermsAggregate._DESERIALIZER); + deserializers.put("range", RangeAggregate._DESERIALIZER); + deserializers.put("sterms", StringTermsAggregate._DESERIALIZER); + deserializers.put("umterms", UnmappedTermsAggregate._DESERIALIZER); + deserializers.put("value_count", ValueCountAggregate._DESERIALIZER); + + _TYPED_KEYS_DESERIALIZER = new ExternallyTaggedUnion.Deserializer<>(deserializers, ApiKeyAggregate::new, + ApiKeyAggregate::new).typedKeys(); + } +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregateBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregateBuilders.java new file mode 100644 index 000000000..eb27cb7a3 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregateBuilders.java @@ -0,0 +1,302 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.security.query_api_keys; + +import co.elastic.clients.elasticsearch._types.aggregations.CardinalityAggregate; +import co.elastic.clients.elasticsearch._types.aggregations.CompositeAggregate; +import co.elastic.clients.elasticsearch._types.aggregations.DateRangeAggregate; +import co.elastic.clients.elasticsearch._types.aggregations.DoubleTermsAggregate; +import co.elastic.clients.elasticsearch._types.aggregations.FilterAggregate; +import co.elastic.clients.elasticsearch._types.aggregations.FiltersAggregate; +import co.elastic.clients.elasticsearch._types.aggregations.LongTermsAggregate; +import co.elastic.clients.elasticsearch._types.aggregations.MissingAggregate; +import co.elastic.clients.elasticsearch._types.aggregations.MultiTermsAggregate; +import co.elastic.clients.elasticsearch._types.aggregations.RangeAggregate; +import co.elastic.clients.elasticsearch._types.aggregations.StringTermsAggregate; +import co.elastic.clients.elasticsearch._types.aggregations.UnmappedTermsAggregate; +import co.elastic.clients.elasticsearch._types.aggregations.ValueCountAggregate; +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Builders for {@link ApiKeyAggregate} variants. + */ +public class ApiKeyAggregateBuilders { + private ApiKeyAggregateBuilders() { + } + + /** + * Creates a builder for the {@link CardinalityAggregate cardinality} + * {@code ApiKeyAggregate} variant. + */ + public static CardinalityAggregate.Builder cardinality() { + return new CardinalityAggregate.Builder(); + } + + /** + * Creates a ApiKeyAggregate of the {@link CardinalityAggregate cardinality} + * {@code ApiKeyAggregate} variant. + */ + public static ApiKeyAggregate cardinality( + Function> fn) { + ApiKeyAggregate.Builder builder = new ApiKeyAggregate.Builder(); + builder.cardinality(fn.apply(new CardinalityAggregate.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link CompositeAggregate composite} + * {@code ApiKeyAggregate} variant. + */ + public static CompositeAggregate.Builder composite() { + return new CompositeAggregate.Builder(); + } + + /** + * Creates a ApiKeyAggregate of the {@link CompositeAggregate composite} + * {@code ApiKeyAggregate} variant. + */ + public static ApiKeyAggregate composite( + Function> fn) { + ApiKeyAggregate.Builder builder = new ApiKeyAggregate.Builder(); + builder.composite(fn.apply(new CompositeAggregate.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link DateRangeAggregate date_range} + * {@code ApiKeyAggregate} variant. + */ + public static DateRangeAggregate.Builder dateRange() { + return new DateRangeAggregate.Builder(); + } + + /** + * Creates a ApiKeyAggregate of the {@link DateRangeAggregate date_range} + * {@code ApiKeyAggregate} variant. + */ + public static ApiKeyAggregate dateRange( + Function> fn) { + ApiKeyAggregate.Builder builder = new ApiKeyAggregate.Builder(); + builder.dateRange(fn.apply(new DateRangeAggregate.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link DoubleTermsAggregate dterms} + * {@code ApiKeyAggregate} variant. + */ + public static DoubleTermsAggregate.Builder dterms() { + return new DoubleTermsAggregate.Builder(); + } + + /** + * Creates a ApiKeyAggregate of the {@link DoubleTermsAggregate dterms} + * {@code ApiKeyAggregate} variant. + */ + public static ApiKeyAggregate dterms( + Function> fn) { + ApiKeyAggregate.Builder builder = new ApiKeyAggregate.Builder(); + builder.dterms(fn.apply(new DoubleTermsAggregate.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link FilterAggregate filter} + * {@code ApiKeyAggregate} variant. + */ + public static FilterAggregate.Builder filter() { + return new FilterAggregate.Builder(); + } + + /** + * Creates a ApiKeyAggregate of the {@link FilterAggregate filter} + * {@code ApiKeyAggregate} variant. + */ + public static ApiKeyAggregate filter(Function> fn) { + ApiKeyAggregate.Builder builder = new ApiKeyAggregate.Builder(); + builder.filter(fn.apply(new FilterAggregate.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link FiltersAggregate filters} + * {@code ApiKeyAggregate} variant. + */ + public static FiltersAggregate.Builder filters() { + return new FiltersAggregate.Builder(); + } + + /** + * Creates a ApiKeyAggregate of the {@link FiltersAggregate filters} + * {@code ApiKeyAggregate} variant. + */ + public static ApiKeyAggregate filters(Function> fn) { + ApiKeyAggregate.Builder builder = new ApiKeyAggregate.Builder(); + builder.filters(fn.apply(new FiltersAggregate.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link LongTermsAggregate lterms} + * {@code ApiKeyAggregate} variant. + */ + public static LongTermsAggregate.Builder lterms() { + return new LongTermsAggregate.Builder(); + } + + /** + * Creates a ApiKeyAggregate of the {@link LongTermsAggregate lterms} + * {@code ApiKeyAggregate} variant. + */ + public static ApiKeyAggregate lterms(Function> fn) { + ApiKeyAggregate.Builder builder = new ApiKeyAggregate.Builder(); + builder.lterms(fn.apply(new LongTermsAggregate.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link MissingAggregate missing} + * {@code ApiKeyAggregate} variant. + */ + public static MissingAggregate.Builder missing() { + return new MissingAggregate.Builder(); + } + + /** + * Creates a ApiKeyAggregate of the {@link MissingAggregate missing} + * {@code ApiKeyAggregate} variant. + */ + public static ApiKeyAggregate missing(Function> fn) { + ApiKeyAggregate.Builder builder = new ApiKeyAggregate.Builder(); + builder.missing(fn.apply(new MissingAggregate.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link MultiTermsAggregate multi_terms} + * {@code ApiKeyAggregate} variant. + */ + public static MultiTermsAggregate.Builder multiTerms() { + return new MultiTermsAggregate.Builder(); + } + + /** + * Creates a ApiKeyAggregate of the {@link MultiTermsAggregate multi_terms} + * {@code ApiKeyAggregate} variant. + */ + public static ApiKeyAggregate multiTerms( + Function> fn) { + ApiKeyAggregate.Builder builder = new ApiKeyAggregate.Builder(); + builder.multiTerms(fn.apply(new MultiTermsAggregate.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link RangeAggregate range} + * {@code ApiKeyAggregate} variant. + */ + public static RangeAggregate.Builder range() { + return new RangeAggregate.Builder(); + } + + /** + * Creates a ApiKeyAggregate of the {@link RangeAggregate range} + * {@code ApiKeyAggregate} variant. + */ + public static ApiKeyAggregate range(Function> fn) { + ApiKeyAggregate.Builder builder = new ApiKeyAggregate.Builder(); + builder.range(fn.apply(new RangeAggregate.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link StringTermsAggregate sterms} + * {@code ApiKeyAggregate} variant. + */ + public static StringTermsAggregate.Builder sterms() { + return new StringTermsAggregate.Builder(); + } + + /** + * Creates a ApiKeyAggregate of the {@link StringTermsAggregate sterms} + * {@code ApiKeyAggregate} variant. + */ + public static ApiKeyAggregate sterms( + Function> fn) { + ApiKeyAggregate.Builder builder = new ApiKeyAggregate.Builder(); + builder.sterms(fn.apply(new StringTermsAggregate.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link UnmappedTermsAggregate umterms} + * {@code ApiKeyAggregate} variant. + */ + public static UnmappedTermsAggregate.Builder umterms() { + return new UnmappedTermsAggregate.Builder(); + } + + /** + * Creates a ApiKeyAggregate of the {@link UnmappedTermsAggregate umterms} + * {@code ApiKeyAggregate} variant. + */ + public static ApiKeyAggregate umterms( + Function> fn) { + ApiKeyAggregate.Builder builder = new ApiKeyAggregate.Builder(); + builder.umterms(fn.apply(new UnmappedTermsAggregate.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link ValueCountAggregate value_count} + * {@code ApiKeyAggregate} variant. + */ + public static ValueCountAggregate.Builder valueCount() { + return new ValueCountAggregate.Builder(); + } + + /** + * Creates a ApiKeyAggregate of the {@link ValueCountAggregate value_count} + * {@code ApiKeyAggregate} variant. + */ + public static ApiKeyAggregate valueCount( + Function> fn) { + ApiKeyAggregate.Builder builder = new ApiKeyAggregate.Builder(); + builder.valueCount(fn.apply(new ValueCountAggregate.Builder()).build()); + return builder.build(); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregateVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregateVariant.java new file mode 100644 index 000000000..c49a46bdf --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregateVariant.java @@ -0,0 +1,48 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.security.query_api_keys; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Base interface for {@link ApiKeyAggregate} variants. + */ +public interface ApiKeyAggregateVariant { + + ApiKeyAggregate.Kind _apiKeyAggregateKind(); + + default ApiKeyAggregate _toApiKeyAggregate() { + return new ApiKeyAggregate(this); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregation.java new file mode 100644 index 000000000..bd1996642 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregation.java @@ -0,0 +1,680 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.security.query_api_keys; + +import co.elastic.clients.elasticsearch._types.aggregations.CardinalityAggregation; +import co.elastic.clients.elasticsearch._types.aggregations.CompositeAggregation; +import co.elastic.clients.elasticsearch._types.aggregations.DateRangeAggregation; +import co.elastic.clients.elasticsearch._types.aggregations.MissingAggregation; +import co.elastic.clients.elasticsearch._types.aggregations.RangeAggregation; +import co.elastic.clients.elasticsearch._types.aggregations.TermsAggregation; +import co.elastic.clients.elasticsearch._types.aggregations.ValueCountAggregation; +import co.elastic.clients.json.JsonData; +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.OpenTaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Object; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: security.query_api_keys.ApiKeyAggregationContainer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ApiKeyAggregation implements OpenTaggedUnion, JsonpSerializable { + + /** + * {@link ApiKeyAggregation} variant kinds. + * + * @see API + * specification + */ + + public enum Kind implements JsonEnum { + Cardinality("cardinality"), + + Composite("composite"), + + DateRange("date_range"), + + Filter("filter"), + + Filters("filters"), + + Missing("missing"), + + Range("range"), + + Terms("terms"), + + ValueCount("value_count"), + + /** A custom {@code ApiKeyAggregation} defined by a plugin */ + _Custom(null) + + ; + + private final String jsonValue; + + Kind(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + private final Map aggregations; + + private final Map meta; + + public ApiKeyAggregation(ApiKeyAggregationVariant value) { + + this._kind = ApiTypeHelper.requireNonNull(value._apiKeyAggregationKind(), this, ""); + this._value = ApiTypeHelper.requireNonNull(value, this, ""); + this._customKind = null; + + this.aggregations = null; + this.meta = null; + + } + + private ApiKeyAggregation(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + this._customKind = builder._customKind; + + this.aggregations = ApiTypeHelper.unmodifiable(builder.aggregations); + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + + } + + public static ApiKeyAggregation of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Sub-aggregations for this aggregation. Only applies to bucket aggregations. + *

+ * API name: {@code aggregations} + */ + public final Map aggregations() { + return this.aggregations; + } + + /** + * API name: {@code meta} + */ + public final Map meta() { + return this.meta; + } + + /** + * Is this variant instance of kind {@code cardinality}? + */ + public boolean isCardinality() { + return _kind == Kind.Cardinality; + } + + /** + * Get the {@code cardinality} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code cardinality} kind. + */ + public CardinalityAggregation cardinality() { + return TaggedUnionUtils.get(this, Kind.Cardinality); + } + + /** + * Is this variant instance of kind {@code composite}? + */ + public boolean isComposite() { + return _kind == Kind.Composite; + } + + /** + * Get the {@code composite} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code composite} kind. + */ + public CompositeAggregation composite() { + return TaggedUnionUtils.get(this, Kind.Composite); + } + + /** + * Is this variant instance of kind {@code date_range}? + */ + public boolean isDateRange() { + return _kind == Kind.DateRange; + } + + /** + * Get the {@code date_range} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code date_range} kind. + */ + public DateRangeAggregation dateRange() { + return TaggedUnionUtils.get(this, Kind.DateRange); + } + + /** + * Is this variant instance of kind {@code filter}? + */ + public boolean isFilter() { + return _kind == Kind.Filter; + } + + /** + * Get the {@code filter} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code filter} kind. + */ + public ApiKeyQuery filter() { + return TaggedUnionUtils.get(this, Kind.Filter); + } + + /** + * Is this variant instance of kind {@code filters}? + */ + public boolean isFilters() { + return _kind == Kind.Filters; + } + + /** + * Get the {@code filters} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code filters} kind. + */ + public ApiKeyFiltersAggregation filters() { + return TaggedUnionUtils.get(this, Kind.Filters); + } + + /** + * Is this variant instance of kind {@code missing}? + */ + public boolean isMissing() { + return _kind == Kind.Missing; + } + + /** + * Get the {@code missing} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code missing} kind. + */ + public MissingAggregation missing() { + return TaggedUnionUtils.get(this, Kind.Missing); + } + + /** + * Is this variant instance of kind {@code range}? + */ + public boolean isRange() { + return _kind == Kind.Range; + } + + /** + * Get the {@code range} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code range} kind. + */ + public RangeAggregation range() { + return TaggedUnionUtils.get(this, Kind.Range); + } + + /** + * Is this variant instance of kind {@code terms}? + */ + public boolean isTerms() { + return _kind == Kind.Terms; + } + + /** + * Get the {@code terms} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code terms} kind. + */ + public TermsAggregation terms() { + return TaggedUnionUtils.get(this, Kind.Terms); + } + + /** + * Is this variant instance of kind {@code value_count}? + */ + public boolean isValueCount() { + return _kind == Kind.ValueCount; + } + + /** + * Get the {@code value_count} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code value_count} kind. + */ + public ValueCountAggregation valueCount() { + return TaggedUnionUtils.get(this, Kind.ValueCount); + } + + @Nullable + private final String _customKind; + + /** + * Is this a custom {@code ApiKeyAggregation} defined by a plugin? + */ + public boolean _isCustom() { + return _kind == Kind._Custom; + } + + /** + * Get the actual kind when {@code _kind()} equals {@link Kind#_Custom} + * (plugin-defined variant). + */ + @Nullable + public final String _customKind() { + return _customKind; + } + + /** + * Get the custom plugin-defined variant value. + * + * @throws IllegalStateException + * if the current variant is not {@link Kind#_Custom}. + */ + public JsonData _custom() { + return TaggedUnionUtils.get(this, Kind._Custom); + } + + @Override + @SuppressWarnings("unchecked") + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeStartObject(); + + if (ApiTypeHelper.isDefined(this.aggregations)) { + generator.writeKey("aggregations"); + generator.writeStartObject(); + for (Map.Entry item0 : this.aggregations.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + generator.writeKey(_kind == Kind._Custom ? _customKind : _kind.jsonValue()); + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } + + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Kind _kind; + private Object _value; + private String _customKind; + + @Nullable + private Map aggregations; + + @Nullable + private Map meta; + + /** + * Sub-aggregations for this aggregation. Only applies to bucket aggregations. + *

+ * API name: {@code aggregations} + *

+ * Adds all entries of map to aggregations. + */ + public final Builder aggregations(Map map) { + this.aggregations = _mapPutAll(this.aggregations, map); + return this; + } + + /** + * Sub-aggregations for this aggregation. Only applies to bucket aggregations. + *

+ * API name: {@code aggregations} + *

+ * Adds an entry to aggregations. + */ + public final Builder aggregations(String key, ApiKeyAggregation value) { + this.aggregations = _mapPut(this.aggregations, key, value); + return this; + } + + /** + * Sub-aggregations for this aggregation. Only applies to bucket aggregations. + *

+ * API name: {@code aggregations} + *

+ * Adds an entry to aggregations using a builder lambda. + */ + public final Builder aggregations(String key, + Function> fn) { + return aggregations(key, fn.apply(new ApiKeyAggregation.Builder()).build()); + } + + /** + * API name: {@code meta} + *

+ * Adds all entries of map to meta. + */ + public final Builder meta(Map map) { + this.meta = _mapPutAll(this.meta, map); + return this; + } + + /** + * API name: {@code meta} + *

+ * Adds an entry to meta. + */ + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); + return this; + } + + @Override + protected Builder self() { + return this; + } + public ContainerBuilder cardinality(CardinalityAggregation v) { + this._kind = Kind.Cardinality; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder cardinality( + Function> fn) { + return this.cardinality(fn.apply(new CardinalityAggregation.Builder()).build()); + } + + public ContainerBuilder composite(CompositeAggregation v) { + this._kind = Kind.Composite; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder composite( + Function> fn) { + return this.composite(fn.apply(new CompositeAggregation.Builder()).build()); + } + + public ContainerBuilder dateRange(DateRangeAggregation v) { + this._kind = Kind.DateRange; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder dateRange( + Function> fn) { + return this.dateRange(fn.apply(new DateRangeAggregation.Builder()).build()); + } + + public ContainerBuilder filter(ApiKeyQuery v) { + this._kind = Kind.Filter; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder filter(Function> fn) { + return this.filter(fn.apply(new ApiKeyQuery.Builder()).build()); + } + + public ContainerBuilder filters(ApiKeyFiltersAggregation v) { + this._kind = Kind.Filters; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder filters( + Function> fn) { + return this.filters(fn.apply(new ApiKeyFiltersAggregation.Builder()).build()); + } + + public ContainerBuilder missing(MissingAggregation v) { + this._kind = Kind.Missing; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder missing(Function> fn) { + return this.missing(fn.apply(new MissingAggregation.Builder()).build()); + } + + public ContainerBuilder range(RangeAggregation v) { + this._kind = Kind.Range; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder range(Function> fn) { + return this.range(fn.apply(new RangeAggregation.Builder()).build()); + } + + public ContainerBuilder terms(TermsAggregation v) { + this._kind = Kind.Terms; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder terms(Function> fn) { + return this.terms(fn.apply(new TermsAggregation.Builder()).build()); + } + + public ContainerBuilder valueCount(ValueCountAggregation v) { + this._kind = Kind.ValueCount; + this._value = v; + return new ContainerBuilder(); + } + + public ContainerBuilder valueCount( + Function> fn) { + return this.valueCount(fn.apply(new ValueCountAggregation.Builder()).build()); + } + + /** + * Define this {@code ApiKeyAggregation} as a plugin-defined variant. + * + * @param name + * the plugin-defined identifier + * @param data + * the data for this custom {@code ApiKeyAggregation}. It is + * converted internally to {@link JsonData}. + */ + public ContainerBuilder _custom(String name, Object data) { + this._kind = Kind._Custom; + this._customKind = name; + this._value = JsonData.of(data); + return new ContainerBuilder(); + } + + public ApiKeyAggregation build() { + _checkSingleUse(); + return new ApiKeyAggregation(this); + } + + public class ContainerBuilder implements ObjectBuilder { + + /** + * Sub-aggregations for this aggregation. Only applies to bucket aggregations. + *

+ * API name: {@code aggregations} + *

+ * Adds all entries of map to aggregations. + */ + public final ContainerBuilder aggregations(Map map) { + Builder.this.aggregations = _mapPutAll(Builder.this.aggregations, map); + return this; + } + + /** + * Sub-aggregations for this aggregation. Only applies to bucket aggregations. + *

+ * API name: {@code aggregations} + *

+ * Adds an entry to aggregations. + */ + public final ContainerBuilder aggregations(String key, ApiKeyAggregation value) { + Builder.this.aggregations = _mapPut(Builder.this.aggregations, key, value); + return this; + } + + /** + * Sub-aggregations for this aggregation. Only applies to bucket aggregations. + *

+ * API name: {@code aggregations} + *

+ * Adds an entry to aggregations using a builder lambda. + */ + public final ContainerBuilder aggregations(String key, + Function> fn) { + return aggregations(key, fn.apply(new ApiKeyAggregation.Builder()).build()); + } + + /** + * API name: {@code meta} + *

+ * Adds all entries of map to meta. + */ + public final ContainerBuilder meta(Map map) { + Builder.this.meta = _mapPutAll(Builder.this.meta, map); + return this; + } + + /** + * API name: {@code meta} + *

+ * Adds an entry to meta. + */ + public final ContainerBuilder meta(String key, JsonData value) { + Builder.this.meta = _mapPut(Builder.this.meta, key, value); + return this; + } + + public ApiKeyAggregation build() { + return Builder.this.build(); + } + } + } + + protected static void setupApiKeyAggregationDeserializer(ObjectDeserializer op) { + + op.add(Builder::aggregations, JsonpDeserializer.stringMapDeserializer(ApiKeyAggregation._DESERIALIZER), + "aggregations", "aggs"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "meta"); + op.add(Builder::cardinality, CardinalityAggregation._DESERIALIZER, "cardinality"); + op.add(Builder::composite, CompositeAggregation._DESERIALIZER, "composite"); + op.add(Builder::dateRange, DateRangeAggregation._DESERIALIZER, "date_range"); + op.add(Builder::filter, ApiKeyQuery._DESERIALIZER, "filter"); + op.add(Builder::filters, ApiKeyFiltersAggregation._DESERIALIZER, "filters"); + op.add(Builder::missing, MissingAggregation._DESERIALIZER, "missing"); + op.add(Builder::range, RangeAggregation._DESERIALIZER, "range"); + op.add(Builder::terms, TermsAggregation._DESERIALIZER, "terms"); + op.add(Builder::valueCount, ValueCountAggregation._DESERIALIZER, "value_count"); + + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + JsonpUtils.ensureCustomVariantsAllowed(parser, mapper); + builder._custom(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + + } + + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ApiKeyAggregation::setupApiKeyAggregationDeserializer, Builder::build); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregationBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregationBuilders.java new file mode 100644 index 000000000..10f0029dd --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregationBuilders.java @@ -0,0 +1,222 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.security.query_api_keys; + +import co.elastic.clients.elasticsearch._types.aggregations.CardinalityAggregation; +import co.elastic.clients.elasticsearch._types.aggregations.CompositeAggregation; +import co.elastic.clients.elasticsearch._types.aggregations.DateRangeAggregation; +import co.elastic.clients.elasticsearch._types.aggregations.MissingAggregation; +import co.elastic.clients.elasticsearch._types.aggregations.RangeAggregation; +import co.elastic.clients.elasticsearch._types.aggregations.TermsAggregation; +import co.elastic.clients.elasticsearch._types.aggregations.ValueCountAggregation; +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Builders for {@link ApiKeyAggregation} variants. + */ +public class ApiKeyAggregationBuilders { + private ApiKeyAggregationBuilders() { + } + + /** + * Creates a builder for the {@link CardinalityAggregation cardinality} + * {@code ApiKeyAggregation} variant. + */ + public static CardinalityAggregation.Builder cardinality() { + return new CardinalityAggregation.Builder(); + } + + /** + * Creates a ApiKeyAggregation of the {@link CardinalityAggregation cardinality} + * {@code ApiKeyAggregation} variant. + */ + public static ApiKeyAggregation cardinality( + Function> fn) { + ApiKeyAggregation.Builder builder = new ApiKeyAggregation.Builder(); + builder.cardinality(fn.apply(new CardinalityAggregation.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link CompositeAggregation composite} + * {@code ApiKeyAggregation} variant. + */ + public static CompositeAggregation.Builder composite() { + return new CompositeAggregation.Builder(); + } + + /** + * Creates a ApiKeyAggregation of the {@link CompositeAggregation composite} + * {@code ApiKeyAggregation} variant. + */ + public static ApiKeyAggregation composite( + Function> fn) { + ApiKeyAggregation.Builder builder = new ApiKeyAggregation.Builder(); + builder.composite(fn.apply(new CompositeAggregation.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link DateRangeAggregation date_range} + * {@code ApiKeyAggregation} variant. + */ + public static DateRangeAggregation.Builder dateRange() { + return new DateRangeAggregation.Builder(); + } + + /** + * Creates a ApiKeyAggregation of the {@link DateRangeAggregation date_range} + * {@code ApiKeyAggregation} variant. + */ + public static ApiKeyAggregation dateRange( + Function> fn) { + ApiKeyAggregation.Builder builder = new ApiKeyAggregation.Builder(); + builder.dateRange(fn.apply(new DateRangeAggregation.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link ApiKeyQuery filter} + * {@code ApiKeyAggregation} variant. + */ + public static ApiKeyQuery.Builder filter() { + return new ApiKeyQuery.Builder(); + } + + /** + * Creates a ApiKeyAggregation of the {@link ApiKeyQuery filter} + * {@code ApiKeyAggregation} variant. + */ + public static ApiKeyAggregation filter(Function> fn) { + ApiKeyAggregation.Builder builder = new ApiKeyAggregation.Builder(); + builder.filter(fn.apply(new ApiKeyQuery.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link ApiKeyFiltersAggregation filters} + * {@code ApiKeyAggregation} variant. + */ + public static ApiKeyFiltersAggregation.Builder filters() { + return new ApiKeyFiltersAggregation.Builder(); + } + + /** + * Creates a ApiKeyAggregation of the {@link ApiKeyFiltersAggregation filters} + * {@code ApiKeyAggregation} variant. + */ + public static ApiKeyAggregation filters( + Function> fn) { + ApiKeyAggregation.Builder builder = new ApiKeyAggregation.Builder(); + builder.filters(fn.apply(new ApiKeyFiltersAggregation.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link MissingAggregation missing} + * {@code ApiKeyAggregation} variant. + */ + public static MissingAggregation.Builder missing() { + return new MissingAggregation.Builder(); + } + + /** + * Creates a ApiKeyAggregation of the {@link MissingAggregation missing} + * {@code ApiKeyAggregation} variant. + */ + public static ApiKeyAggregation missing( + Function> fn) { + ApiKeyAggregation.Builder builder = new ApiKeyAggregation.Builder(); + builder.missing(fn.apply(new MissingAggregation.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link RangeAggregation range} + * {@code ApiKeyAggregation} variant. + */ + public static RangeAggregation.Builder range() { + return new RangeAggregation.Builder(); + } + + /** + * Creates a ApiKeyAggregation of the {@link RangeAggregation range} + * {@code ApiKeyAggregation} variant. + */ + public static ApiKeyAggregation range(Function> fn) { + ApiKeyAggregation.Builder builder = new ApiKeyAggregation.Builder(); + builder.range(fn.apply(new RangeAggregation.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link TermsAggregation terms} + * {@code ApiKeyAggregation} variant. + */ + public static TermsAggregation.Builder terms() { + return new TermsAggregation.Builder(); + } + + /** + * Creates a ApiKeyAggregation of the {@link TermsAggregation terms} + * {@code ApiKeyAggregation} variant. + */ + public static ApiKeyAggregation terms(Function> fn) { + ApiKeyAggregation.Builder builder = new ApiKeyAggregation.Builder(); + builder.terms(fn.apply(new TermsAggregation.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link ValueCountAggregation value_count} + * {@code ApiKeyAggregation} variant. + */ + public static ValueCountAggregation.Builder valueCount() { + return new ValueCountAggregation.Builder(); + } + + /** + * Creates a ApiKeyAggregation of the {@link ValueCountAggregation value_count} + * {@code ApiKeyAggregation} variant. + */ + public static ApiKeyAggregation valueCount( + Function> fn) { + ApiKeyAggregation.Builder builder = new ApiKeyAggregation.Builder(); + builder.valueCount(fn.apply(new ValueCountAggregation.Builder()).build()); + return builder.build(); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregationVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregationVariant.java new file mode 100644 index 000000000..8c71c48da --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyAggregationVariant.java @@ -0,0 +1,48 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.security.query_api_keys; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Base interface for {@link ApiKeyAggregation} variants. + */ +public interface ApiKeyAggregationVariant { + + ApiKeyAggregation.Kind _apiKeyAggregationKind(); + + default ApiKeyAggregation _toApiKeyAggregation() { + return new ApiKeyAggregation(this); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyFiltersAggregation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyFiltersAggregation.java new file mode 100644 index 000000000..79e912df5 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyFiltersAggregation.java @@ -0,0 +1,291 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.security.query_api_keys; + +import co.elastic.clients.elasticsearch._types.aggregations.BucketAggregationBase; +import co.elastic.clients.elasticsearch._types.aggregations.Buckets; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: security.query_api_keys.ApiKeyFiltersAggregation + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ApiKeyFiltersAggregation extends BucketAggregationBase + implements + ApiKeyAggregationVariant, + JsonpSerializable { + @Nullable + private final Buckets filters; + + @Nullable + private final Boolean otherBucket; + + @Nullable + private final String otherBucketKey; + + @Nullable + private final Boolean keyed; + + // --------------------------------------------------------------------------------------------- + + private ApiKeyFiltersAggregation(Builder builder) { + + this.filters = builder.filters; + this.otherBucket = builder.otherBucket; + this.otherBucketKey = builder.otherBucketKey; + this.keyed = builder.keyed; + + } + + public static ApiKeyFiltersAggregation of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * ApiKeyAggregation variant kind. + */ + @Override + public ApiKeyAggregation.Kind _apiKeyAggregationKind() { + return ApiKeyAggregation.Kind.Filters; + } + + /** + * Collection of queries from which to build buckets. + *

+ * API name: {@code filters} + */ + @Nullable + public final Buckets filters() { + return this.filters; + } + + /** + * Set to true to add a bucket to the response which will contain + * all documents that do not match any of the given filters. + *

+ * API name: {@code other_bucket} + */ + @Nullable + public final Boolean otherBucket() { + return this.otherBucket; + } + + /** + * The key with which the other bucket is returned. + *

+ * API name: {@code other_bucket_key} + */ + @Nullable + public final String otherBucketKey() { + return this.otherBucketKey; + } + + /** + * By default, the named filters aggregation returns the buckets as an object. + * Set to false to return the buckets as an array of objects. + *

+ * API name: {@code keyed} + */ + @Nullable + public final Boolean keyed() { + return this.keyed; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + if (this.filters != null) { + generator.writeKey("filters"); + this.filters.serialize(generator, mapper); + + } + if (this.otherBucket != null) { + generator.writeKey("other_bucket"); + generator.write(this.otherBucket); + + } + if (this.otherBucketKey != null) { + generator.writeKey("other_bucket_key"); + generator.write(this.otherBucketKey); + + } + if (this.keyed != null) { + generator.writeKey("keyed"); + generator.write(this.keyed); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ApiKeyFiltersAggregation}. + */ + + public static class Builder extends BucketAggregationBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Buckets filters; + + @Nullable + private Boolean otherBucket; + + @Nullable + private String otherBucketKey; + + @Nullable + private Boolean keyed; + + /** + * Collection of queries from which to build buckets. + *

+ * API name: {@code filters} + */ + public final Builder filters(@Nullable Buckets value) { + this.filters = value; + return this; + } + + /** + * Collection of queries from which to build buckets. + *

+ * API name: {@code filters} + */ + public final Builder filters(Function, ObjectBuilder>> fn) { + return this.filters(fn.apply(new Buckets.Builder()).build()); + } + + /** + * Set to true to add a bucket to the response which will contain + * all documents that do not match any of the given filters. + *

+ * API name: {@code other_bucket} + */ + public final Builder otherBucket(@Nullable Boolean value) { + this.otherBucket = value; + return this; + } + + /** + * The key with which the other bucket is returned. + *

+ * API name: {@code other_bucket_key} + */ + public final Builder otherBucketKey(@Nullable String value) { + this.otherBucketKey = value; + return this; + } + + /** + * By default, the named filters aggregation returns the buckets as an object. + * Set to false to return the buckets as an array of objects. + *

+ * API name: {@code keyed} + */ + public final Builder keyed(@Nullable Boolean value) { + this.keyed = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ApiKeyFiltersAggregation}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ApiKeyFiltersAggregation build() { + _checkSingleUse(); + + return new ApiKeyFiltersAggregation(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ApiKeyFiltersAggregation} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ApiKeyFiltersAggregation::setupApiKeyFiltersAggregationDeserializer); + + protected static void setupApiKeyFiltersAggregationDeserializer( + ObjectDeserializer op) { + + op.add(Builder::filters, Buckets.createBucketsDeserializer(ApiKeyQuery._DESERIALIZER), "filters"); + op.add(Builder::otherBucket, JsonpDeserializer.booleanDeserializer(), "other_bucket"); + op.add(Builder::otherBucketKey, JsonpDeserializer.stringDeserializer(), "other_bucket_key"); + op.add(Builder::keyed, JsonpDeserializer.booleanDeserializer(), "keyed"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyQuery.java new file mode 100644 index 000000000..94b68f054 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyQuery.java @@ -0,0 +1,575 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.security.query_api_keys; + +import co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.ExistsQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.IdsQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.MatchAllQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.MatchQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.PrefixQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.RangeQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.SimpleQueryStringQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.TermQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.TermsQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.WildcardQuery; +import co.elastic.clients.json.JsonData; +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.OpenTaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Object; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: security.query_api_keys.ApiKeyQueryContainer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ApiKeyQuery + implements + OpenTaggedUnion, + ApiKeyAggregationVariant, + JsonpSerializable { + + /** + * {@link ApiKeyQuery} variant kinds. + * + * @see API + * specification + */ + + public enum Kind implements JsonEnum { + Bool("bool"), + + Exists("exists"), + + Ids("ids"), + + Match("match"), + + MatchAll("match_all"), + + Prefix("prefix"), + + Range("range"), + + SimpleQueryString("simple_query_string"), + + Term("term"), + + Terms("terms"), + + Wildcard("wildcard"), + + /** A custom {@code ApiKeyQuery} defined by a plugin */ + _Custom(null) + + ; + + private final String jsonValue; + + Kind(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + } + + /** + * ApiKeyAggregation variant kind. + */ + @Override + public ApiKeyAggregation.Kind _apiKeyAggregationKind() { + return ApiKeyAggregation.Kind.Filter; + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + public ApiKeyQuery(ApiKeyQueryVariant value) { + + this._kind = ApiTypeHelper.requireNonNull(value._apiKeyQueryKind(), this, ""); + this._value = ApiTypeHelper.requireNonNull(value, this, ""); + this._customKind = null; + + } + + private ApiKeyQuery(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + this._customKind = builder._customKind; + + } + + public static ApiKeyQuery of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Is this variant instance of kind {@code bool}? + */ + public boolean isBool() { + return _kind == Kind.Bool; + } + + /** + * Get the {@code bool} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code bool} kind. + */ + public BoolQuery bool() { + return TaggedUnionUtils.get(this, Kind.Bool); + } + + /** + * Is this variant instance of kind {@code exists}? + */ + public boolean isExists() { + return _kind == Kind.Exists; + } + + /** + * Get the {@code exists} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code exists} kind. + */ + public ExistsQuery exists() { + return TaggedUnionUtils.get(this, Kind.Exists); + } + + /** + * Is this variant instance of kind {@code ids}? + */ + public boolean isIds() { + return _kind == Kind.Ids; + } + + /** + * Get the {@code ids} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code ids} kind. + */ + public IdsQuery ids() { + return TaggedUnionUtils.get(this, Kind.Ids); + } + + /** + * Is this variant instance of kind {@code match}? + */ + public boolean isMatch() { + return _kind == Kind.Match; + } + + /** + * Get the {@code match} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code match} kind. + */ + public MatchQuery match() { + return TaggedUnionUtils.get(this, Kind.Match); + } + + /** + * Is this variant instance of kind {@code match_all}? + */ + public boolean isMatchAll() { + return _kind == Kind.MatchAll; + } + + /** + * Get the {@code match_all} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code match_all} kind. + */ + public MatchAllQuery matchAll() { + return TaggedUnionUtils.get(this, Kind.MatchAll); + } + + /** + * Is this variant instance of kind {@code prefix}? + */ + public boolean isPrefix() { + return _kind == Kind.Prefix; + } + + /** + * Get the {@code prefix} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code prefix} kind. + */ + public PrefixQuery prefix() { + return TaggedUnionUtils.get(this, Kind.Prefix); + } + + /** + * Is this variant instance of kind {@code range}? + */ + public boolean isRange() { + return _kind == Kind.Range; + } + + /** + * Get the {@code range} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code range} kind. + */ + public RangeQuery range() { + return TaggedUnionUtils.get(this, Kind.Range); + } + + /** + * Is this variant instance of kind {@code simple_query_string}? + */ + public boolean isSimpleQueryString() { + return _kind == Kind.SimpleQueryString; + } + + /** + * Get the {@code simple_query_string} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code simple_query_string} + * kind. + */ + public SimpleQueryStringQuery simpleQueryString() { + return TaggedUnionUtils.get(this, Kind.SimpleQueryString); + } + + /** + * Is this variant instance of kind {@code term}? + */ + public boolean isTerm() { + return _kind == Kind.Term; + } + + /** + * Get the {@code term} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code term} kind. + */ + public TermQuery term() { + return TaggedUnionUtils.get(this, Kind.Term); + } + + /** + * Is this variant instance of kind {@code terms}? + */ + public boolean isTerms() { + return _kind == Kind.Terms; + } + + /** + * Get the {@code terms} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code terms} kind. + */ + public TermsQuery terms() { + return TaggedUnionUtils.get(this, Kind.Terms); + } + + /** + * Is this variant instance of kind {@code wildcard}? + */ + public boolean isWildcard() { + return _kind == Kind.Wildcard; + } + + /** + * Get the {@code wildcard} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code wildcard} kind. + */ + public WildcardQuery wildcard() { + return TaggedUnionUtils.get(this, Kind.Wildcard); + } + + @Nullable + private final String _customKind; + + /** + * Is this a custom {@code ApiKeyQuery} defined by a plugin? + */ + public boolean _isCustom() { + return _kind == Kind._Custom; + } + + /** + * Get the actual kind when {@code _kind()} equals {@link Kind#_Custom} + * (plugin-defined variant). + */ + @Nullable + public final String _customKind() { + return _customKind; + } + + /** + * Get the custom plugin-defined variant value. + * + * @throws IllegalStateException + * if the current variant is not {@link Kind#_Custom}. + */ + public JsonData _custom() { + return TaggedUnionUtils.get(this, Kind._Custom); + } + + @Override + @SuppressWarnings("unchecked") + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeStartObject(); + + generator.writeKey(_kind == Kind._Custom ? _customKind : _kind.jsonValue()); + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } + + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Kind _kind; + private Object _value; + private String _customKind; + + @Override + protected Builder self() { + return this; + } + public ObjectBuilder bool(BoolQuery v) { + this._kind = Kind.Bool; + this._value = v; + return this; + } + + public ObjectBuilder bool(Function> fn) { + return this.bool(fn.apply(new BoolQuery.Builder()).build()); + } + + public ObjectBuilder exists(ExistsQuery v) { + this._kind = Kind.Exists; + this._value = v; + return this; + } + + public ObjectBuilder exists(Function> fn) { + return this.exists(fn.apply(new ExistsQuery.Builder()).build()); + } + + public ObjectBuilder ids(IdsQuery v) { + this._kind = Kind.Ids; + this._value = v; + return this; + } + + public ObjectBuilder ids(Function> fn) { + return this.ids(fn.apply(new IdsQuery.Builder()).build()); + } + + public ObjectBuilder match(MatchQuery v) { + this._kind = Kind.Match; + this._value = v; + return this; + } + + public ObjectBuilder match(Function> fn) { + return this.match(fn.apply(new MatchQuery.Builder()).build()); + } + + public ObjectBuilder matchAll(MatchAllQuery v) { + this._kind = Kind.MatchAll; + this._value = v; + return this; + } + + public ObjectBuilder matchAll(Function> fn) { + return this.matchAll(fn.apply(new MatchAllQuery.Builder()).build()); + } + + public ObjectBuilder prefix(PrefixQuery v) { + this._kind = Kind.Prefix; + this._value = v; + return this; + } + + public ObjectBuilder prefix(Function> fn) { + return this.prefix(fn.apply(new PrefixQuery.Builder()).build()); + } + + public ObjectBuilder range(RangeQuery v) { + this._kind = Kind.Range; + this._value = v; + return this; + } + + public ObjectBuilder range(Function> fn) { + return this.range(fn.apply(new RangeQuery.Builder()).build()); + } + + public ObjectBuilder simpleQueryString(SimpleQueryStringQuery v) { + this._kind = Kind.SimpleQueryString; + this._value = v; + return this; + } + + public ObjectBuilder simpleQueryString( + Function> fn) { + return this.simpleQueryString(fn.apply(new SimpleQueryStringQuery.Builder()).build()); + } + + public ObjectBuilder term(TermQuery v) { + this._kind = Kind.Term; + this._value = v; + return this; + } + + public ObjectBuilder term(Function> fn) { + return this.term(fn.apply(new TermQuery.Builder()).build()); + } + + public ObjectBuilder terms(TermsQuery v) { + this._kind = Kind.Terms; + this._value = v; + return this; + } + + public ObjectBuilder terms(Function> fn) { + return this.terms(fn.apply(new TermsQuery.Builder()).build()); + } + + public ObjectBuilder wildcard(WildcardQuery v) { + this._kind = Kind.Wildcard; + this._value = v; + return this; + } + + public ObjectBuilder wildcard(Function> fn) { + return this.wildcard(fn.apply(new WildcardQuery.Builder()).build()); + } + + /** + * Define this {@code ApiKeyQuery} as a plugin-defined variant. + * + * @param name + * the plugin-defined identifier + * @param data + * the data for this custom {@code ApiKeyQuery}. It is converted + * internally to {@link JsonData}. + */ + public ObjectBuilder _custom(String name, Object data) { + this._kind = Kind._Custom; + this._customKind = name; + this._value = JsonData.of(data); + return this; + } + + public ApiKeyQuery build() { + _checkSingleUse(); + return new ApiKeyQuery(this); + } + + } + + protected static void setupApiKeyQueryDeserializer(ObjectDeserializer op) { + + op.add(Builder::bool, BoolQuery._DESERIALIZER, "bool"); + op.add(Builder::exists, ExistsQuery._DESERIALIZER, "exists"); + op.add(Builder::ids, IdsQuery._DESERIALIZER, "ids"); + op.add(Builder::match, MatchQuery._DESERIALIZER, "match"); + op.add(Builder::matchAll, MatchAllQuery._DESERIALIZER, "match_all"); + op.add(Builder::prefix, PrefixQuery._DESERIALIZER, "prefix"); + op.add(Builder::range, RangeQuery._DESERIALIZER, "range"); + op.add(Builder::simpleQueryString, SimpleQueryStringQuery._DESERIALIZER, "simple_query_string"); + op.add(Builder::term, TermQuery._DESERIALIZER, "term"); + op.add(Builder::terms, TermsQuery._DESERIALIZER, "terms"); + op.add(Builder::wildcard, WildcardQuery._DESERIALIZER, "wildcard"); + + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + JsonpUtils.ensureCustomVariantsAllowed(parser, mapper); + builder._custom(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + + } + + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + ApiKeyQuery::setupApiKeyQueryDeserializer, Builder::build); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyQueryBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyQueryBuilders.java new file mode 100644 index 000000000..5d47bed32 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyQueryBuilders.java @@ -0,0 +1,254 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.security.query_api_keys; + +import co.elastic.clients.elasticsearch._types.query_dsl.BoolQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.ExistsQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.IdsQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.MatchAllQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.MatchQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.PrefixQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.RangeQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.SimpleQueryStringQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.TermQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.TermsQuery; +import co.elastic.clients.elasticsearch._types.query_dsl.WildcardQuery; +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Builders for {@link ApiKeyQuery} variants. + */ +public class ApiKeyQueryBuilders { + private ApiKeyQueryBuilders() { + } + + /** + * Creates a builder for the {@link BoolQuery bool} {@code ApiKeyQuery} variant. + */ + public static BoolQuery.Builder bool() { + return new BoolQuery.Builder(); + } + + /** + * Creates a ApiKeyQuery of the {@link BoolQuery bool} {@code ApiKeyQuery} + * variant. + */ + public static ApiKeyQuery bool(Function> fn) { + ApiKeyQuery.Builder builder = new ApiKeyQuery.Builder(); + builder.bool(fn.apply(new BoolQuery.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link ExistsQuery exists} {@code ApiKeyQuery} + * variant. + */ + public static ExistsQuery.Builder exists() { + return new ExistsQuery.Builder(); + } + + /** + * Creates a ApiKeyQuery of the {@link ExistsQuery exists} {@code ApiKeyQuery} + * variant. + */ + public static ApiKeyQuery exists(Function> fn) { + ApiKeyQuery.Builder builder = new ApiKeyQuery.Builder(); + builder.exists(fn.apply(new ExistsQuery.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link IdsQuery ids} {@code ApiKeyQuery} variant. + */ + public static IdsQuery.Builder ids() { + return new IdsQuery.Builder(); + } + + /** + * Creates a ApiKeyQuery of the {@link IdsQuery ids} {@code ApiKeyQuery} + * variant. + */ + public static ApiKeyQuery ids(Function> fn) { + ApiKeyQuery.Builder builder = new ApiKeyQuery.Builder(); + builder.ids(fn.apply(new IdsQuery.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link MatchQuery match} {@code ApiKeyQuery} + * variant. + */ + public static MatchQuery.Builder match() { + return new MatchQuery.Builder(); + } + + /** + * Creates a ApiKeyQuery of the {@link MatchQuery match} {@code ApiKeyQuery} + * variant. + */ + public static ApiKeyQuery match(Function> fn) { + ApiKeyQuery.Builder builder = new ApiKeyQuery.Builder(); + builder.match(fn.apply(new MatchQuery.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link MatchAllQuery match_all} {@code ApiKeyQuery} + * variant. + */ + public static MatchAllQuery.Builder matchAll() { + return new MatchAllQuery.Builder(); + } + + /** + * Creates a ApiKeyQuery of the {@link MatchAllQuery match_all} + * {@code ApiKeyQuery} variant. + */ + public static ApiKeyQuery matchAll(Function> fn) { + ApiKeyQuery.Builder builder = new ApiKeyQuery.Builder(); + builder.matchAll(fn.apply(new MatchAllQuery.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link PrefixQuery prefix} {@code ApiKeyQuery} + * variant. + */ + public static PrefixQuery.Builder prefix() { + return new PrefixQuery.Builder(); + } + + /** + * Creates a ApiKeyQuery of the {@link PrefixQuery prefix} {@code ApiKeyQuery} + * variant. + */ + public static ApiKeyQuery prefix(Function> fn) { + ApiKeyQuery.Builder builder = new ApiKeyQuery.Builder(); + builder.prefix(fn.apply(new PrefixQuery.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link RangeQuery range} {@code ApiKeyQuery} + * variant. + */ + public static RangeQuery.Builder range() { + return new RangeQuery.Builder(); + } + + /** + * Creates a ApiKeyQuery of the {@link RangeQuery range} {@code ApiKeyQuery} + * variant. + */ + public static ApiKeyQuery range(Function> fn) { + ApiKeyQuery.Builder builder = new ApiKeyQuery.Builder(); + builder.range(fn.apply(new RangeQuery.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link SimpleQueryStringQuery simple_query_string} + * {@code ApiKeyQuery} variant. + */ + public static SimpleQueryStringQuery.Builder simpleQueryString() { + return new SimpleQueryStringQuery.Builder(); + } + + /** + * Creates a ApiKeyQuery of the {@link SimpleQueryStringQuery + * simple_query_string} {@code ApiKeyQuery} variant. + */ + public static ApiKeyQuery simpleQueryString( + Function> fn) { + ApiKeyQuery.Builder builder = new ApiKeyQuery.Builder(); + builder.simpleQueryString(fn.apply(new SimpleQueryStringQuery.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link TermQuery term} {@code ApiKeyQuery} variant. + */ + public static TermQuery.Builder term() { + return new TermQuery.Builder(); + } + + /** + * Creates a ApiKeyQuery of the {@link TermQuery term} {@code ApiKeyQuery} + * variant. + */ + public static ApiKeyQuery term(Function> fn) { + ApiKeyQuery.Builder builder = new ApiKeyQuery.Builder(); + builder.term(fn.apply(new TermQuery.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link TermsQuery terms} {@code ApiKeyQuery} + * variant. + */ + public static TermsQuery.Builder terms() { + return new TermsQuery.Builder(); + } + + /** + * Creates a ApiKeyQuery of the {@link TermsQuery terms} {@code ApiKeyQuery} + * variant. + */ + public static ApiKeyQuery terms(Function> fn) { + ApiKeyQuery.Builder builder = new ApiKeyQuery.Builder(); + builder.terms(fn.apply(new TermsQuery.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link WildcardQuery wildcard} {@code ApiKeyQuery} + * variant. + */ + public static WildcardQuery.Builder wildcard() { + return new WildcardQuery.Builder(); + } + + /** + * Creates a ApiKeyQuery of the {@link WildcardQuery wildcard} + * {@code ApiKeyQuery} variant. + */ + public static ApiKeyQuery wildcard(Function> fn) { + ApiKeyQuery.Builder builder = new ApiKeyQuery.Builder(); + builder.wildcard(fn.apply(new WildcardQuery.Builder()).build()); + return builder.build(); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyQueryVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyQueryVariant.java new file mode 100644 index 000000000..0bf83c960 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/query_api_keys/ApiKeyQueryVariant.java @@ -0,0 +1,48 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package co.elastic.clients.elasticsearch.security.query_api_keys; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +/** + * Base interface for {@link ApiKeyQuery} variants. + */ +public interface ApiKeyQueryVariant { + + ApiKeyQuery.Kind _apiKeyQueryKind(); + + default ApiKeyQuery _toApiKeyQuery() { + return new ApiKeyQuery(this); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsAsyncClient.java index 738a41a91..16932ca3b 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsAsyncClient.java @@ -248,7 +248,7 @@ public CompletableFuture getSynonymsSets() { // ----- Endpoint: synonyms.put_synonym /** - * Creates or updates a synonyms set + * Creates or updates a synonym set. * * @see Documentation @@ -263,7 +263,7 @@ public CompletableFuture putSynonym(PutSynonymRequest reques } /** - * Creates or updates a synonyms set + * Creates or updates a synonym set. * * @param fn * a function that initializes a builder to create the diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsClient.java index d999cf000..d685bda79 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsClient.java @@ -254,7 +254,7 @@ public GetSynonymsSetsResponse getSynonymsSets() throws IOException, Elasticsear // ----- Endpoint: synonyms.put_synonym /** - * Creates or updates a synonyms set + * Creates or updates a synonym set. * * @see Documentation @@ -269,7 +269,7 @@ public PutSynonymResponse putSynonym(PutSynonymRequest request) throws IOExcepti } /** - * Creates or updates a synonyms set + * Creates or updates a synonym set. * * @param fn * a function that initializes a builder to create the diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/PutSynonymResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/PutSynonymResponse.java index 4283ac056..9f3cc2470 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/PutSynonymResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/PutSynonymResponse.java @@ -20,7 +20,7 @@ package co.elastic.clients.elasticsearch.synonyms; import co.elastic.clients.elasticsearch._types.Result; -import co.elastic.clients.elasticsearch.indices.reload_search_analyzers.ReloadDetails; +import co.elastic.clients.elasticsearch.indices.reload_search_analyzers.ReloadResult; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -62,7 +62,7 @@ public class PutSynonymResponse implements JsonpSerializable { private final Result result; - private final ReloadDetails reloadAnalyzersDetails; + private final ReloadResult reloadAnalyzersDetails; // --------------------------------------------------------------------------------------------- @@ -88,7 +88,7 @@ public final Result result() { /** * Required - API name: {@code reload_analyzers_details} */ - public final ReloadDetails reloadAnalyzersDetails() { + public final ReloadResult reloadAnalyzersDetails() { return this.reloadAnalyzersDetails; } @@ -126,7 +126,7 @@ public static class Builder extends WithJsonObjectBuilderBase ObjectBuilder { private Result result; - private ReloadDetails reloadAnalyzersDetails; + private ReloadResult reloadAnalyzersDetails; /** * Required - API name: {@code result} @@ -139,7 +139,7 @@ public final Builder result(Result value) { /** * Required - API name: {@code reload_analyzers_details} */ - public final Builder reloadAnalyzersDetails(ReloadDetails value) { + public final Builder reloadAnalyzersDetails(ReloadResult value) { this.reloadAnalyzersDetails = value; return this; } @@ -147,8 +147,8 @@ public final Builder reloadAnalyzersDetails(ReloadDetails value) { /** * Required - API name: {@code reload_analyzers_details} */ - public final Builder reloadAnalyzersDetails(Function> fn) { - return this.reloadAnalyzersDetails(fn.apply(new ReloadDetails.Builder()).build()); + public final Builder reloadAnalyzersDetails(Function> fn) { + return this.reloadAnalyzersDetails(fn.apply(new ReloadResult.Builder()).build()); } @Override @@ -180,7 +180,7 @@ public PutSynonymResponse build() { protected static void setupPutSynonymResponseDeserializer(ObjectDeserializer op) { op.add(Builder::result, Result._DESERIALIZER, "result"); - op.add(Builder::reloadAnalyzersDetails, ReloadDetails._DESERIALIZER, "reload_analyzers_details"); + op.add(Builder::reloadAnalyzersDetails, ReloadResult._DESERIALIZER, "reload_analyzers_details"); } diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksAsyncClient.java index 6fb17813d..04005ab6c 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksAsyncClient.java @@ -71,7 +71,7 @@ public ElasticsearchTasksAsyncClient withTransportOptions(@Nullable TransportOpt * Returns information about a task. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/tasks.html">Documentation * on elastic.co */ @@ -89,7 +89,7 @@ public CompletableFuture get(GetTasksRequest request) { * a function that initializes a builder to create the * {@link GetTasksRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/tasks.html">Documentation * on elastic.co */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksClient.java index 4971ffa2e..e48658e7a 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/tasks/ElasticsearchTasksClient.java @@ -71,7 +71,7 @@ public ElasticsearchTasksClient withTransportOptions(@Nullable TransportOptions * Returns information about a task. * * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/tasks.html">Documentation * on elastic.co */ @@ -89,7 +89,7 @@ public GetTasksResponse get(GetTasksRequest request) throws IOException, Elastic * a function that initializes a builder to create the * {@link GetTasksRequest} * @see Documentation + * "https://www.elastic.co/guide/en/elasticsearch/reference/999.99/tasks.html">Documentation * on elastic.co */ diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformAsyncClient.java index 60cedff92..47c458dd1 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformAsyncClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformAsyncClient.java @@ -72,7 +72,7 @@ public ElasticsearchTransformAsyncClient withTransportOptions(@Nullable Transpor // ----- Endpoint: transform.delete_transform /** - * Deletes an existing transform. + * Deletes a transform. * * @see Documentation @@ -87,7 +87,7 @@ public CompletableFuture deleteTransform(DeleteTransfor } /** - * Deletes an existing transform. + * Deletes a transform. * * @param fn * a function that initializes a builder to create the @@ -185,6 +185,11 @@ public final CompletableFuture getTransformStats( /** * Previews a transform. + *

+ * It returns a maximum of 100 results. The calculations are based on all the + * current data in the source index. It also generates a list of mappings and + * settings for the destination index. These values are determined based on the + * field types of the source index and the transform aggregations. * * @see Documentation @@ -196,7 +201,7 @@ public CompletableFuture> prev @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) PreviewTransformRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:transform.preview_transform.TTransform", + "co.elastic.clients:Deserializer:transform.preview_transform.Response.TTransform", getDeserializer(tTransformClass)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); @@ -204,6 +209,11 @@ public CompletableFuture> prev /** * Previews a transform. + *

+ * It returns a maximum of 100 results. The calculations are based on all the + * current data in the source index. It also generates a list of mappings and + * settings for the destination index. These values are determined based on the + * field types of the source index and the transform aggregations. * * @param fn * a function that initializes a builder to create the @@ -221,6 +231,11 @@ public final CompletableFuture /** * Previews a transform. + *

+ * It returns a maximum of 100 results. The calculations are based on all the + * current data in the source index. It also generates a list of mappings and + * settings for the destination index. These values are determined based on the + * field types of the source index and the transform aggregations. * * @see Documentation @@ -232,7 +247,7 @@ public CompletableFuture> prev @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) PreviewTransformRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:transform.preview_transform.TTransform", + "co.elastic.clients:Deserializer:transform.preview_transform.Response.TTransform", getDeserializer(tTransformType)); return this.transport.performRequestAsync(request, endpoint, this.transportOptions); @@ -240,6 +255,11 @@ public CompletableFuture> prev /** * Previews a transform. + *

+ * It returns a maximum of 100 results. The calculations are based on all the + * current data in the source index. It also generates a list of mappings and + * settings for the destination index. These values are determined based on the + * field types of the source index and the transform aggregations. * * @param fn * a function that initializes a builder to create the @@ -257,7 +277,36 @@ public final CompletableFuture // ----- Endpoint: transform.put_transform /** - * Instantiates a transform. + * Creates a transform. + *

+ * A transform copies data from source indices, transforms it, and persists it + * into an entity-centric destination index. You can also think of the + * destination index as a two-dimensional tabular data structure (known as a + * data frame). The ID for each document in the data frame is generated from a + * hash of the entity, so there is a unique row per entity. + *

+ * You must choose either the latest or pivot method for your transform; you + * cannot use both in a single transform. If you choose to use the pivot method + * for your transform, the entities are defined by the set of + * group_by fields in the pivot object. If you choose to use the + * latest method, the entities are defined by the unique_key field + * values in the latest object. + *

+ * You must have create_index, index, and + * read privileges on the destination index and read + * and view_index_metadata privileges on the source indices. When + * Elasticsearch security features are enabled, the transform remembers which + * roles the user that created it had at the time of creation and uses those + * same roles. If those roles do not have the required privileges on the source + * and destination indices, the transform fails when it attempts unauthorized + * operations. + *

+ * NOTE: You must use Kibana or this API to create a transform. Do not add a + * transform directly into any .transform-internal* indices using + * the Elasticsearch index API. If Elasticsearch security features are enabled, + * do not give users any privileges on .transform-internal* + * indices. If you used transforms prior to 7.5, also do not give users any + * privileges on .data-frame-internal* indices. * * @see Documentation @@ -272,7 +321,36 @@ public CompletableFuture putTransform(PutTransformRequest } /** - * Instantiates a transform. + * Creates a transform. + *

+ * A transform copies data from source indices, transforms it, and persists it + * into an entity-centric destination index. You can also think of the + * destination index as a two-dimensional tabular data structure (known as a + * data frame). The ID for each document in the data frame is generated from a + * hash of the entity, so there is a unique row per entity. + *

+ * You must choose either the latest or pivot method for your transform; you + * cannot use both in a single transform. If you choose to use the pivot method + * for your transform, the entities are defined by the set of + * group_by fields in the pivot object. If you choose to use the + * latest method, the entities are defined by the unique_key field + * values in the latest object. + *

+ * You must have create_index, index, and + * read privileges on the destination index and read + * and view_index_metadata privileges on the source indices. When + * Elasticsearch security features are enabled, the transform remembers which + * roles the user that created it had at the time of creation and uses those + * same roles. If those roles do not have the required privileges on the source + * and destination indices, the transform fails when it attempts unauthorized + * operations. + *

+ * NOTE: You must use Kibana or this API to create a transform. Do not add a + * transform directly into any .transform-internal* indices using + * the Elasticsearch index API. If Elasticsearch security features are enabled, + * do not give users any privileges on .transform-internal* + * indices. If you used transforms prior to 7.5, also do not give users any + * privileges on .data-frame-internal* indices. * * @param fn * a function that initializes a builder to create the @@ -290,7 +368,9 @@ public final CompletableFuture putTransform( // ----- Endpoint: transform.reset_transform /** - * Resets an existing transform. + * Resets a transform. Before you can reset it, you must stop it; alternatively, + * use the force query parameter. If the destination index was + * created by the transform, it is deleted. * * @see Documentation @@ -305,7 +385,9 @@ public CompletableFuture resetTransform(ResetTransformRe } /** - * Resets an existing transform. + * Resets a transform. Before you can reset it, you must stop it; alternatively, + * use the force query parameter. If the destination index was + * created by the transform, it is deleted. * * @param fn * a function that initializes a builder to create the @@ -324,6 +406,11 @@ public final CompletableFuture resetTransform( /** * Schedules now a transform. + *

+ * If you _schedule_now a transform, it will process the new data instantly, + * without waiting for the configured frequency interval. After _schedule_now + * API is called, the transform will be processed again at now + frequency + * unless _schedule_now API is called again in the meantime. * * @see Documentation @@ -339,6 +426,11 @@ public CompletableFuture scheduleNowTransform(Sche /** * Schedules now a transform. + *

+ * If you _schedule_now a transform, it will process the new data instantly, + * without waiting for the configured frequency interval. After _schedule_now + * API is called, the transform will be processed again at now + frequency + * unless _schedule_now API is called again in the meantime. * * @param fn * a function that initializes a builder to create the @@ -356,7 +448,29 @@ public final CompletableFuture scheduleNowTransfor // ----- Endpoint: transform.start_transform /** - * Starts one or more transforms. + * Starts a transform. + *

+ * When you start a transform, it creates the destination index if it does not + * already exist. The number_of_shards is set to 1 and + * the auto_expand_replicas is set to 0-1. If it is a + * pivot transform, it deduces the mapping definitions for the destination index + * from the source indices and the transform aggregations. If fields in the + * destination index are derived from scripts (as in the case of + * scripted_metric or bucket_script aggregations), the + * transform uses dynamic mappings unless an index template exists. If it is a + * latest transform, it does not deduce mapping definitions; it uses dynamic + * mappings. To use explicit mappings, create the destination index before you + * start the transform. Alternatively, you can create an index template, though + * it does not affect the deduced mappings in a pivot transform. + *

+ * When the transform starts, a series of validations occur to ensure its + * success. If you deferred validation when you created the transform, they + * occur when you start the transform—​with the exception of privilege checks. + * When Elasticsearch security features are enabled, the transform remembers + * which roles the user that created it had at the time of creation and uses + * those same roles. If those roles do not have the required privileges on the + * source and destination indices, the transform fails when it attempts + * unauthorized operations. * * @see Documentation @@ -371,7 +485,29 @@ public CompletableFuture startTransform(StartTransformRe } /** - * Starts one or more transforms. + * Starts a transform. + *

+ * When you start a transform, it creates the destination index if it does not + * already exist. The number_of_shards is set to 1 and + * the auto_expand_replicas is set to 0-1. If it is a + * pivot transform, it deduces the mapping definitions for the destination index + * from the source indices and the transform aggregations. If fields in the + * destination index are derived from scripts (as in the case of + * scripted_metric or bucket_script aggregations), the + * transform uses dynamic mappings unless an index template exists. If it is a + * latest transform, it does not deduce mapping definitions; it uses dynamic + * mappings. To use explicit mappings, create the destination index before you + * start the transform. Alternatively, you can create an index template, though + * it does not affect the deduced mappings in a pivot transform. + *

+ * When the transform starts, a series of validations occur to ensure its + * success. If you deferred validation when you created the transform, they + * occur when you start the transform—​with the exception of privilege checks. + * When Elasticsearch security features are enabled, the transform remembers + * which roles the user that created it had at the time of creation and uses + * those same roles. If those roles do not have the required privileges on the + * source and destination indices, the transform fails when it attempts + * unauthorized operations. * * @param fn * a function that initializes a builder to create the @@ -423,6 +559,15 @@ public final CompletableFuture stopTransform( /** * Updates certain properties of a transform. + *

+ * All updated properties except description do not take effect + * until after the transform starts the next checkpoint, thus there is data + * consistency in each checkpoint. To use this API, you must have + * read and view_index_metadata privileges for the + * source indices. You must also have index and read + * privileges for the destination index. When Elasticsearch security features + * are enabled, the transform remembers which roles the user who updated it had + * at the time of update and runs with those privileges. * * @see Documentation @@ -438,6 +583,15 @@ public CompletableFuture updateTransform(UpdateTransfor /** * Updates certain properties of a transform. + *

+ * All updated properties except description do not take effect + * until after the transform starts the next checkpoint, thus there is data + * consistency in each checkpoint. To use this API, you must have + * read and view_index_metadata privileges for the + * source indices. You must also have index and read + * privileges for the destination index. When Elasticsearch security features + * are enabled, the transform remembers which roles the user who updated it had + * at the time of update and runs with those privileges. * * @param fn * a function that initializes a builder to create the diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformClient.java index a2b4ebc44..5edc4dbaa 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformClient.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformClient.java @@ -70,7 +70,7 @@ public ElasticsearchTransformClient withTransportOptions(@Nullable TransportOpti // ----- Endpoint: transform.delete_transform /** - * Deletes an existing transform. + * Deletes a transform. * * @see Documentation @@ -86,7 +86,7 @@ public DeleteTransformResponse deleteTransform(DeleteTransformRequest request) } /** - * Deletes an existing transform. + * Deletes a transform. * * @param fn * a function that initializes a builder to create the @@ -188,6 +188,11 @@ public final GetTransformStatsResponse getTransformStats( /** * Previews a transform. + *

+ * It returns a maximum of 100 results. The calculations are based on all the + * current data in the source index. It also generates a list of mappings and + * settings for the destination index. These values are determined based on the + * field types of the source index and the transform aggregations. * * @see Documentation @@ -199,7 +204,7 @@ public PreviewTransformResponse previewTransform(Previe @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) PreviewTransformRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:transform.preview_transform.TTransform", + "co.elastic.clients:Deserializer:transform.preview_transform.Response.TTransform", getDeserializer(tTransformClass)); return this.transport.performRequest(request, endpoint, this.transportOptions); @@ -207,6 +212,11 @@ public PreviewTransformResponse previewTransform(Previe /** * Previews a transform. + *

+ * It returns a maximum of 100 results. The calculations are based on all the + * current data in the source index. It also generates a list of mappings and + * settings for the destination index. These values are determined based on the + * field types of the source index and the transform aggregations. * * @param fn * a function that initializes a builder to create the @@ -224,6 +234,11 @@ public final PreviewTransformResponse previewTransform( /** * Previews a transform. + *

+ * It returns a maximum of 100 results. The calculations are based on all the + * current data in the source index. It also generates a list of mappings and + * settings for the destination index. These values are determined based on the + * field types of the source index and the transform aggregations. * * @see Documentation @@ -235,7 +250,7 @@ public PreviewTransformResponse previewTransform(Previe @SuppressWarnings("unchecked") JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) PreviewTransformRequest._ENDPOINT; endpoint = new EndpointWithResponseMapperAttr<>(endpoint, - "co.elastic.clients:Deserializer:transform.preview_transform.TTransform", + "co.elastic.clients:Deserializer:transform.preview_transform.Response.TTransform", getDeserializer(tTransformType)); return this.transport.performRequest(request, endpoint, this.transportOptions); @@ -243,6 +258,11 @@ public PreviewTransformResponse previewTransform(Previe /** * Previews a transform. + *

+ * It returns a maximum of 100 results. The calculations are based on all the + * current data in the source index. It also generates a list of mappings and + * settings for the destination index. These values are determined based on the + * field types of the source index and the transform aggregations. * * @param fn * a function that initializes a builder to create the @@ -261,7 +281,36 @@ public final PreviewTransformResponse previewTransform( // ----- Endpoint: transform.put_transform /** - * Instantiates a transform. + * Creates a transform. + *

+ * A transform copies data from source indices, transforms it, and persists it + * into an entity-centric destination index. You can also think of the + * destination index as a two-dimensional tabular data structure (known as a + * data frame). The ID for each document in the data frame is generated from a + * hash of the entity, so there is a unique row per entity. + *

+ * You must choose either the latest or pivot method for your transform; you + * cannot use both in a single transform. If you choose to use the pivot method + * for your transform, the entities are defined by the set of + * group_by fields in the pivot object. If you choose to use the + * latest method, the entities are defined by the unique_key field + * values in the latest object. + *

+ * You must have create_index, index, and + * read privileges on the destination index and read + * and view_index_metadata privileges on the source indices. When + * Elasticsearch security features are enabled, the transform remembers which + * roles the user that created it had at the time of creation and uses those + * same roles. If those roles do not have the required privileges on the source + * and destination indices, the transform fails when it attempts unauthorized + * operations. + *

+ * NOTE: You must use Kibana or this API to create a transform. Do not add a + * transform directly into any .transform-internal* indices using + * the Elasticsearch index API. If Elasticsearch security features are enabled, + * do not give users any privileges on .transform-internal* + * indices. If you used transforms prior to 7.5, also do not give users any + * privileges on .data-frame-internal* indices. * * @see Documentation @@ -276,7 +325,36 @@ public PutTransformResponse putTransform(PutTransformRequest request) throws IOE } /** - * Instantiates a transform. + * Creates a transform. + *

+ * A transform copies data from source indices, transforms it, and persists it + * into an entity-centric destination index. You can also think of the + * destination index as a two-dimensional tabular data structure (known as a + * data frame). The ID for each document in the data frame is generated from a + * hash of the entity, so there is a unique row per entity. + *

+ * You must choose either the latest or pivot method for your transform; you + * cannot use both in a single transform. If you choose to use the pivot method + * for your transform, the entities are defined by the set of + * group_by fields in the pivot object. If you choose to use the + * latest method, the entities are defined by the unique_key field + * values in the latest object. + *

+ * You must have create_index, index, and + * read privileges on the destination index and read + * and view_index_metadata privileges on the source indices. When + * Elasticsearch security features are enabled, the transform remembers which + * roles the user that created it had at the time of creation and uses those + * same roles. If those roles do not have the required privileges on the source + * and destination indices, the transform fails when it attempts unauthorized + * operations. + *

+ * NOTE: You must use Kibana or this API to create a transform. Do not add a + * transform directly into any .transform-internal* indices using + * the Elasticsearch index API. If Elasticsearch security features are enabled, + * do not give users any privileges on .transform-internal* + * indices. If you used transforms prior to 7.5, also do not give users any + * privileges on .data-frame-internal* indices. * * @param fn * a function that initializes a builder to create the @@ -295,7 +373,9 @@ public final PutTransformResponse putTransform( // ----- Endpoint: transform.reset_transform /** - * Resets an existing transform. + * Resets a transform. Before you can reset it, you must stop it; alternatively, + * use the force query parameter. If the destination index was + * created by the transform, it is deleted. * * @see Documentation @@ -311,7 +391,9 @@ public ResetTransformResponse resetTransform(ResetTransformRequest request) } /** - * Resets an existing transform. + * Resets a transform. Before you can reset it, you must stop it; alternatively, + * use the force query parameter. If the destination index was + * created by the transform, it is deleted. * * @param fn * a function that initializes a builder to create the @@ -331,6 +413,11 @@ public final ResetTransformResponse resetTransform( /** * Schedules now a transform. + *

+ * If you _schedule_now a transform, it will process the new data instantly, + * without waiting for the configured frequency interval. After _schedule_now + * API is called, the transform will be processed again at now + frequency + * unless _schedule_now API is called again in the meantime. * * @see Documentation @@ -347,6 +434,11 @@ public ScheduleNowTransformResponse scheduleNowTransform(ScheduleNowTransformReq /** * Schedules now a transform. + *

+ * If you _schedule_now a transform, it will process the new data instantly, + * without waiting for the configured frequency interval. After _schedule_now + * API is called, the transform will be processed again at now + frequency + * unless _schedule_now API is called again in the meantime. * * @param fn * a function that initializes a builder to create the @@ -365,7 +457,29 @@ public final ScheduleNowTransformResponse scheduleNowTransform( // ----- Endpoint: transform.start_transform /** - * Starts one or more transforms. + * Starts a transform. + *

+ * When you start a transform, it creates the destination index if it does not + * already exist. The number_of_shards is set to 1 and + * the auto_expand_replicas is set to 0-1. If it is a + * pivot transform, it deduces the mapping definitions for the destination index + * from the source indices and the transform aggregations. If fields in the + * destination index are derived from scripts (as in the case of + * scripted_metric or bucket_script aggregations), the + * transform uses dynamic mappings unless an index template exists. If it is a + * latest transform, it does not deduce mapping definitions; it uses dynamic + * mappings. To use explicit mappings, create the destination index before you + * start the transform. Alternatively, you can create an index template, though + * it does not affect the deduced mappings in a pivot transform. + *

+ * When the transform starts, a series of validations occur to ensure its + * success. If you deferred validation when you created the transform, they + * occur when you start the transform—​with the exception of privilege checks. + * When Elasticsearch security features are enabled, the transform remembers + * which roles the user that created it had at the time of creation and uses + * those same roles. If those roles do not have the required privileges on the + * source and destination indices, the transform fails when it attempts + * unauthorized operations. * * @see Documentation @@ -381,7 +495,29 @@ public StartTransformResponse startTransform(StartTransformRequest request) } /** - * Starts one or more transforms. + * Starts a transform. + *

+ * When you start a transform, it creates the destination index if it does not + * already exist. The number_of_shards is set to 1 and + * the auto_expand_replicas is set to 0-1. If it is a + * pivot transform, it deduces the mapping definitions for the destination index + * from the source indices and the transform aggregations. If fields in the + * destination index are derived from scripts (as in the case of + * scripted_metric or bucket_script aggregations), the + * transform uses dynamic mappings unless an index template exists. If it is a + * latest transform, it does not deduce mapping definitions; it uses dynamic + * mappings. To use explicit mappings, create the destination index before you + * start the transform. Alternatively, you can create an index template, though + * it does not affect the deduced mappings in a pivot transform. + *

+ * When the transform starts, a series of validations occur to ensure its + * success. If you deferred validation when you created the transform, they + * occur when you start the transform—​with the exception of privilege checks. + * When Elasticsearch security features are enabled, the transform remembers + * which roles the user that created it had at the time of creation and uses + * those same roles. If those roles do not have the required privileges on the + * source and destination indices, the transform fails when it attempts + * unauthorized operations. * * @param fn * a function that initializes a builder to create the @@ -436,6 +572,15 @@ public final StopTransformResponse stopTransform( /** * Updates certain properties of a transform. + *

+ * All updated properties except description do not take effect + * until after the transform starts the next checkpoint, thus there is data + * consistency in each checkpoint. To use this API, you must have + * read and view_index_metadata privileges for the + * source indices. You must also have index and read + * privileges for the destination index. When Elasticsearch security features + * are enabled, the transform remembers which roles the user who updated it had + * at the time of update and runs with those privileges. * * @see Documentation @@ -452,6 +597,15 @@ public UpdateTransformResponse updateTransform(UpdateTransformRequest request) /** * Updates certain properties of a transform. + *

+ * All updated properties except description do not take effect + * until after the transform starts the next checkpoint, thus there is data + * consistency in each checkpoint. To use this API, you must have + * read and view_index_metadata privileges for the + * source indices. You must also have index and read + * privileges for the destination index. When Elasticsearch security features + * are enabled, the transform remembers which roles the user who updated it had + * at the time of update and runs with those privileges. * * @param fn * a function that initializes a builder to create the diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/PreviewTransformResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/PreviewTransformResponse.java index d9f3e440b..d5f035f76 100644 --- a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/PreviewTransformResponse.java +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/PreviewTransformResponse.java @@ -227,8 +227,8 @@ public static JsonpDeserializer> _DESERIALIZER = JsonpDeserializer - .lazy(() -> createPreviewTransformResponseDeserializer( - new NamedDeserializer<>("co.elastic.clients:Deserializer:transform.preview_transform.TTransform"))); + .lazy(() -> createPreviewTransformResponseDeserializer(new NamedDeserializer<>( + "co.elastic.clients:Deserializer:transform.preview_transform.Response.TTransform"))); protected static void setupPreviewTransformResponseDeserializer( ObjectDeserializer> op, diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlAdapter.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlAdapter.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlAdapter.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlAdapter.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlAdapterBase.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlAdapterBase.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlAdapterBase.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlAdapterBase.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlHelper.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlHelper.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlHelper.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlHelper.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlMetadata.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlMetadata.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlMetadata.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/EsqlMetadata.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/Cursor.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/Cursor.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/Cursor.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/Cursor.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/EsType.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/EsType.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/EsType.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/EsType.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/ExtraTypes.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/ExtraTypes.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/ExtraTypes.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/ExtraTypes.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcColumnInfo.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcColumnInfo.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcColumnInfo.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcColumnInfo.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcDateUtils.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcDateUtils.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcDateUtils.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcDateUtils.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcResultSet.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcResultSet.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcResultSet.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcResultSet.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcResultSetMetaData.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcResultSetMetaData.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcResultSetMetaData.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcResultSetMetaData.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcWrapper.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcWrapper.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcWrapper.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JdbcWrapper.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JsonpCursor.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JsonpCursor.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JsonpCursor.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/JsonpCursor.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/ResultSetEsqlAdapter.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/ResultSetEsqlAdapter.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/ResultSetEsqlAdapter.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/ResultSetEsqlAdapter.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/StringUtils.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/StringUtils.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/StringUtils.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/StringUtils.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/TypeConverter.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/TypeConverter.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/TypeConverter.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/TypeConverter.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/TypeUtils.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/TypeUtils.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/TypeUtils.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/jdbc/TypeUtils.java diff --git a/java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/objects/ObjectsEsqlAdapter.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/objects/ObjectsEsqlAdapter.java similarity index 100% rename from java-client/src/main-flavored/java/co/elastic/clients/elasticsearch/_helpers/esql/objects/ObjectsEsqlAdapter.java rename to java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers/esql/objects/ObjectsEsqlAdapter.java diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html index 30a463039..ef2d61929 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html @@ -1279,18 +1279,18 @@ 'indices._types.IndexTemplateDataStreamConfiguration': 'indices/_types/IndexTemplate.ts#L72-L83', 'indices._types.IndexTemplateSummary': 'indices/_types/IndexTemplate.ts#L85-L107', 'indices._types.IndexVersioning': 'indices/_types/IndexSettings.ts#L269-L272', -'indices._types.IndexingPressure': 'indices/_types/IndexSettings.ts#L539-L541', -'indices._types.IndexingPressureMemory': 'indices/_types/IndexSettings.ts#L543-L550', -'indices._types.IndexingSlowlogSettings': 'indices/_types/IndexSettings.ts#L552-L557', -'indices._types.IndexingSlowlogTresholds': 'indices/_types/IndexSettings.ts#L559-L566', +'indices._types.IndexingPressure': 'indices/_types/IndexSettings.ts#L548-L550', +'indices._types.IndexingPressureMemory': 'indices/_types/IndexSettings.ts#L552-L559', +'indices._types.IndexingSlowlogSettings': 'indices/_types/IndexSettings.ts#L561-L566', +'indices._types.IndexingSlowlogTresholds': 'indices/_types/IndexSettings.ts#L568-L575', 'indices._types.ManagedBy': 'indices/_types/DataStream.ts#L32-L37', 'indices._types.MappingLimitSettings': 'indices/_types/IndexSettings.ts#L409-L422', -'indices._types.MappingLimitSettingsDepth': 'indices/_types/IndexSettings.ts#L434-L441', -'indices._types.MappingLimitSettingsDimensionFields': 'indices/_types/IndexSettings.ts#L471-L477', -'indices._types.MappingLimitSettingsFieldNameLength': 'indices/_types/IndexSettings.ts#L462-L469', -'indices._types.MappingLimitSettingsNestedFields': 'indices/_types/IndexSettings.ts#L443-L451', -'indices._types.MappingLimitSettingsNestedObjects': 'indices/_types/IndexSettings.ts#L453-L460', -'indices._types.MappingLimitSettingsTotalFields': 'indices/_types/IndexSettings.ts#L424-L432', +'indices._types.MappingLimitSettingsDepth': 'indices/_types/IndexSettings.ts#L443-L450', +'indices._types.MappingLimitSettingsDimensionFields': 'indices/_types/IndexSettings.ts#L480-L486', +'indices._types.MappingLimitSettingsFieldNameLength': 'indices/_types/IndexSettings.ts#L471-L478', +'indices._types.MappingLimitSettingsNestedFields': 'indices/_types/IndexSettings.ts#L452-L460', +'indices._types.MappingLimitSettingsNestedObjects': 'indices/_types/IndexSettings.ts#L462-L469', +'indices._types.MappingLimitSettingsTotalFields': 'indices/_types/IndexSettings.ts#L424-L441', 'indices._types.Merge': 'indices/_types/IndexSettings.ts#L330-L332', 'indices._types.MergeScheduler': 'indices/_types/IndexSettings.ts#L334-L337', 'indices._types.NumericFielddata': 'indices/_types/NumericFielddata.ts#L22-L24', @@ -1314,12 +1314,12 @@ 'indices._types.SettingsSimilarityLmd': 'indices/_types/IndexSettings.ts#L212-L215', 'indices._types.SettingsSimilarityLmj': 'indices/_types/IndexSettings.ts#L217-L220', 'indices._types.SettingsSimilarityScripted': 'indices/_types/IndexSettings.ts#L222-L226', -'indices._types.SlowlogSettings': 'indices/_types/IndexSettings.ts#L479-L484', -'indices._types.SlowlogTresholdLevels': 'indices/_types/IndexSettings.ts#L491-L496', -'indices._types.SlowlogTresholds': 'indices/_types/IndexSettings.ts#L486-L489', +'indices._types.SlowlogSettings': 'indices/_types/IndexSettings.ts#L488-L493', +'indices._types.SlowlogTresholdLevels': 'indices/_types/IndexSettings.ts#L500-L505', +'indices._types.SlowlogTresholds': 'indices/_types/IndexSettings.ts#L495-L498', 'indices._types.SoftDeletes': 'indices/_types/IndexSettings.ts#L50-L63', -'indices._types.Storage': 'indices/_types/IndexSettings.ts#L498-L507', -'indices._types.StorageType': 'indices/_types/IndexSettings.ts#L509-L537', +'indices._types.Storage': 'indices/_types/IndexSettings.ts#L507-L516', +'indices._types.StorageType': 'indices/_types/IndexSettings.ts#L518-L546', 'indices._types.TemplateMapping': 'indices/_types/TemplateMapping.ts#L27-L34', 'indices._types.Translog': 'indices/_types/IndexSettings.ts#L339-L361', 'indices._types.TranslogDurability': 'indices/_types/IndexSettings.ts#L363-L378', @@ -2731,10 +2731,10 @@ if (hash.length > 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/d15b4fd799a29465696f37ebaf16ed99af88f0b6/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/21b532fe17fbe3d4dbcd224a54dd8c5e3670d56c/specification/" + (paths[hash] || ""); - Please see the Elasticsearch API specification. + Please see the Elasticsearch API specification. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java index ef6c25782..ace492270 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java @@ -29,6 +29,7 @@ import co.elastic.clients.util.ObjectBuilder; import co.elastic.clients.util.WithJsonObjectBuilderBase; import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; import java.lang.Long; import java.util.Objects; import java.util.function.Function; @@ -62,11 +63,15 @@ public class MappingLimitSettingsTotalFields implements JsonpSerializable { @Nullable private final Long limit; + @Nullable + private final Boolean ignoreDynamicBeyondLimit; + // --------------------------------------------------------------------------------------------- private MappingLimitSettingsTotalFields(Builder builder) { this.limit = builder.limit; + this.ignoreDynamicBeyondLimit = builder.ignoreDynamicBeyondLimit; } @@ -89,6 +94,22 @@ public final Long limit() { return this.limit; } + /** + * This setting determines what happens when a dynamically mapped field would + * exceed the total fields limit. When set to false (the default), the index + * request of the document that tries to add a dynamic field to the mapping will + * fail with the message Limit of total fields [X] has been exceeded. When set + * to true, the index request will not fail. Instead, fields that would exceed + * the limit are not added to the mapping, similar to dynamic: false. The fields + * that were not added to the mapping will be added to the _ignored field. + *

+ * API name: {@code ignore_dynamic_beyond_limit} + */ + @Nullable + public final Boolean ignoreDynamicBeyondLimit() { + return this.ignoreDynamicBeyondLimit; + } + /** * Serialize this object to JSON. */ @@ -105,6 +126,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.limit); } + if (this.ignoreDynamicBeyondLimit != null) { + generator.writeKey("ignore_dynamic_beyond_limit"); + generator.write(this.ignoreDynamicBeyondLimit); + + } } @@ -125,6 +151,9 @@ public static class Builder extends WithJsonObjectBuilderBase @Nullable private Long limit; + @Nullable + private Boolean ignoreDynamicBeyondLimit; + /** * The maximum number of fields in an index. Field and object mappings, as well * as field aliases count towards this limit. The limit is in place to prevent @@ -139,6 +168,22 @@ public final Builder limit(@Nullable Long value) { return this; } + /** + * This setting determines what happens when a dynamically mapped field would + * exceed the total fields limit. When set to false (the default), the index + * request of the document that tries to add a dynamic field to the mapping will + * fail with the message Limit of total fields [X] has been exceeded. When set + * to true, the index request will not fail. Instead, fields that would exceed + * the limit are not added to the mapping, similar to dynamic: false. The fields + * that were not added to the mapping will be added to the _ignored field. + *

+ * API name: {@code ignore_dynamic_beyond_limit} + */ + public final Builder ignoreDynamicBeyondLimit(@Nullable Boolean value) { + this.ignoreDynamicBeyondLimit = value; + return this; + } + @Override protected Builder self() { return this; @@ -169,6 +214,8 @@ protected static void setupMappingLimitSettingsTotalFieldsDeserializer( ObjectDeserializer op) { op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); + op.add(Builder::ignoreDynamicBeyondLimit, JsonpDeserializer.booleanDeserializer(), + "ignore_dynamic_beyond_limit"); } diff --git a/java-client/src/test/java/co/elastic/clients/json/jackson/JacksonJsonpParserTest.java b/java-client/src/test/java/co/elastic/clients/json/jackson/JacksonJsonpParserTest.java index 282c3d8dd..3ac15c3f6 100644 --- a/java-client/src/test/java/co/elastic/clients/json/jackson/JacksonJsonpParserTest.java +++ b/java-client/src/test/java/co/elastic/clients/json/jackson/JacksonJsonpParserTest.java @@ -20,9 +20,9 @@ package co.elastic.clients.json.jackson; import co.elastic.clients.elasticsearch.core.MsearchResponse; -import co.elastic.clients.testkit.ModelTestCase; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.testkit.ModelTestCase; import jakarta.json.stream.JsonParser; import jakarta.json.stream.JsonParser.Event; import org.junit.jupiter.api.Test; @@ -31,7 +31,8 @@ public class JacksonJsonpParserTest extends ModelTestCase { - private static final String json = "{ 'foo': 'fooValue', 'bar': { 'baz': 1}, 'quux': [true] }".replace('\'', '"'); + private static final String json = + "{ 'foo': 'fooValue', 'bar': { 'baz': 1}, 'quux': [true] }".replace('\'', '"'); @Test public void testEventStream() { @@ -93,12 +94,13 @@ public void testForbidValueGettersAfterHasNext() { try { assertEquals("fooValue", parser.getString()); fail(); - } catch(IllegalStateException e) { + } catch (IllegalStateException e) { // expected } } - @Test void testMultiSearchResponse() { + @Test + void testMultiSearchResponse() { String json = "{\n" + " \"took\" : 1,\n" + @@ -157,7 +159,8 @@ public void testForbidValueGettersAfterHasNext() { "}\n"; JsonpMapper mapper = new JacksonJsonpMapper(); - mapper = mapper.withAttribute("co.elastic.clients:Deserializer:_global.msearch.Response.TDocument", JsonpDeserializer.of(Foo.class)); + mapper = mapper.withAttribute("co.elastic.clients:Deserializer:_global.msearch.Response.TDocument", + JsonpDeserializer.of(Foo.class)); @SuppressWarnings("unchecked") MsearchResponse response = fromJson(json, MsearchResponse.class, mapper);