Skip to content

Commit 18cb67f

Browse files
committed
[codegen] updated to latest api spec + generator
1 parent ec04e78 commit 18cb67f

File tree

91 files changed

+20324
-8
lines changed

Some content is hidden

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

91 files changed

+20324
-8
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import co.elastic.clients.elasticsearch.cat.ElasticsearchCatAsyncClient;
2727
import co.elastic.clients.elasticsearch.ccr.ElasticsearchCcrAsyncClient;
2828
import co.elastic.clients.elasticsearch.cluster.ElasticsearchClusterAsyncClient;
29+
import co.elastic.clients.elasticsearch.connector.ElasticsearchConnectorAsyncClient;
2930
import co.elastic.clients.elasticsearch.core.BulkRequest;
3031
import co.elastic.clients.elasticsearch.core.BulkResponse;
3132
import co.elastic.clients.elasticsearch.core.ClearScrollRequest;
@@ -212,6 +213,10 @@ public ElasticsearchClusterAsyncClient cluster() {
212213
return new ElasticsearchClusterAsyncClient(this.transport, this.transportOptions);
213214
}
214215

216+
public ElasticsearchConnectorAsyncClient connector() {
217+
return new ElasticsearchConnectorAsyncClient(this.transport, this.transportOptions);
218+
}
219+
215220
public ElasticsearchDanglingIndicesAsyncClient danglingIndices() {
216221
return new ElasticsearchDanglingIndicesAsyncClient(this.transport, this.transportOptions);
217222
}

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

+5
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import co.elastic.clients.elasticsearch.cat.ElasticsearchCatClient;
2828
import co.elastic.clients.elasticsearch.ccr.ElasticsearchCcrClient;
2929
import co.elastic.clients.elasticsearch.cluster.ElasticsearchClusterClient;
30+
import co.elastic.clients.elasticsearch.connector.ElasticsearchConnectorClient;
3031
import co.elastic.clients.elasticsearch.core.BulkRequest;
3132
import co.elastic.clients.elasticsearch.core.BulkResponse;
3233
import co.elastic.clients.elasticsearch.core.ClearScrollRequest;
@@ -213,6 +214,10 @@ public ElasticsearchClusterClient cluster() {
213214
return new ElasticsearchClusterClient(this.transport, this.transportOptions);
214215
}
215216

217+
public ElasticsearchConnectorClient connector() {
218+
return new ElasticsearchConnectorClient(this.transport, this.transportOptions);
219+
}
220+
216221
public ElasticsearchDanglingIndicesClient danglingIndices() {
217222
return new ElasticsearchDanglingIndicesClient(this.transport, this.transportOptions);
218223
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
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.connector;
21+
22+
import co.elastic.clients.elasticsearch._types.ErrorResponse;
23+
import co.elastic.clients.elasticsearch._types.RequestBase;
24+
import co.elastic.clients.json.JsonpDeserializable;
25+
import co.elastic.clients.json.JsonpDeserializer;
26+
import co.elastic.clients.json.ObjectBuilderDeserializer;
27+
import co.elastic.clients.json.ObjectDeserializer;
28+
import co.elastic.clients.transport.Endpoint;
29+
import co.elastic.clients.transport.endpoints.SimpleEndpoint;
30+
import co.elastic.clients.util.ApiTypeHelper;
31+
import co.elastic.clients.util.ObjectBuilder;
32+
import jakarta.json.stream.JsonGenerator;
33+
import java.lang.String;
34+
import java.util.Collections;
35+
import java.util.HashMap;
36+
import java.util.Map;
37+
import java.util.Objects;
38+
import java.util.function.Function;
39+
import javax.annotation.Nullable;
40+
41+
//----------------------------------------------------------------
42+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
43+
//----------------------------------------------------------------
44+
//
45+
// This code is generated from the Elasticsearch API specification
46+
// at https://github.com/elastic/elasticsearch-specification
47+
//
48+
// Manual updates to this file will be lost when the code is
49+
// re-generated.
50+
//
51+
// If you find a property that is missing or wrongly typed, please
52+
// open an issue or a PR on the API specification repository.
53+
//
54+
//----------------------------------------------------------------
55+
56+
// typedef: connector.check_in.Request
57+
58+
/**
59+
* Updates the last_seen field in the connector, and sets it to current
60+
* timestamp
61+
*
62+
* @see <a href="../doc-files/api-spec.html#connector.check_in.Request">API
63+
* specification</a>
64+
*/
65+
66+
public class CheckInRequest extends RequestBase {
67+
private final String connectorId;
68+
69+
// ---------------------------------------------------------------------------------------------
70+
71+
private CheckInRequest(Builder builder) {
72+
73+
this.connectorId = ApiTypeHelper.requireNonNull(builder.connectorId, this, "connectorId");
74+
75+
}
76+
77+
public static CheckInRequest of(Function<Builder, ObjectBuilder<CheckInRequest>> fn) {
78+
return fn.apply(new Builder()).build();
79+
}
80+
81+
/**
82+
* Required - The unique identifier of the connector to be checked in
83+
* <p>
84+
* API name: {@code connector_id}
85+
*/
86+
public final String connectorId() {
87+
return this.connectorId;
88+
}
89+
90+
// ---------------------------------------------------------------------------------------------
91+
92+
/**
93+
* Builder for {@link CheckInRequest}.
94+
*/
95+
96+
public static class Builder extends RequestBase.AbstractBuilder<Builder> implements ObjectBuilder<CheckInRequest> {
97+
private String connectorId;
98+
99+
/**
100+
* Required - The unique identifier of the connector to be checked in
101+
* <p>
102+
* API name: {@code connector_id}
103+
*/
104+
public final Builder connectorId(String value) {
105+
this.connectorId = value;
106+
return this;
107+
}
108+
109+
@Override
110+
protected Builder self() {
111+
return this;
112+
}
113+
114+
/**
115+
* Builds a {@link CheckInRequest}.
116+
*
117+
* @throws NullPointerException
118+
* if some of the required fields are null.
119+
*/
120+
public CheckInRequest build() {
121+
_checkSingleUse();
122+
123+
return new CheckInRequest(this);
124+
}
125+
}
126+
127+
// ---------------------------------------------------------------------------------------------
128+
129+
/**
130+
* Endpoint "{@code connector.check_in}".
131+
*/
132+
public static final Endpoint<CheckInRequest, CheckInResponse, ErrorResponse> _ENDPOINT = new SimpleEndpoint<>(
133+
"es/connector.check_in",
134+
135+
// Request method
136+
request -> {
137+
return "PUT";
138+
139+
},
140+
141+
// Request path
142+
request -> {
143+
final int _connectorId = 1 << 0;
144+
145+
int propsSet = 0;
146+
147+
propsSet |= _connectorId;
148+
149+
if (propsSet == (_connectorId)) {
150+
StringBuilder buf = new StringBuilder();
151+
buf.append("/_connector");
152+
buf.append("/");
153+
SimpleEndpoint.pathEncode(request.connectorId, buf);
154+
buf.append("/_check_in");
155+
return buf.toString();
156+
}
157+
throw SimpleEndpoint.noPathTemplateFound("path");
158+
159+
},
160+
161+
// Path parameters
162+
request -> {
163+
Map<String, String> params = new HashMap<>();
164+
final int _connectorId = 1 << 0;
165+
166+
int propsSet = 0;
167+
168+
propsSet |= _connectorId;
169+
170+
if (propsSet == (_connectorId)) {
171+
params.put("connectorId", request.connectorId);
172+
}
173+
return params;
174+
},
175+
176+
// Request parameters
177+
request -> {
178+
return Collections.emptyMap();
179+
180+
}, SimpleEndpoint.emptyMap(), false, CheckInResponse._DESERIALIZER);
181+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
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.connector;
21+
22+
import co.elastic.clients.elasticsearch._types.Result;
23+
import co.elastic.clients.json.JsonpDeserializable;
24+
import co.elastic.clients.json.JsonpDeserializer;
25+
import co.elastic.clients.json.JsonpMapper;
26+
import co.elastic.clients.json.JsonpSerializable;
27+
import co.elastic.clients.json.JsonpUtils;
28+
import co.elastic.clients.json.ObjectBuilderDeserializer;
29+
import co.elastic.clients.json.ObjectDeserializer;
30+
import co.elastic.clients.util.ApiTypeHelper;
31+
import co.elastic.clients.util.ObjectBuilder;
32+
import co.elastic.clients.util.WithJsonObjectBuilderBase;
33+
import jakarta.json.stream.JsonGenerator;
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: connector.check_in.Response
54+
55+
/**
56+
*
57+
* @see <a href="../doc-files/api-spec.html#connector.check_in.Response">API
58+
* specification</a>
59+
*/
60+
@JsonpDeserializable
61+
public class CheckInResponse implements JsonpSerializable {
62+
private final Result result;
63+
64+
// ---------------------------------------------------------------------------------------------
65+
66+
private CheckInResponse(Builder builder) {
67+
68+
this.result = ApiTypeHelper.requireNonNull(builder.result, this, "result");
69+
70+
}
71+
72+
public static CheckInResponse of(Function<Builder, ObjectBuilder<CheckInResponse>> fn) {
73+
return fn.apply(new Builder()).build();
74+
}
75+
76+
/**
77+
* Required - API name: {@code result}
78+
*/
79+
public final Result result() {
80+
return this.result;
81+
}
82+
83+
/**
84+
* Serialize this object to JSON.
85+
*/
86+
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
87+
generator.writeStartObject();
88+
serializeInternal(generator, mapper);
89+
generator.writeEnd();
90+
}
91+
92+
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
93+
94+
generator.writeKey("result");
95+
this.result.serialize(generator, mapper);
96+
97+
}
98+
99+
@Override
100+
public String toString() {
101+
return JsonpUtils.toString(this);
102+
}
103+
104+
// ---------------------------------------------------------------------------------------------
105+
106+
/**
107+
* Builder for {@link CheckInResponse}.
108+
*/
109+
110+
public static class Builder extends WithJsonObjectBuilderBase<Builder> implements ObjectBuilder<CheckInResponse> {
111+
private Result result;
112+
113+
/**
114+
* Required - API name: {@code result}
115+
*/
116+
public final Builder result(Result value) {
117+
this.result = value;
118+
return this;
119+
}
120+
121+
@Override
122+
protected Builder self() {
123+
return this;
124+
}
125+
126+
/**
127+
* Builds a {@link CheckInResponse}.
128+
*
129+
* @throws NullPointerException
130+
* if some of the required fields are null.
131+
*/
132+
public CheckInResponse build() {
133+
_checkSingleUse();
134+
135+
return new CheckInResponse(this);
136+
}
137+
}
138+
139+
// ---------------------------------------------------------------------------------------------
140+
141+
/**
142+
* Json deserializer for {@link CheckInResponse}
143+
*/
144+
public static final JsonpDeserializer<CheckInResponse> _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new,
145+
CheckInResponse::setupCheckInResponseDeserializer);
146+
147+
protected static void setupCheckInResponseDeserializer(ObjectDeserializer<CheckInResponse.Builder> op) {
148+
149+
op.add(Builder::result, Result._DESERIALIZER, "result");
150+
151+
}
152+
153+
}

0 commit comments

Comments
 (0)