Skip to content

Commit dae1f43

Browse files
committed
[codegen] update to latest spec
1 parent 3c6ba9f commit dae1f43

16 files changed

+1212
-214
lines changed

java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearchStatusRequest.java

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import co.elastic.clients.elasticsearch._types.ErrorResponse;
2323
import co.elastic.clients.elasticsearch._types.RequestBase;
24+
import co.elastic.clients.elasticsearch._types.Time;
2425
import co.elastic.clients.json.JsonpDeserializable;
2526
import co.elastic.clients.json.JsonpDeserializer;
2627
import co.elastic.clients.json.ObjectBuilderDeserializer;
@@ -31,7 +32,6 @@
3132
import co.elastic.clients.util.ObjectBuilder;
3233
import jakarta.json.stream.JsonGenerator;
3334
import java.lang.String;
34-
import java.util.Collections;
3535
import java.util.HashMap;
3636
import java.util.Map;
3737
import java.util.Objects;
@@ -70,11 +70,15 @@
7070
public class AsyncSearchStatusRequest extends RequestBase {
7171
private final String id;
7272

73+
@Nullable
74+
private final Time keepAlive;
75+
7376
// ---------------------------------------------------------------------------------------------
7477

7578
private AsyncSearchStatusRequest(Builder builder) {
7679

7780
this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id");
81+
this.keepAlive = builder.keepAlive;
7882

7983
}
8084

@@ -91,6 +95,17 @@ public final String id() {
9195
return this.id;
9296
}
9397

98+
/**
99+
* Specifies how long the async search needs to be available. Ongoing async
100+
* searches and any saved search results are deleted after this period.
101+
* <p>
102+
* API name: {@code keep_alive}
103+
*/
104+
@Nullable
105+
public final Time keepAlive() {
106+
return this.keepAlive;
107+
}
108+
94109
// ---------------------------------------------------------------------------------------------
95110

96111
/**
@@ -102,6 +117,9 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder>
102117
ObjectBuilder<AsyncSearchStatusRequest> {
103118
private String id;
104119

120+
@Nullable
121+
private Time keepAlive;
122+
105123
/**
106124
* Required - A unique identifier for the async search.
107125
* <p>
@@ -112,6 +130,27 @@ public final Builder id(String value) {
112130
return this;
113131
}
114132

133+
/**
134+
* Specifies how long the async search needs to be available. Ongoing async
135+
* searches and any saved search results are deleted after this period.
136+
* <p>
137+
* API name: {@code keep_alive}
138+
*/
139+
public final Builder keepAlive(@Nullable Time value) {
140+
this.keepAlive = value;
141+
return this;
142+
}
143+
144+
/**
145+
* Specifies how long the async search needs to be available. Ongoing async
146+
* searches and any saved search results are deleted after this period.
147+
* <p>
148+
* API name: {@code keep_alive}
149+
*/
150+
public final Builder keepAlive(Function<Time.Builder, ObjectBuilder<Time>> fn) {
151+
return this.keepAlive(fn.apply(new Time.Builder()).build());
152+
}
153+
115154
@Override
116155
protected Builder self() {
117156
return this;
@@ -181,7 +220,11 @@ public AsyncSearchStatusRequest build() {
181220

182221
// Request parameters
183222
request -> {
184-
return Collections.emptyMap();
223+
Map<String, String> params = new HashMap<>();
224+
if (request.keepAlive != null) {
225+
params.put("keep_alive", request.keepAlive._toJsonString());
226+
}
227+
return params;
185228

186229
}, SimpleEndpoint.emptyMap(), false, AsyncSearchStatusResponse._DESERIALIZER);
187230
}

java-client/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,6 @@ public class SubmitRequest extends RequestBase implements JsonpSerializable {
217217

218218
private final Map<String, ScriptField> scriptFields;
219219

220-
@Nullable
221-
private final Time scroll;
222-
223220
private final List<FieldValue> searchAfter;
224221

225222
@Nullable
@@ -306,7 +303,6 @@ private SubmitRequest(Builder builder) {
306303
this.routing = builder.routing;
307304
this.runtimeMappings = ApiTypeHelper.unmodifiable(builder.runtimeMappings);
308305
this.scriptFields = ApiTypeHelper.unmodifiable(builder.scriptFields);
309-
this.scroll = builder.scroll;
310306
this.searchAfter = ApiTypeHelper.unmodifiable(builder.searchAfter);
311307
this.searchType = builder.searchType;
312308
this.seqNoPrimaryTerm = builder.seqNoPrimaryTerm;
@@ -744,14 +740,6 @@ public final Map<String, ScriptField> scriptFields() {
744740
return this.scriptFields;
745741
}
746742

747-
/**
748-
* API name: {@code scroll}
749-
*/
750-
@Nullable
751-
public final Time scroll() {
752-
return this.scroll;
753-
}
754-
755743
/**
756744
* API name: {@code search_after}
757745
*/
@@ -1296,9 +1284,6 @@ public static class Builder extends RequestBase.AbstractBuilder<Builder> impleme
12961284
@Nullable
12971285
private Map<String, ScriptField> scriptFields;
12981286

1299-
@Nullable
1300-
private Time scroll;
1301-
13021287
@Nullable
13031288
private List<FieldValue> searchAfter;
13041289

@@ -2062,21 +2047,6 @@ public final Builder scriptFields(String key, Function<ScriptField.Builder, Obje
20622047
return scriptFields(key, fn.apply(new ScriptField.Builder()).build());
20632048
}
20642049

2065-
/**
2066-
* API name: {@code scroll}
2067-
*/
2068-
public final Builder scroll(@Nullable Time value) {
2069-
this.scroll = value;
2070-
return this;
2071-
}
2072-
2073-
/**
2074-
* API name: {@code scroll}
2075-
*/
2076-
public final Builder scroll(Function<Time.Builder, ObjectBuilder<Time>> fn) {
2077-
return this.scroll(fn.apply(new Time.Builder()).build());
2078-
}
2079-
20802050
/**
20812051
* API name: {@code search_after}
20822052
* <p>
@@ -2587,9 +2557,6 @@ protected static void setupSubmitRequestDeserializer(ObjectDeserializer<SubmitRe
25872557
if (request.analyzeWildcard != null) {
25882558
params.put("analyze_wildcard", String.valueOf(request.analyzeWildcard));
25892559
}
2590-
if (request.scroll != null) {
2591-
params.put("scroll", request.scroll._toJsonString());
2592-
}
25932560
if (request.waitForCompletionTimeout != null) {
25942561
params.put("wait_for_completion_timeout", request.waitForCompletionTimeout._toJsonString());
25952562
}

java-client/src/main/java/co/elastic/clients/elasticsearch/autoscaling/DeleteAutoscalingPolicyRequest.java

Lines changed: 87 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import co.elastic.clients.elasticsearch._types.ErrorResponse;
2323
import co.elastic.clients.elasticsearch._types.RequestBase;
24+
import co.elastic.clients.elasticsearch._types.Time;
2425
import co.elastic.clients.json.JsonpDeserializable;
2526
import co.elastic.clients.json.JsonpDeserializer;
2627
import co.elastic.clients.json.ObjectBuilderDeserializer;
@@ -31,7 +32,6 @@
3132
import co.elastic.clients.util.ObjectBuilder;
3233
import jakarta.json.stream.JsonGenerator;
3334
import java.lang.String;
34-
import java.util.Collections;
3535
import java.util.HashMap;
3636
import java.util.Map;
3737
import java.util.Objects;
@@ -68,13 +68,21 @@
6868
*/
6969

7070
public class DeleteAutoscalingPolicyRequest extends RequestBase {
71+
@Nullable
72+
private final Time masterTimeout;
73+
7174
private final String name;
7275

76+
@Nullable
77+
private final Time timeout;
78+
7379
// ---------------------------------------------------------------------------------------------
7480

7581
private DeleteAutoscalingPolicyRequest(Builder builder) {
7682

83+
this.masterTimeout = builder.masterTimeout;
7784
this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name");
85+
this.timeout = builder.timeout;
7886

7987
}
8088

@@ -83,6 +91,17 @@ public static DeleteAutoscalingPolicyRequest of(
8391
return fn.apply(new Builder()).build();
8492
}
8593

94+
/**
95+
* Period to wait for a connection to the master node. If no response is
96+
* received before the timeout expires, the request fails and returns an error.
97+
* <p>
98+
* API name: {@code master_timeout}
99+
*/
100+
@Nullable
101+
public final Time masterTimeout() {
102+
return this.masterTimeout;
103+
}
104+
86105
/**
87106
* Required - the name of the autoscaling policy
88107
* <p>
@@ -92,6 +111,17 @@ public final String name() {
92111
return this.name;
93112
}
94113

114+
/**
115+
* Period to wait for a response. If no response is received before the timeout
116+
* expires, the request fails and returns an error.
117+
* <p>
118+
* API name: {@code timeout}
119+
*/
120+
@Nullable
121+
public final Time timeout() {
122+
return this.timeout;
123+
}
124+
95125
// ---------------------------------------------------------------------------------------------
96126

97127
/**
@@ -101,8 +131,35 @@ public final String name() {
101131
public static class Builder extends RequestBase.AbstractBuilder<Builder>
102132
implements
103133
ObjectBuilder<DeleteAutoscalingPolicyRequest> {
134+
@Nullable
135+
private Time masterTimeout;
136+
104137
private String name;
105138

139+
@Nullable
140+
private Time timeout;
141+
142+
/**
143+
* Period to wait for a connection to the master node. If no response is
144+
* received before the timeout expires, the request fails and returns an error.
145+
* <p>
146+
* API name: {@code master_timeout}
147+
*/
148+
public final Builder masterTimeout(@Nullable Time value) {
149+
this.masterTimeout = value;
150+
return this;
151+
}
152+
153+
/**
154+
* Period to wait for a connection to the master node. If no response is
155+
* received before the timeout expires, the request fails and returns an error.
156+
* <p>
157+
* API name: {@code master_timeout}
158+
*/
159+
public final Builder masterTimeout(Function<Time.Builder, ObjectBuilder<Time>> fn) {
160+
return this.masterTimeout(fn.apply(new Time.Builder()).build());
161+
}
162+
106163
/**
107164
* Required - the name of the autoscaling policy
108165
* <p>
@@ -113,6 +170,27 @@ public final Builder name(String value) {
113170
return this;
114171
}
115172

173+
/**
174+
* Period to wait for a response. If no response is received before the timeout
175+
* expires, the request fails and returns an error.
176+
* <p>
177+
* API name: {@code timeout}
178+
*/
179+
public final Builder timeout(@Nullable Time value) {
180+
this.timeout = value;
181+
return this;
182+
}
183+
184+
/**
185+
* Period to wait for a response. If no response is received before the timeout
186+
* expires, the request fails and returns an error.
187+
* <p>
188+
* API name: {@code timeout}
189+
*/
190+
public final Builder timeout(Function<Time.Builder, ObjectBuilder<Time>> fn) {
191+
return this.timeout(fn.apply(new Time.Builder()).build());
192+
}
193+
116194
@Override
117195
protected Builder self() {
118196
return this;
@@ -182,7 +260,14 @@ public DeleteAutoscalingPolicyRequest build() {
182260

183261
// Request parameters
184262
request -> {
185-
return Collections.emptyMap();
263+
Map<String, String> params = new HashMap<>();
264+
if (request.masterTimeout != null) {
265+
params.put("master_timeout", request.masterTimeout._toJsonString());
266+
}
267+
if (request.timeout != null) {
268+
params.put("timeout", request.timeout._toJsonString());
269+
}
270+
return params;
186271

187272
}, SimpleEndpoint.emptyMap(), false, DeleteAutoscalingPolicyResponse._DESERIALIZER);
188273
}

0 commit comments

Comments
 (0)