-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-generate client code using latest OpenSearch API specification (20…
…24-11-18) Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
c7103d8
commit 6c9116d
Showing
18 changed files
with
768 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
171 changes: 171 additions & 0 deletions
171
...nt/src/generated/java/org/opensearch/client/opensearch/_types/analysis/PhoneAnalyzer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
/* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
//---------------------------------------------------- | ||
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. | ||
//---------------------------------------------------- | ||
|
||
package org.opensearch.client.opensearch._types.analysis; | ||
|
||
import jakarta.json.stream.JsonGenerator; | ||
import java.util.Objects; | ||
import java.util.function.Function; | ||
import javax.annotation.Generated; | ||
import javax.annotation.Nullable; | ||
import org.opensearch.client.json.JsonpDeserializable; | ||
import org.opensearch.client.json.JsonpDeserializer; | ||
import org.opensearch.client.json.JsonpMapper; | ||
import org.opensearch.client.json.ObjectBuilderDeserializer; | ||
import org.opensearch.client.json.ObjectDeserializer; | ||
import org.opensearch.client.json.PlainJsonSerializable; | ||
import org.opensearch.client.util.ObjectBuilder; | ||
import org.opensearch.client.util.ObjectBuilderBase; | ||
|
||
// typedef: _types.analysis.PhoneAnalyzer | ||
|
||
@JsonpDeserializable | ||
@Generated("org.opensearch.client.codegen.CodeGenerator") | ||
public class PhoneAnalyzer implements AnalyzerVariant, PlainJsonSerializable { | ||
|
||
@Nullable | ||
private final String phoneRegion; | ||
|
||
// --------------------------------------------------------------------------------------------- | ||
|
||
private PhoneAnalyzer(Builder builder) { | ||
this.phoneRegion = builder.phoneRegion; | ||
} | ||
|
||
public static PhoneAnalyzer of(Function<PhoneAnalyzer.Builder, ObjectBuilder<PhoneAnalyzer>> fn) { | ||
return fn.apply(new Builder()).build(); | ||
} | ||
|
||
/** | ||
* {@link Analyzer} variant kind. | ||
*/ | ||
@Override | ||
public Analyzer.Kind _analyzerKind() { | ||
return Analyzer.Kind.Phone; | ||
} | ||
|
||
/** | ||
* Optional ISO 3166 country code, defaults to "ZZ" (unknown region). | ||
* <p> | ||
* API name: {@code phone-region} | ||
* </p> | ||
*/ | ||
@Nullable | ||
public final String phoneRegion() { | ||
return this.phoneRegion; | ||
} | ||
|
||
/** | ||
* Serialize this object to JSON. | ||
*/ | ||
@Override | ||
public void serialize(JsonGenerator generator, JsonpMapper mapper) { | ||
generator.writeStartObject(); | ||
serializeInternal(generator, mapper); | ||
generator.writeEnd(); | ||
} | ||
|
||
protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { | ||
generator.write("type", "phone"); | ||
if (this.phoneRegion != null) { | ||
generator.writeKey("phone-region"); | ||
generator.write(this.phoneRegion); | ||
} | ||
} | ||
|
||
// --------------------------------------------------------------------------------------------- | ||
|
||
/** | ||
* Builder for {@link PhoneAnalyzer}. | ||
*/ | ||
public static class Builder extends ObjectBuilderBase implements ObjectBuilder<PhoneAnalyzer> { | ||
@Nullable | ||
private String phoneRegion; | ||
|
||
/** | ||
* Optional ISO 3166 country code, defaults to "ZZ" (unknown region). | ||
* <p> | ||
* API name: {@code phone-region} | ||
* </p> | ||
*/ | ||
public final Builder phoneRegion(@Nullable String value) { | ||
this.phoneRegion = value; | ||
return this; | ||
} | ||
|
||
/** | ||
* Builds a {@link PhoneAnalyzer}. | ||
* | ||
* @throws NullPointerException if some of the required fields are null. | ||
*/ | ||
public PhoneAnalyzer build() { | ||
_checkSingleUse(); | ||
|
||
return new PhoneAnalyzer(this); | ||
} | ||
} | ||
|
||
// --------------------------------------------------------------------------------------------- | ||
|
||
/** | ||
* Json deserializer for {@link PhoneAnalyzer} | ||
*/ | ||
public static final JsonpDeserializer<PhoneAnalyzer> _DESERIALIZER = ObjectBuilderDeserializer.lazy( | ||
Builder::new, | ||
PhoneAnalyzer::setupPhoneAnalyzerDeserializer | ||
); | ||
|
||
protected static void setupPhoneAnalyzerDeserializer(ObjectDeserializer<PhoneAnalyzer.Builder> op) { | ||
op.add(Builder::phoneRegion, JsonpDeserializer.stringDeserializer(), "phone-region"); | ||
|
||
op.ignore("type"); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = 17; | ||
result = 31 * result + Objects.hashCode(this.phoneRegion); | ||
return result; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || this.getClass() != o.getClass()) return false; | ||
PhoneAnalyzer other = (PhoneAnalyzer) o; | ||
return Objects.equals(this.phoneRegion, other.phoneRegion); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.