Skip to content

Commit a044051

Browse files
authored
Re-generate from latest specification (#1663)
* Re-generate from latest specification Signed-off-by: Thomas Farr <tsfarr@amazon.com> * Fix sample Signed-off-by: Thomas Farr <tsfarr@amazon.com> * Generate `ingestion` namespace Signed-off-by: Thomas Farr <tsfarr@amazon.com> --------- Signed-off-by: Thomas Farr <tsfarr@amazon.com>
1 parent b5e5642 commit a044051

79 files changed

Lines changed: 9044 additions & 1469 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.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
1212
- Added support for Index Management plugin APIs ([#1604](https://github.com/opensearch-project/opensearch-java/pull/1604))
1313
- Added support for the security plugin APIs ([#1601](https://github.com/opensearch-project/opensearch-java/pull/1601))
1414
- Jackson `ObjectMapper` modules are now being auto-detected ([#1643](https://github.com/opensearch-project/opensearch-java/pull/1643))
15+
- Added support for the `ingestion` namespace ([#1663](https://github.com/opensearch-project/opensearch-java/pull/1663))
1516

1617
### Dependencies
1718
- Bump `org.owasp.dependencycheck` from 12.1.1 to 12.1.3 ([#1608](https://github.com/opensearch-project/opensearch-java/pull/1608), [#1607](https://github.com/opensearch-project/opensearch-java/pull/1607), [#1623](https://github.com/opensearch-project/opensearch-java/pull/1623))

UPGRADING.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,4 +777,67 @@ After:
777777
- The `RuntimeFieldType` class has been removed as it is not supported by OpenSearch.
778778

779779
### MultiSearchItem
780-
- The `MultiSearchItem` class now extends `SearchResult` directly instead of via `SearchResponse`.
780+
- The `MultiSearchItem` class now extends `SearchResult` directly instead of via `SearchResponse`.
781+
782+
### ml.ByteBuffer
783+
- The `order` property is now of type `ByteOrder` instead of `String`.
784+
785+
### ml.ColumnMeta
786+
- The `columnType` property is now of type `ColumnType` instead of `String`.
787+
788+
### ml.CreateConnectorRequest
789+
- The `protocol` property is now of type `ConnectorProtocol` instead of `String`.
790+
791+
### ml.GetAgentResponse
792+
- The `type` property is now of type `AgentType` instead of `String`.
793+
794+
### ml.GetConnectorResponse
795+
- The `protocol` property is now of type `ConnectorProtocol` instead of `String`.
796+
797+
### ml.GetModelGroupResponse
798+
- The `access` property is now of type `ModelGroupAccessMode` instead of `String`.
799+
800+
### ml.GetModelResponse
801+
- The `modelState` property is now of type `ModelState` instead of `String`.
802+
803+
### ml.GetStatsRequest
804+
- The `stat` property is now of type `List<MlStatName>` instead of `String`.
805+
806+
### ml.GetStatsResponse
807+
- The `mlConfigIndexStatus`, `mlConnectorIndexStatus`, `mlControllerIndexStatus`, `mlModelIndexStatus` & `mlTaskIndexStatus` properties are now of type `MlIndexStatus` instead of `String`.
808+
809+
### ml.GetTaskResponse
810+
- The `state` property is now of type `TaskState` instead of `String`.
811+
- The `taskType` property is now of type `MlTaskType` instead of `String`.
812+
813+
### ml.GetToolRequest
814+
- The `toolName` property is now of type `ToolName` instead of `String`.
815+
816+
### ml.Guardrails
817+
- The `type` property is now of type `GuardrailsType` instead of `String`.
818+
819+
### ml.LoadModelResponse
820+
- The `taskType` property is now of type `MlTaskType` instead of `String`.
821+
822+
### ml.ModelProfile
823+
- The `modelState` property is now of type `ModelState` instead of `String`.
824+
825+
### ml.Output
826+
- The `dataType` property is now of type `MlResultDataType` instead of `String`.
827+
828+
### ml.RateLimiter
829+
- The `unit` property is now of type `RateLimiterUnit` instead of `String`.
830+
831+
### ml.RegisterModelGroupRequest
832+
- The `accessMode` property is now of type `ModelGroupAccessMode` instead of `String`.
833+
834+
### ml.Task
835+
- The `state` property is now of type `TaskState` instead of `String`.
836+
- The `taskType` property is now of type `MlTaskType` instead of `String`.
837+
838+
### ml.UpdateConnectorRequest
839+
- The `accessMode` property is now of type `ModelGroupAccessMode` instead of `String`.
840+
- The `protocol` property is now of type `ConnectorProtocol` instead of `String`.
841+
842+
### ml.Values
843+
- The `columnType` property is now of type `ColumnType` instead of `String`.

java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchAsyncClientBase.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
import org.opensearch.client.opensearch.dangling_indices.OpenSearchDanglingIndicesAsyncClient;
115115
import org.opensearch.client.opensearch.indices.OpenSearchIndicesAsyncClient;
116116
import org.opensearch.client.opensearch.ingest.OpenSearchIngestAsyncClient;
117+
import org.opensearch.client.opensearch.ingestion.OpenSearchIngestionAsyncClient;
117118
import org.opensearch.client.opensearch.ism.OpenSearchIsmAsyncClient;
118119
import org.opensearch.client.opensearch.ml.OpenSearchMlAsyncClient;
119120
import org.opensearch.client.opensearch.nodes.OpenSearchNodesAsyncClient;
@@ -159,6 +160,10 @@ public OpenSearchIngestAsyncClient ingest() {
159160
return new OpenSearchIngestAsyncClient(this.transport, this.transportOptions);
160161
}
161162

163+
public OpenSearchIngestionAsyncClient ingestion() {
164+
return new OpenSearchIngestionAsyncClient(this.transport, this.transportOptions);
165+
}
166+
162167
public OpenSearchIsmAsyncClient ism() {
163168
return new OpenSearchIsmAsyncClient(this.transport, this.transportOptions);
164169
}

java-client/src/generated/java/org/opensearch/client/opensearch/OpenSearchClientBase.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
import org.opensearch.client.opensearch.dangling_indices.OpenSearchDanglingIndicesClient;
114114
import org.opensearch.client.opensearch.indices.OpenSearchIndicesClient;
115115
import org.opensearch.client.opensearch.ingest.OpenSearchIngestClient;
116+
import org.opensearch.client.opensearch.ingestion.OpenSearchIngestionClient;
116117
import org.opensearch.client.opensearch.ism.OpenSearchIsmClient;
117118
import org.opensearch.client.opensearch.ml.OpenSearchMlClient;
118119
import org.opensearch.client.opensearch.nodes.OpenSearchNodesClient;
@@ -158,6 +159,10 @@ public OpenSearchIngestClient ingest() {
158159
return new OpenSearchIngestClient(this.transport, this.transportOptions);
159160
}
160161

162+
public OpenSearchIngestionClient ingestion() {
163+
return new OpenSearchIngestionClient(this.transport, this.transportOptions);
164+
}
165+
161166
public OpenSearchIsmClient ism() {
162167
return new OpenSearchIsmClient(this.transport, this.transportOptions);
163168
}

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public enum Kind implements JsonEnum {
7474
Nori("nori"),
7575
Pattern("pattern"),
7676
Phone("phone"),
77+
PhoneSearch("phone-search"),
7778
Simple("simple"),
7879
Smartcn("smartcn"),
7980
Snowball("snowball"),
@@ -296,6 +297,22 @@ public PhoneAnalyzer phone() {
296297
return TaggedUnionUtils.get(this, Kind.Phone);
297298
}
298299

300+
/**
301+
* Is this variant instance of kind {@code phone-search}?
302+
*/
303+
public boolean isPhoneSearch() {
304+
return _kind == Kind.PhoneSearch;
305+
}
306+
307+
/**
308+
* Get the {@code phone-search} variant value.
309+
*
310+
* @throws IllegalStateException if the current variant is not the {@code phone-search} kind.
311+
*/
312+
public PhoneSearchAnalyzer phoneSearch() {
313+
return TaggedUnionUtils.get(this, Kind.PhoneSearch);
314+
}
315+
299316
/**
300317
* Is this variant instance of kind {@code simple}?
301318
*/
@@ -528,6 +545,16 @@ public ObjectBuilder<Analyzer> phone(Function<PhoneAnalyzer.Builder, ObjectBuild
528545
return this.phone(fn.apply(new PhoneAnalyzer.Builder()).build());
529546
}
530547

548+
public ObjectBuilder<Analyzer> phoneSearch(PhoneSearchAnalyzer v) {
549+
this._kind = Kind.PhoneSearch;
550+
this._value = v;
551+
return this;
552+
}
553+
554+
public ObjectBuilder<Analyzer> phoneSearch(Function<PhoneSearchAnalyzer.Builder, ObjectBuilder<PhoneSearchAnalyzer>> fn) {
555+
return this.phoneSearch(fn.apply(new PhoneSearchAnalyzer.Builder()).build());
556+
}
557+
531558
public ObjectBuilder<Analyzer> simple(SimpleAnalyzer v) {
532559
this._kind = Kind.Simple;
533560
this._value = v;
@@ -607,6 +634,7 @@ protected static void setupAnalyzerDeserializer(ObjectDeserializer<Builder> op)
607634
op.add(Builder::nori, NoriAnalyzer._DESERIALIZER, "nori");
608635
op.add(Builder::pattern, PatternAnalyzer._DESERIALIZER, "pattern");
609636
op.add(Builder::phone, PhoneAnalyzer._DESERIALIZER, "phone");
637+
op.add(Builder::phoneSearch, PhoneSearchAnalyzer._DESERIALIZER, "phone-search");
610638
op.add(Builder::simple, SimpleAnalyzer._DESERIALIZER, "simple");
611639
op.add(Builder::smartcn, SmartcnAnalyzer._DESERIALIZER, "smartcn");
612640
op.add(Builder::snowball, SnowballAnalyzer._DESERIALIZER, "snowball");

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ public static PhoneAnalyzer.Builder phone() {
122122
return new PhoneAnalyzer.Builder();
123123
}
124124

125+
/**
126+
* Creates a builder for the {@link PhoneSearchAnalyzer phone-search} {@code Analyzer} variant.
127+
*/
128+
public static PhoneSearchAnalyzer.Builder phoneSearch() {
129+
return new PhoneSearchAnalyzer.Builder();
130+
}
131+
125132
/**
126133
* Creates a builder for the {@link SimpleAnalyzer simple} {@code Analyzer} variant.
127134
*/

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

Lines changed: 14 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -37,35 +37,28 @@
3737
package org.opensearch.client.opensearch._types.analysis;
3838

3939
import jakarta.json.stream.JsonGenerator;
40-
import java.util.Objects;
4140
import java.util.function.Function;
4241
import javax.annotation.Generated;
4342
import javax.annotation.Nonnull;
44-
import javax.annotation.Nullable;
4543
import org.opensearch.client.json.JsonpDeserializable;
4644
import org.opensearch.client.json.JsonpDeserializer;
4745
import org.opensearch.client.json.JsonpMapper;
4846
import org.opensearch.client.json.ObjectBuilderDeserializer;
4947
import org.opensearch.client.json.ObjectDeserializer;
50-
import org.opensearch.client.json.PlainJsonSerializable;
5148
import org.opensearch.client.util.CopyableBuilder;
5249
import org.opensearch.client.util.ObjectBuilder;
53-
import org.opensearch.client.util.ObjectBuilderBase;
5450
import org.opensearch.client.util.ToCopyableBuilder;
5551

5652
// typedef: _types.analysis.PhoneAnalyzer
5753

5854
@JsonpDeserializable
5955
@Generated("org.opensearch.client.codegen.CodeGenerator")
60-
public class PhoneAnalyzer implements AnalyzerVariant, PlainJsonSerializable, ToCopyableBuilder<PhoneAnalyzer.Builder, PhoneAnalyzer> {
61-
62-
@Nullable
63-
private final String phoneRegion;
56+
public class PhoneAnalyzer extends PhoneAnalyzerBase implements AnalyzerVariant, ToCopyableBuilder<PhoneAnalyzer.Builder, PhoneAnalyzer> {
6457

6558
// ---------------------------------------------------------------------------------------------
6659

6760
private PhoneAnalyzer(Builder builder) {
68-
this.phoneRegion = builder.phoneRegion;
61+
super(builder);
6962
}
7063

7164
public static PhoneAnalyzer of(Function<PhoneAnalyzer.Builder, ObjectBuilder<PhoneAnalyzer>> fn) {
@@ -80,33 +73,9 @@ public Analyzer.Kind _analyzerKind() {
8073
return Analyzer.Kind.Phone;
8174
}
8275

83-
/**
84-
* Optional ISO 3166 country code, defaults to &quot;ZZ&quot; (unknown region).
85-
* <p>
86-
* API name: {@code phone-region}
87-
* </p>
88-
*/
89-
@Nullable
90-
public final String phoneRegion() {
91-
return this.phoneRegion;
92-
}
93-
94-
/**
95-
* Serialize this object to JSON.
96-
*/
97-
@Override
98-
public void serialize(JsonGenerator generator, JsonpMapper mapper) {
99-
generator.writeStartObject();
100-
serializeInternal(generator, mapper);
101-
generator.writeEnd();
102-
}
103-
10476
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
10577
generator.write("type", "phone");
106-
if (this.phoneRegion != null) {
107-
generator.writeKey("phone-region");
108-
generator.write(this.phoneRegion);
109-
}
78+
super.serializeInternal(generator, mapper);
11079
}
11180

11281
// ---------------------------------------------------------------------------------------------
@@ -125,18 +94,16 @@ public static Builder builder() {
12594
/**
12695
* Builder for {@link PhoneAnalyzer}.
12796
*/
128-
public static class Builder extends ObjectBuilderBase implements CopyableBuilder<Builder, PhoneAnalyzer> {
129-
@Nullable
130-
private String phoneRegion;
97+
public static class Builder extends PhoneAnalyzerBase.AbstractBuilder<Builder> implements CopyableBuilder<Builder, PhoneAnalyzer> {
13198

13299
public Builder() {}
133100

134101
private Builder(PhoneAnalyzer o) {
135-
this.phoneRegion = o.phoneRegion;
102+
super(o);
136103
}
137104

138105
private Builder(Builder o) {
139-
this.phoneRegion = o.phoneRegion;
106+
super(o);
140107
}
141108

142109
@Override
@@ -145,15 +112,9 @@ public Builder copy() {
145112
return new Builder(this);
146113
}
147114

148-
/**
149-
* Optional ISO 3166 country code, defaults to &quot;ZZ&quot; (unknown region).
150-
* <p>
151-
* API name: {@code phone-region}
152-
* </p>
153-
*/
115+
@Override
154116
@Nonnull
155-
public final Builder phoneRegion(@Nullable String value) {
156-
this.phoneRegion = value;
117+
protected Builder self() {
157118
return this;
158119
}
159120

@@ -182,23 +143,24 @@ public PhoneAnalyzer build() {
182143
);
183144

184145
protected static void setupPhoneAnalyzerDeserializer(ObjectDeserializer<PhoneAnalyzer.Builder> op) {
185-
op.add(Builder::phoneRegion, JsonpDeserializer.stringDeserializer(), "phone-region");
146+
setupPhoneAnalyzerBaseDeserializer(op);
186147

187148
op.ignore("type");
188149
}
189150

190151
@Override
191152
public int hashCode() {
192-
int result = 17;
193-
result = 31 * result + Objects.hashCode(this.phoneRegion);
153+
int result = super.hashCode();
194154
return result;
195155
}
196156

197157
@Override
198158
public boolean equals(Object o) {
159+
if (!super.equals(o)) {
160+
return false;
161+
}
199162
if (this == o) return true;
200163
if (o == null || this.getClass() != o.getClass()) return false;
201-
PhoneAnalyzer other = (PhoneAnalyzer) o;
202-
return Objects.equals(this.phoneRegion, other.phoneRegion);
164+
return true;
203165
}
204166
}

0 commit comments

Comments
 (0)