Skip to content

Commit 33414f5

Browse files
committed
[codegen] update to latest spec
1 parent db489eb commit 33414f5

121 files changed

Lines changed: 6033 additions & 2080 deletions

File tree

Some content is hidden

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

java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@
127127
import co.elastic.clients.elasticsearch.monitoring.ElasticsearchMonitoringAsyncClient;
128128
import co.elastic.clients.elasticsearch.nodes.ElasticsearchNodesAsyncClient;
129129
import co.elastic.clients.elasticsearch.project.ElasticsearchProjectAsyncClient;
130-
import co.elastic.clients.elasticsearch.project_routing.ElasticsearchProjectRoutingAsyncClient;
131130
import co.elastic.clients.elasticsearch.query_rules.ElasticsearchQueryRulesAsyncClient;
132131
import co.elastic.clients.elasticsearch.rollup.ElasticsearchRollupAsyncClient;
133132
import co.elastic.clients.elasticsearch.search_application.ElasticsearchSearchApplicationAsyncClient;
@@ -309,10 +308,6 @@ public ElasticsearchProjectAsyncClient project() {
309308
return new ElasticsearchProjectAsyncClient(this.transport, this.transportOptions);
310309
}
311310

312-
public ElasticsearchProjectRoutingAsyncClient projectRouting() {
313-
return new ElasticsearchProjectRoutingAsyncClient(this.transport, this.transportOptions);
314-
}
315-
316311
public ElasticsearchQueryRulesAsyncClient queryRules() {
317312
return new ElasticsearchQueryRulesAsyncClient(this.transport, this.transportOptions);
318313
}

java-client/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@
128128
import co.elastic.clients.elasticsearch.monitoring.ElasticsearchMonitoringClient;
129129
import co.elastic.clients.elasticsearch.nodes.ElasticsearchNodesClient;
130130
import co.elastic.clients.elasticsearch.project.ElasticsearchProjectClient;
131-
import co.elastic.clients.elasticsearch.project_routing.ElasticsearchProjectRoutingClient;
132131
import co.elastic.clients.elasticsearch.query_rules.ElasticsearchQueryRulesClient;
133132
import co.elastic.clients.elasticsearch.rollup.ElasticsearchRollupClient;
134133
import co.elastic.clients.elasticsearch.search_application.ElasticsearchSearchApplicationClient;
@@ -309,10 +308,6 @@ public ElasticsearchProjectClient project() {
309308
return new ElasticsearchProjectClient(this.transport, this.transportOptions);
310309
}
311310

312-
public ElasticsearchProjectRoutingClient projectRouting() {
313-
return new ElasticsearchProjectRoutingClient(this.transport, this.transportOptions);
314-
}
315-
316311
public ElasticsearchQueryRulesClient queryRules() {
317312
return new ElasticsearchQueryRulesClient(this.transport, this.transportOptions);
318313
}

java-client/src/main/java/co/elastic/clients/elasticsearch/_types/KnnSearch.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ public class KnnSearch implements JsonpSerializable {
9595
@Nullable
9696
private final RescoreVector rescoreVector;
9797

98+
@Nullable
99+
private final String queryName;
100+
98101
// ---------------------------------------------------------------------------------------------
99102

100103
private KnnSearch(Builder builder) {
@@ -110,6 +113,7 @@ private KnnSearch(Builder builder) {
110113
this.similarity = builder.similarity;
111114
this.innerHits = builder.innerHits;
112115
this.rescoreVector = builder.rescoreVector;
116+
this.queryName = builder.queryName;
113117

114118
}
115119

@@ -226,6 +230,14 @@ public final RescoreVector rescoreVector() {
226230
return this.rescoreVector;
227231
}
228232

233+
/**
234+
* API name: {@code _name}
235+
*/
236+
@Nullable
237+
public final String queryName() {
238+
return this.queryName;
239+
}
240+
229241
/**
230242
* Serialize this object to JSON.
231243
*/
@@ -300,6 +312,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
300312
this.rescoreVector.serialize(generator, mapper);
301313

302314
}
315+
if (this.queryName != null) {
316+
generator.writeKey("_name");
317+
generator.write(this.queryName);
318+
319+
}
303320

304321
}
305322

@@ -347,6 +364,9 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder> implement
347364
@Nullable
348365
private RescoreVector rescoreVector;
349366

367+
@Nullable
368+
private String queryName;
369+
350370
public Builder() {
351371
}
352372
private Builder(KnnSearch instance) {
@@ -361,6 +381,7 @@ private Builder(KnnSearch instance) {
361381
this.similarity = instance.similarity;
362382
this.innerHits = instance.innerHits;
363383
this.rescoreVector = instance.rescoreVector;
384+
this.queryName = instance.queryName;
364385

365386
}
366387
/**
@@ -569,6 +590,14 @@ public final Builder rescoreVector(Function<RescoreVector.Builder, ObjectBuilder
569590
return this.rescoreVector(fn.apply(new RescoreVector.Builder()).build());
570591
}
571592

593+
/**
594+
* API name: {@code _name}
595+
*/
596+
public final Builder queryName(@Nullable String value) {
597+
this.queryName = value;
598+
return this;
599+
}
600+
572601
@Override
573602
protected Builder self() {
574603
return this;
@@ -615,6 +644,7 @@ protected static void setupKnnSearchDeserializer(ObjectDeserializer<KnnSearch.Bu
615644
op.add(Builder::similarity, JsonpDeserializer.floatDeserializer(), "similarity");
616645
op.add(Builder::innerHits, InnerHits._DESERIALIZER, "inner_hits");
617646
op.add(Builder::rescoreVector, RescoreVector._DESERIALIZER, "rescore_vector");
647+
op.add(Builder::queryName, JsonpDeserializer.stringDeserializer(), "_name");
618648

619649
}
620650

Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,273 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package co.elastic.clients.elasticsearch._types;
21+
22+
import co.elastic.clients.json.JsonpDeserializable;
23+
import co.elastic.clients.json.JsonpDeserializer;
24+
import co.elastic.clients.json.JsonpMapper;
25+
import co.elastic.clients.json.JsonpSerializable;
26+
import co.elastic.clients.json.JsonpUtils;
27+
import co.elastic.clients.json.ObjectBuilderDeserializer;
28+
import co.elastic.clients.json.ObjectDeserializer;
29+
import co.elastic.clients.util.ApiTypeHelper;
30+
import co.elastic.clients.util.ObjectBuilder;
31+
import co.elastic.clients.util.WithJsonObjectBuilderBase;
32+
import jakarta.json.stream.JsonGenerator;
33+
import java.lang.String;
34+
import java.util.Objects;
35+
import java.util.function.Function;
36+
import javax.annotation.Nullable;
37+
38+
//----------------------------------------------------------------
39+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
40+
//----------------------------------------------------------------
41+
//
42+
// This code is generated from the Elasticsearch API specification
43+
// at https://github.com/elastic/elasticsearch-specification
44+
//
45+
// Manual updates to this file will be lost when the code is
46+
// re-generated.
47+
//
48+
// If you find a property that is missing or wrongly typed, please
49+
// open an issue or a PR on the API specification repository.
50+
//
51+
//----------------------------------------------------------------
52+
53+
// typedef: _types.LookupQueryVectorBuilder
54+
55+
/**
56+
*
57+
* @see <a href="../doc-files/api-spec.html#_types.LookupQueryVectorBuilder">API
58+
* specification</a>
59+
*/
60+
@JsonpDeserializable
61+
public class LookupQueryVectorBuilder implements QueryVectorBuilderVariant, JsonpSerializable {
62+
private final String id;
63+
64+
private final String index;
65+
66+
private final String path;
67+
68+
@Nullable
69+
private final String routing;
70+
71+
// ---------------------------------------------------------------------------------------------
72+
73+
private LookupQueryVectorBuilder(Builder builder) {
74+
75+
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
76+
this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index");
77+
this.path = ApiTypeHelper.requireNonNull(builder.path, this, "path");
78+
this.routing = builder.routing;
79+
80+
}
81+
82+
public static LookupQueryVectorBuilder of(Function<Builder, ObjectBuilder<LookupQueryVectorBuilder>> fn) {
83+
return fn.apply(new Builder()).build();
84+
}
85+
86+
/**
87+
* QueryVectorBuilder variant kind.
88+
*/
89+
@Override
90+
public QueryVectorBuilder.Kind _queryVectorBuilderKind() {
91+
return QueryVectorBuilder.Kind.Lookup;
92+
}
93+
94+
/**
95+
* Required - The ID of the document to fetch the vector from
96+
* <p>
97+
* API name: {@code id}
98+
*/
99+
public final String id() {
100+
return this.id;
101+
}
102+
103+
/**
104+
* Required - The name of the index to fetch the document from
105+
* <p>
106+
* API name: {@code index}
107+
*/
108+
public final String index() {
109+
return this.index;
110+
}
111+
112+
/**
113+
* Required - The name of the field containing the vector
114+
* <p>
115+
* API name: {@code path}
116+
*/
117+
public final String path() {
118+
return this.path;
119+
}
120+
121+
/**
122+
* The routing value to use when fetching the document
123+
* <p>
124+
* API name: {@code routing}
125+
*/
126+
@Nullable
127+
public final String routing() {
128+
return this.routing;
129+
}
130+
131+
/**
132+
* Serialize this object to JSON.
133+
*/
134+
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
135+
generator.writeStartObject();
136+
serializeInternal(generator, mapper);
137+
generator.writeEnd();
138+
}
139+
140+
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
141+
142+
generator.writeKey("id");
143+
generator.write(this.id);
144+
145+
generator.writeKey("index");
146+
generator.write(this.index);
147+
148+
generator.writeKey("path");
149+
generator.write(this.path);
150+
151+
if (this.routing != null) {
152+
generator.writeKey("routing");
153+
generator.write(this.routing);
154+
155+
}
156+
157+
}
158+
159+
@Override
160+
public String toString() {
161+
return JsonpUtils.toString(this);
162+
}
163+
164+
// ---------------------------------------------------------------------------------------------
165+
166+
/**
167+
* Builder for {@link LookupQueryVectorBuilder}.
168+
*/
169+
170+
public static class Builder extends WithJsonObjectBuilderBase<Builder>
171+
implements
172+
ObjectBuilder<LookupQueryVectorBuilder> {
173+
private String id;
174+
175+
private String index;
176+
177+
private String path;
178+
179+
@Nullable
180+
private String routing;
181+
182+
public Builder() {
183+
}
184+
private Builder(LookupQueryVectorBuilder instance) {
185+
this.id = instance.id;
186+
this.index = instance.index;
187+
this.path = instance.path;
188+
this.routing = instance.routing;
189+
190+
}
191+
/**
192+
* Required - The ID of the document to fetch the vector from
193+
* <p>
194+
* API name: {@code id}
195+
*/
196+
public final Builder id(String value) {
197+
this.id = value;
198+
return this;
199+
}
200+
201+
/**
202+
* Required - The name of the index to fetch the document from
203+
* <p>
204+
* API name: {@code index}
205+
*/
206+
public final Builder index(String value) {
207+
this.index = value;
208+
return this;
209+
}
210+
211+
/**
212+
* Required - The name of the field containing the vector
213+
* <p>
214+
* API name: {@code path}
215+
*/
216+
public final Builder path(String value) {
217+
this.path = value;
218+
return this;
219+
}
220+
221+
/**
222+
* The routing value to use when fetching the document
223+
* <p>
224+
* API name: {@code routing}
225+
*/
226+
public final Builder routing(@Nullable String value) {
227+
this.routing = value;
228+
return this;
229+
}
230+
231+
@Override
232+
protected Builder self() {
233+
return this;
234+
}
235+
236+
/**
237+
* Builds a {@link LookupQueryVectorBuilder}.
238+
*
239+
* @throws NullPointerException
240+
* if some of the required fields are null.
241+
*/
242+
public LookupQueryVectorBuilder build() {
243+
_checkSingleUse();
244+
245+
return new LookupQueryVectorBuilder(this);
246+
}
247+
}
248+
249+
/**
250+
* @return New {@link Builder} initialized with field values of this instance
251+
*/
252+
public Builder rebuild() {
253+
return new Builder(this);
254+
}
255+
// ---------------------------------------------------------------------------------------------
256+
257+
/**
258+
* Json deserializer for {@link LookupQueryVectorBuilder}
259+
*/
260+
public static final JsonpDeserializer<LookupQueryVectorBuilder> _DESERIALIZER = ObjectBuilderDeserializer
261+
.lazy(Builder::new, LookupQueryVectorBuilder::setupLookupQueryVectorBuilderDeserializer);
262+
263+
protected static void setupLookupQueryVectorBuilderDeserializer(
264+
ObjectDeserializer<LookupQueryVectorBuilder.Builder> op) {
265+
266+
op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id");
267+
op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index");
268+
op.add(Builder::path, JsonpDeserializer.stringDeserializer(), "path");
269+
op.add(Builder::routing, JsonpDeserializer.stringDeserializer(), "routing");
270+
271+
}
272+
273+
}

0 commit comments

Comments
 (0)