Skip to content

Commit e1f8e9f

Browse files
Re-generate client code using latest OpenSearch API specification (2024-11-18) (#1236)
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent c7103d8 commit e1f8e9f

18 files changed

+768
-345
lines changed

java-client/src/generated/java/org/opensearch/client/opensearch/_types/ExpandWildcard.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ public enum ExpandWildcard implements JsonEnum {
5151
All("all"),
5252

5353
/**
54-
* Match closed, non-hidden indices.
54+
* Match closed, non-hidden indexes.
5555
*/
5656
Closed("closed"),
5757

5858
/**
59-
* Match hidden indices. Must be combined with open, closed, or both.
59+
* Match hidden indexes. Must be combined with open, closed, or both.
6060
*/
6161
Hidden("hidden"),
6262

@@ -66,7 +66,7 @@ public enum ExpandWildcard implements JsonEnum {
6666
None("none"),
6767

6868
/**
69-
* Match open, non-hidden indices.
69+
* Match open, non-hidden indexes.
7070
*/
7171
Open("open");
7272

java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java

+28
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ public enum Kind implements JsonEnum {
7272
Language("language"),
7373
Nori("nori"),
7474
Pattern("pattern"),
75+
Phone("phone"),
7576
Simple("simple"),
7677
Smartcn("smartcn"),
7778
Snowball("snowball"),
@@ -278,6 +279,22 @@ public PatternAnalyzer pattern() {
278279
return TaggedUnionUtils.get(this, Kind.Pattern);
279280
}
280281

282+
/**
283+
* Is this variant instance of kind {@code phone}?
284+
*/
285+
public boolean isPhone() {
286+
return _kind == Kind.Phone;
287+
}
288+
289+
/**
290+
* Get the {@code phone} variant value.
291+
*
292+
* @throws IllegalStateException if the current variant is not the {@code phone} kind.
293+
*/
294+
public PhoneAnalyzer phone() {
295+
return TaggedUnionUtils.get(this, Kind.Phone);
296+
}
297+
281298
/**
282299
* Is this variant instance of kind {@code simple}?
283300
*/
@@ -483,6 +500,16 @@ public ObjectBuilder<Analyzer> pattern(Function<PatternAnalyzer.Builder, ObjectB
483500
return this.pattern(fn.apply(new PatternAnalyzer.Builder()).build());
484501
}
485502

503+
public ObjectBuilder<Analyzer> phone(PhoneAnalyzer v) {
504+
this._kind = Kind.Phone;
505+
this._value = v;
506+
return this;
507+
}
508+
509+
public ObjectBuilder<Analyzer> phone(Function<PhoneAnalyzer.Builder, ObjectBuilder<PhoneAnalyzer>> fn) {
510+
return this.phone(fn.apply(new PhoneAnalyzer.Builder()).build());
511+
}
512+
486513
public ObjectBuilder<Analyzer> simple(SimpleAnalyzer v) {
487514
this._kind = Kind.Simple;
488515
this._value = v;
@@ -561,6 +588,7 @@ protected static void setupAnalyzerDeserializer(ObjectDeserializer<Builder> op)
561588
op.add(Builder::language, LanguageAnalyzer._DESERIALIZER, "language");
562589
op.add(Builder::nori, NoriAnalyzer._DESERIALIZER, "nori");
563590
op.add(Builder::pattern, PatternAnalyzer._DESERIALIZER, "pattern");
591+
op.add(Builder::phone, PhoneAnalyzer._DESERIALIZER, "phone");
564592
op.add(Builder::simple, SimpleAnalyzer._DESERIALIZER, "simple");
565593
op.add(Builder::smartcn, SmartcnAnalyzer._DESERIALIZER, "smartcn");
566594
op.add(Builder::snowball, SnowballAnalyzer._DESERIALIZER, "snowball");

java-client/src/generated/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerBuilders.java

+7
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,13 @@ public static PatternAnalyzer.Builder pattern() {
115115
return new PatternAnalyzer.Builder();
116116
}
117117

118+
/**
119+
* Creates a builder for the {@link PhoneAnalyzer phone} {@code Analyzer} variant.
120+
*/
121+
public static PhoneAnalyzer.Builder phone() {
122+
return new PhoneAnalyzer.Builder();
123+
}
124+
118125
/**
119126
* Creates a builder for the {@link SimpleAnalyzer simple} {@code Analyzer} variant.
120127
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
/*
2+
* SPDX-License-Identifier: Apache-2.0
3+
*
4+
* The OpenSearch Contributors require contributions made to
5+
* this file be licensed under the Apache-2.0 license or a
6+
* compatible open source license.
7+
*/
8+
9+
/*
10+
* Licensed to Elasticsearch B.V. under one or more contributor
11+
* license agreements. See the NOTICE file distributed with
12+
* this work for additional information regarding copyright
13+
* ownership. Elasticsearch B.V. licenses this file to you under
14+
* the Apache License, Version 2.0 (the "License"); you may
15+
* not use this file except in compliance with the License.
16+
* You may obtain a copy of the License at
17+
*
18+
* http://www.apache.org/licenses/LICENSE-2.0
19+
*
20+
* Unless required by applicable law or agreed to in writing,
21+
* software distributed under the License is distributed on an
22+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
23+
* KIND, either express or implied. See the License for the
24+
* specific language governing permissions and limitations
25+
* under the License.
26+
*/
27+
28+
/*
29+
* Modifications Copyright OpenSearch Contributors. See
30+
* GitHub history for details.
31+
*/
32+
33+
//----------------------------------------------------
34+
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
35+
//----------------------------------------------------
36+
37+
package org.opensearch.client.opensearch._types.analysis;
38+
39+
import jakarta.json.stream.JsonGenerator;
40+
import java.util.Objects;
41+
import java.util.function.Function;
42+
import javax.annotation.Generated;
43+
import javax.annotation.Nullable;
44+
import org.opensearch.client.json.JsonpDeserializable;
45+
import org.opensearch.client.json.JsonpDeserializer;
46+
import org.opensearch.client.json.JsonpMapper;
47+
import org.opensearch.client.json.ObjectBuilderDeserializer;
48+
import org.opensearch.client.json.ObjectDeserializer;
49+
import org.opensearch.client.json.PlainJsonSerializable;
50+
import org.opensearch.client.util.ObjectBuilder;
51+
import org.opensearch.client.util.ObjectBuilderBase;
52+
53+
// typedef: _types.analysis.PhoneAnalyzer
54+
55+
@JsonpDeserializable
56+
@Generated("org.opensearch.client.codegen.CodeGenerator")
57+
public class PhoneAnalyzer implements AnalyzerVariant, PlainJsonSerializable {
58+
59+
@Nullable
60+
private final String phoneRegion;
61+
62+
// ---------------------------------------------------------------------------------------------
63+
64+
private PhoneAnalyzer(Builder builder) {
65+
this.phoneRegion = builder.phoneRegion;
66+
}
67+
68+
public static PhoneAnalyzer of(Function<PhoneAnalyzer.Builder, ObjectBuilder<PhoneAnalyzer>> fn) {
69+
return fn.apply(new Builder()).build();
70+
}
71+
72+
/**
73+
* {@link Analyzer} variant kind.
74+
*/
75+
@Override
76+
public Analyzer.Kind _analyzerKind() {
77+
return Analyzer.Kind.Phone;
78+
}
79+
80+
/**
81+
* Optional ISO 3166 country code, defaults to &quot;ZZ&quot; (unknown region).
82+
* <p>
83+
* API name: {@code phone-region}
84+
* </p>
85+
*/
86+
@Nullable
87+
public final String phoneRegion() {
88+
return this.phoneRegion;
89+
}
90+
91+
/**
92+
* Serialize this object to JSON.
93+
*/
94+
@Override
95+
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
96+
generator.writeStartObject();
97+
serializeInternal(generator, mapper);
98+
generator.writeEnd();
99+
}
100+
101+
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
102+
generator.write("type", "phone");
103+
if (this.phoneRegion != null) {
104+
generator.writeKey("phone-region");
105+
generator.write(this.phoneRegion);
106+
}
107+
}
108+
109+
// ---------------------------------------------------------------------------------------------
110+
111+
/**
112+
* Builder for {@link PhoneAnalyzer}.
113+
*/
114+
public static class Builder extends ObjectBuilderBase implements ObjectBuilder<PhoneAnalyzer> {
115+
@Nullable
116+
private String phoneRegion;
117+
118+
/**
119+
* Optional ISO 3166 country code, defaults to &quot;ZZ&quot; (unknown region).
120+
* <p>
121+
* API name: {@code phone-region}
122+
* </p>
123+
*/
124+
public final Builder phoneRegion(@Nullable String value) {
125+
this.phoneRegion = value;
126+
return this;
127+
}
128+
129+
/**
130+
* Builds a {@link PhoneAnalyzer}.
131+
*
132+
* @throws NullPointerException if some of the required fields are null.
133+
*/
134+
public PhoneAnalyzer build() {
135+
_checkSingleUse();
136+
137+
return new PhoneAnalyzer(this);
138+
}
139+
}
140+
141+
// ---------------------------------------------------------------------------------------------
142+
143+
/**
144+
* Json deserializer for {@link PhoneAnalyzer}
145+
*/
146+
public static final JsonpDeserializer<PhoneAnalyzer> _DESERIALIZER = ObjectBuilderDeserializer.lazy(
147+
Builder::new,
148+
PhoneAnalyzer::setupPhoneAnalyzerDeserializer
149+
);
150+
151+
protected static void setupPhoneAnalyzerDeserializer(ObjectDeserializer<PhoneAnalyzer.Builder> op) {
152+
op.add(Builder::phoneRegion, JsonpDeserializer.stringDeserializer(), "phone-region");
153+
154+
op.ignore("type");
155+
}
156+
157+
@Override
158+
public int hashCode() {
159+
int result = 17;
160+
result = 31 * result + Objects.hashCode(this.phoneRegion);
161+
return result;
162+
}
163+
164+
@Override
165+
public boolean equals(Object o) {
166+
if (this == o) return true;
167+
if (o == null || this.getClass() != o.getClass()) return false;
168+
PhoneAnalyzer other = (PhoneAnalyzer) o;
169+
return Objects.equals(this.phoneRegion, other.phoneRegion);
170+
}
171+
}

java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/ListDanglingIndicesRequest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
// typedef: dangling_indices.list_dangling_indices.Request
4646

4747
/**
48-
* Returns all dangling indices.
48+
* Returns all dangling indexes.
4949
*/
5050
@Generated("org.opensearch.client.codegen.CodeGenerator")
5151
public class ListDanglingIndicesRequest extends RequestBase {

java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/OpenSearchDanglingIndicesAsyncClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public final CompletableFuture<ImportDanglingIndexResponse> importDanglingIndex(
110110
// ----- Endpoint: dangling_indices.list_dangling_indices
111111

112112
/**
113-
* Returns all dangling indices.
113+
* Returns all dangling indexes.
114114
*/
115115
public CompletableFuture<ListDanglingIndicesResponse> listDanglingIndices() throws IOException, OpenSearchException {
116116
return this.transport.performRequestAsync(

java-client/src/generated/java/org/opensearch/client/opensearch/dangling_indices/OpenSearchDanglingIndicesClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public final ImportDanglingIndexResponse importDanglingIndex(
107107
// ----- Endpoint: dangling_indices.list_dangling_indices
108108

109109
/**
110-
* Returns all dangling indices.
110+
* Returns all dangling indexes.
111111
*/
112112
public ListDanglingIndicesResponse listDanglingIndices() throws IOException, OpenSearchException {
113113
return this.transport.performRequest(

java-client/src/generated/java/org/opensearch/client/opensearch/indices/Alias.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public final String indexRouting() {
107107
}
108108

109109
/**
110-
* If <code>true</code>, the alias is hidden. All indices for the alias must have the same <code>is_hidden</code> value.
110+
* If <code>true</code>, the alias is hidden. All indexes for the alias must have the same <code>is_hidden</code> value.
111111
* <p>
112112
* API name: {@code is_hidden}
113113
* </p>
@@ -229,7 +229,7 @@ public final Builder indexRouting(@Nullable String value) {
229229
}
230230

231231
/**
232-
* If <code>true</code>, the alias is hidden. All indices for the alias must have the same <code>is_hidden</code> value.
232+
* If <code>true</code>, the alias is hidden. All indexes for the alias must have the same <code>is_hidden</code> value.
233233
* <p>
234234
* API name: {@code is_hidden}
235235
* </p>

java-client/src/generated/java/org/opensearch/client/opensearch/indices/DeleteIndexRequest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public static DeleteIndexRequest of(Function<DeleteIndexRequest.Builder, ObjectB
103103

104104
/**
105105
* If <code>false</code>, the request returns an error if any wildcard expression, index alias, or <code>_all</code> value targets only
106-
* missing or closed indices. This behavior applies even if the request targets other open indices.
106+
* missing or closed indexes. This behavior applies even if the request targets other open indexes.
107107
* <p>
108108
* API name: {@code allow_no_indices}
109109
* </p>
@@ -149,7 +149,7 @@ public final Boolean ignoreUnavailable() {
149149
}
150150

151151
/**
152-
* Required - Comma-separated list of indices to delete. You cannot specify index aliases. By default, this parameter does not support
152+
* Required - Comma-separated list of indexes to delete. You cannot specify index aliases. By default, this parameter does not support
153153
* wildcards (<code>*</code>) or <code>_all</code>. To use wildcards or <code>_all</code>, set the
154154
* <code>action.destructive_requires_name</code> cluster setting to <code>false</code>.
155155
* <p>
@@ -207,7 +207,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder<D
207207

208208
/**
209209
* If <code>false</code>, the request returns an error if any wildcard expression, index alias, or <code>_all</code> value targets
210-
* only missing or closed indices. This behavior applies even if the request targets other open indices.
210+
* only missing or closed indexes. This behavior applies even if the request targets other open indexes.
211211
* <p>
212212
* API name: {@code allow_no_indices}
213213
* </p>
@@ -284,7 +284,7 @@ public final Builder ignoreUnavailable(@Nullable Boolean value) {
284284
}
285285

286286
/**
287-
* Required - Comma-separated list of indices to delete. You cannot specify index aliases. By default, this parameter does not
287+
* Required - Comma-separated list of indexes to delete. You cannot specify index aliases. By default, this parameter does not
288288
* support wildcards (<code>*</code>) or <code>_all</code>. To use wildcards or <code>_all</code>, set the
289289
* <code>action.destructive_requires_name</code> cluster setting to <code>false</code>.
290290
* <p>
@@ -301,7 +301,7 @@ public final Builder index(List<String> list) {
301301
}
302302

303303
/**
304-
* Required - Comma-separated list of indices to delete. You cannot specify index aliases. By default, this parameter does not
304+
* Required - Comma-separated list of indexes to delete. You cannot specify index aliases. By default, this parameter does not
305305
* support wildcards (<code>*</code>) or <code>_all</code>. To use wildcards or <code>_all</code>, set the
306306
* <code>action.destructive_requires_name</code> cluster setting to <code>false</code>.
307307
* <p>

0 commit comments

Comments
 (0)