From 54ab4587ef40a4fe4bccf10ba702c84909392220 Mon Sep 17 00:00:00 2001 From: brentam Date: Thu, 21 Dec 2023 23:10:29 +1100 Subject: [PATCH 1/9] 1.adding analyzer class for other languages. 2.adding methods for other languages in the Analyzer.java Signed-off-by: brentam --- .../opensearch/_types/analysis/Analyzer.java | 1090 ++++++++++++++++- .../_types/analysis/ArabicAnalyzer.java | 168 +++ .../_types/analysis/ArmenianAnalyzer.java | 168 +++ .../_types/analysis/BasqueAnalyzer.java | 168 +++ .../_types/analysis/BengaliAnalyzer.java | 168 +++ .../_types/analysis/BrazilianAnalyzer.java | 168 +++ .../_types/analysis/BulgarianAnalyzer.java | 168 +++ .../_types/analysis/CatalanAnalyzer.java | 168 +++ .../_types/analysis/CzechAnalyzer.java | 168 +++ .../_types/analysis/DanishAnalyzer.java | 168 +++ .../_types/analysis/EnglishAnalyzer.java | 164 +++ .../_types/analysis/EstonianAnalyzer.java | 168 +++ .../_types/analysis/FinnishAnalyzer.java | 168 +++ .../_types/analysis/FrenchAnalyzer.java | 168 +++ .../_types/analysis/GalicianAnalyzer.java | 168 +++ .../_types/analysis/GermanAnalyzer.java | 168 +++ .../_types/analysis/GreekAnalyzer.java | 168 +++ .../_types/analysis/HindiAnalyzer.java | 168 +++ .../_types/analysis/HungarianAnalyzer.java | 168 +++ .../_types/analysis/IndonesianAnalyzer.java | 168 +++ .../_types/analysis/IrishAnalyzer.java | 168 +++ .../_types/analysis/ItalianAnalyzer.java | 168 +++ .../_types/analysis/LatvianAnalyzer.java | 168 +++ .../_types/analysis/LithuanianAnalyzer.java | 168 +++ .../_types/analysis/NorwegianAnalyzer.java | 168 +++ .../_types/analysis/PersianAnalyzer.java | 168 +++ .../_types/analysis/PortugueseAnalyzer.java | 168 +++ .../_types/analysis/RomanianAnalyzer.java | 168 +++ .../_types/analysis/RussianAnalyzer.java | 168 +++ .../_types/analysis/SoraniAnalyzer.java | 168 +++ .../_types/analysis/SpanishAnalyzer.java | 168 +++ .../_types/analysis/SwedishAnalyzer.java | 168 +++ .../_types/analysis/ThaiAnalyzer.java | 168 +++ .../_types/analysis/TurkishAnalyzer.java | 168 +++ 34 files changed, 6597 insertions(+), 33 deletions(-) create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArabicAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArmenianAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BasqueAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BengaliAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BrazilianAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BulgarianAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CatalanAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CzechAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/DanishAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EnglishAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EstonianAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FinnishAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FrenchAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GalicianAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GermanAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GreekAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HindiAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HungarianAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IndonesianAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IrishAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ItalianAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LatvianAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LithuanianAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/NorwegianAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PersianAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PortugueseAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RomanianAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RussianAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SoraniAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SpanishAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SwedishAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ThaiAnalyzer.java create mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/TurkishAnalyzer.java diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java index 3a60a8daf7..a9041312c6 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java @@ -62,8 +62,6 @@ public class Analyzer implements TaggedUnion, Js public enum Kind implements JsonEnum { Custom("custom"), - Dutch("dutch"), - Fingerprint("fingerprint"), IcuAnalyzer("icu_analyzer"), @@ -92,6 +90,74 @@ public enum Kind implements JsonEnum { Cjk("cjk"), + Arabic("arabic"), + + Armenian("armenian"), + + Basque("basque"), + + Bengali("bengali"), + + Brazilian("brazilian"), + + Bulgarian("bulgarian"), + + Catalan("catalan"), + + Czech("czech"), + + Danish("danish"), + + Dutch("dutch"), + + English("english"), + + Estonian("estonian"), + + Finnish("finnish"), + + French("french"), + + Galician("galician"), + + German("german"), + + Greek("greek"), + + Hindi("hindi"), + + Hungarian("hungarian"), + + Indonesian("indonesian"), + + Irish("irish"), + + Italian("italian"), + + Latvian("latvian"), + + Lithuanian("lithuanian"), + + Norwegian("norwegian"), + + Persian("persian"), + + Portuguese("portuguese"), + + Romanian("romanian"), + + Russian("russian"), + + Sorani("sorani"), + + Spanish("spanish"), + + Swedish("swedish"), + + Turkish("turkish"), + + Thai("thai"), + ; private final String jsonValue; @@ -106,71 +172,666 @@ public String jsonValue() { } - private final Kind _kind; - private final AnalyzerVariant _value; + private final Kind _kind; + private final AnalyzerVariant _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final AnalyzerVariant _get() { + return _value; + } + + public Analyzer(AnalyzerVariant value) { + + this._kind = ApiTypeHelper.requireNonNull(value._analyzerKind(), this, ""); + this._value = ApiTypeHelper.requireNonNull(value, this, ""); + + } + + private Analyzer(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + + } + + public static Analyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Is this variant instance of kind {@code custom}? + */ + public boolean isCustom() { + return _kind == Kind.Custom; + } + + /** + * Get the {@code custom} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code custom} kind. + */ + public CustomAnalyzer custom() { + return TaggedUnionUtils.get(this, Kind.Custom); + } + + /** + * Is this variant instance of kind {@code dutch}? + */ + public boolean isDutch() { + return _kind == Kind.Dutch; + } + + /** + * Get the {@code dutch} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code dutch} kind. + */ + public DutchAnalyzer dutch() { + return TaggedUnionUtils.get(this, Kind.Dutch); + } + + + + /** + * Is this variant instance of kind {@code arabic}? + */ + public boolean isArabic() { + return _kind == Kind.Arabic; + } + + /** + * Get the {@code arabic} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code arabic} kind. + */ + public ArabicAnalyzer arabic() { + return TaggedUnionUtils.get(this, Kind.Arabic); + } + + + /** + * Is this variant instance of kind {@code armenian}? + */ + public boolean isArmenian() { + return _kind == Kind.Armenian; + } + + /** + * Get the {@code armenian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code armenian} kind. + */ + public ArmenianAnalyzer armenian() { + return TaggedUnionUtils.get(this, Kind.Armenian); + } + + + /** + * Is this variant instance of kind {@code basque}? + */ + public boolean isBasque() { + return _kind == Kind.Basque; + } + + /** + * Get the {@code basque} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code basque} kind. + */ + public BasqueAnalyzer basque() { + return TaggedUnionUtils.get(this, Kind.Basque); + } + + + /** + * Is this variant instance of kind {@code bengali}? + */ + public boolean isBengali() { + return _kind == Kind.Bengali; + } + + /** + * Get the {@code bengali} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code bengali} kind. + */ + public BengaliAnalyzer bengali() { + return TaggedUnionUtils.get(this, Kind.Bengali); + } + + + /** + * Is this variant instance of kind {@code brazilian}? + */ + public boolean isBrazilian() { + return _kind == Kind.Brazilian; + } + + /** + * Get the {@code brazilian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code brazilian} kind. + */ + public BrazilianAnalyzer brazilian() { + return TaggedUnionUtils.get(this, Kind.Brazilian); + } + + + /** + * Is this variant instance of kind {@code bulgarian}? + */ + public boolean isBulgarian() { + return _kind == Kind.Bulgarian; + } + + /** + * Get the {@code bulgarian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code bulgarian} kind. + */ + public BulgarianAnalyzer bulgarian() { + return TaggedUnionUtils.get(this, Kind.Bulgarian); + } + + + /** + * Is this variant instance of kind {@code catalan}? + */ + public boolean isCatalan() { + return _kind == Kind.Catalan; + } + + /** + * Get the {@code catalan} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code catalan} kind. + */ + public CatalanAnalyzer catalan() { + return TaggedUnionUtils.get(this, Kind.Catalan); + } + + + /** + * Is this variant instance of kind {@code czech}? + */ + public boolean isCzech() { + return _kind == Kind.Czech; + } + + /** + * Get the {@code czech} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code czech} kind. + */ + public CzechAnalyzer czech() { + return TaggedUnionUtils.get(this, Kind.Czech); + } + + + /** + * Is this variant instance of kind {@code danish}? + */ + public boolean isDanish() { + return _kind == Kind.Danish; + } + + /** + * Get the {@code danish} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code danish} kind. + */ + public DanishAnalyzer danish() { + return TaggedUnionUtils.get(this, Kind.Danish); + } + + /** + * Is this variant instance of kind {@code english}? + */ + public boolean isEnglish() { + return _kind == Kind.English; + } + + /** + * Get the {@code english} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code english} kind. + */ + public EnglishAnalyzer english() { + return TaggedUnionUtils.get(this, Kind.English); + } + + + /** + * Is this variant instance of kind {@code estonian}? + */ + public boolean isEstonian() { + return _kind == Kind.Estonian; + } + + /** + * Get the {@code estonian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code estonian} kind. + */ + public EstonianAnalyzer estonian() { + return TaggedUnionUtils.get(this, Kind.Estonian); + } + + + /** + * Is this variant instance of kind {@code finnish}? + */ + public boolean isFinnish() { + return _kind == Kind.Finnish; + } + + /** + * Get the {@code finnish} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code finnish} kind. + */ + public FinnishAnalyzer finnish() { + return TaggedUnionUtils.get(this, Kind.Finnish); + } + + + /** + * Is this variant instance of kind {@code french}? + */ + public boolean isFrench() { + return _kind == Kind.French; + } + + /** + * Get the {@code french} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code french} kind. + */ + public FrenchAnalyzer french() { + return TaggedUnionUtils.get(this, Kind.French); + } + + + /** + * Is this variant instance of kind {@code galician}? + */ + public boolean isGalician() { + return _kind == Kind.Galician; + } + + /** + * Get the {@code galician} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code galician} kind. + */ + public GalicianAnalyzer galician() { + return TaggedUnionUtils.get(this, Kind.Galician); + } + + + /** + * Is this variant instance of kind {@code german}? + */ + public boolean isGerman() { + return _kind == Kind.German; + } + + /** + * Get the {@code german} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code german} kind. + */ + public GermanAnalyzer german() { + return TaggedUnionUtils.get(this, Kind.German); + } + + + /** + * Is this variant instance of kind {@code greek}? + */ + public boolean isGreek() { + return _kind == Kind.Greek; + } + + /** + * Get the {@code greek} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code greek} kind. + */ + public GreekAnalyzer greek() { + return TaggedUnionUtils.get(this, Kind.Greek); + } + + + /** + * Is this variant instance of kind {@code hindi}? + */ + public boolean isHindi() { + return _kind == Kind.Hindi; + } + + /** + * Get the {@code hindi} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code hindi} kind. + */ + public HindiAnalyzer hindi() { + return TaggedUnionUtils.get(this, Kind.Hindi); + } + + + /** + * Is this variant instance of kind {@code hungarian}? + */ + public boolean isHungarian() { + return _kind == Kind.Hungarian; + } + + /** + * Get the {@code hungarian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code hungarian} kind. + */ + public HungarianAnalyzer hungarian() { + return TaggedUnionUtils.get(this, Kind.Hungarian); + } + + + /** + * Is this variant instance of kind {@code indonesian}? + */ + public boolean isIndonesian() { + return _kind == Kind.Indonesian; + } + + /** + * Get the {@code indonesian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code indonesian} kind. + */ + public IndonesianAnalyzer indonesian() { + return TaggedUnionUtils.get(this, Kind.Indonesian); + } + + + /** + * Is this variant instance of kind {@code irish}? + */ + public boolean isIrish() { + return _kind == Kind.Irish; + } + + /** + * Get the {@code irish} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code irish} kind. + */ + public IrishAnalyzer irish() { + return TaggedUnionUtils.get(this, Kind.Irish); + } + + + /** + * Is this variant instance of kind {@code italian}? + */ + public boolean isItalian() { + return _kind == Kind.Italian; + } + + /** + * Get the {@code italian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code italian} kind. + */ + public ItalianAnalyzer italian() { + return TaggedUnionUtils.get(this, Kind.Italian); + } + + + /** + * Is this variant instance of kind {@code latvian}? + */ + public boolean isLatvian() { + return _kind == Kind.Latvian; + } + + /** + * Get the {@code latvian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code latvian} kind. + */ + public LatvianAnalyzer latvian() { + return TaggedUnionUtils.get(this, Kind.Latvian); + } + + + /** + * Is this variant instance of kind {@code lithuanian}? + */ + public boolean isLithuanian() { + return _kind == Kind.Lithuanian; + } + + /** + * Get the {@code lithuanian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code lithuanian} kind. + */ + public LithuanianAnalyzer lithuanian() { + return TaggedUnionUtils.get(this, Kind.Lithuanian); + } + + + /** + * Is this variant instance of kind {@code norwegian}? + */ + public boolean isNorwegian() { + return _kind == Kind.Norwegian; + } + + /** + * Get the {@code norwegian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code norwegian} kind. + */ + public NorwegianAnalyzer norwegian() { + return TaggedUnionUtils.get(this, Kind.Norwegian); + } + + + /** + * Is this variant instance of kind {@code persian}? + */ + public boolean isPersian() { + return _kind == Kind.Persian; + } + + /** + * Get the {@code persian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code persian} kind. + */ + public PersianAnalyzer persian() { + return TaggedUnionUtils.get(this, Kind.Persian); + } + + + /** + * Is this variant instance of kind {@code portuguese}? + */ + public boolean isPortuguese() { + return _kind == Kind.Portuguese; + } + + /** + * Get the {@code portuguese} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code portuguese} kind. + */ + public PortugueseAnalyzer portuguese() { + return TaggedUnionUtils.get(this, Kind.Portuguese); + } + + + /** + * Is this variant instance of kind {@code romanian}? + */ + public boolean isRomanian() { + return _kind == Kind.Romanian; + } + + /** + * Get the {@code romanian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code romanian} kind. + */ + public RomanianAnalyzer romanian() { + return TaggedUnionUtils.get(this, Kind.Romanian); + } + + + /** + * Is this variant instance of kind {@code russian}? + */ + public boolean isRussian() { + return _kind == Kind.Russian; + } + + /** + * Get the {@code russian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code russian} kind. + */ + public RussianAnalyzer russian() { + return TaggedUnionUtils.get(this, Kind.Russian); + } + - @Override - public final Kind _kind() { - return _kind; + /** + * Is this variant instance of kind {@code sorani}? + */ + public boolean isSorani() { + return _kind == Kind.Sorani; } - @Override - public final AnalyzerVariant _get() { - return _value; + /** + * Get the {@code sorani} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code sorani} kind. + */ + public SoraniAnalyzer sorani() { + return TaggedUnionUtils.get(this, Kind.Sorani); } - public Analyzer(AnalyzerVariant value) { - - this._kind = ApiTypeHelper.requireNonNull(value._analyzerKind(), this, ""); - this._value = ApiTypeHelper.requireNonNull(value, this, ""); + /** + * Is this variant instance of kind {@code spanish}? + */ + public boolean isSpanish() { + return _kind == Kind.Spanish; } - private Analyzer(Builder builder) { + /** + * Get the {@code spanish} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code spanish} kind. + */ + public SpanishAnalyzer spanish() { + return TaggedUnionUtils.get(this, Kind.Spanish); + } - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + /** + * Is this variant instance of kind {@code swedish}? + */ + public boolean isSwedish() { + return _kind == Kind.Swedish; } - public static Analyzer of(Function> fn) { - return fn.apply(new Builder()).build(); + /** + * Get the {@code swedish} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code swedish} kind. + */ + public SwedishAnalyzer swedish() { + return TaggedUnionUtils.get(this, Kind.Swedish); } + /** - * Is this variant instance of kind {@code custom}? + * Is this variant instance of kind {@code turkish}? */ - public boolean isCustom() { - return _kind == Kind.Custom; + public boolean isTurkish() { + return _kind == Kind.Turkish; } /** - * Get the {@code custom} variant value. + * Get the {@code turkish} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code custom} kind. + * if the current variant is not of the {@code turkish} kind. */ - public CustomAnalyzer custom() { - return TaggedUnionUtils.get(this, Kind.Custom); + public TurkishAnalyzer turkish() { + return TaggedUnionUtils.get(this, Kind.Turkish); } + /** - * Is this variant instance of kind {@code dutch}? + * Is this variant instance of kind {@code thai}? */ - public boolean isDutch() { - return _kind == Kind.Dutch; + public boolean isThai() { + return _kind == Kind.Thai; } /** - * Get the {@code dutch} variant value. + * Get the {@code thai} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code dutch} kind. + * if the current variant is not of the {@code thai} kind. */ - public DutchAnalyzer dutch() { - return TaggedUnionUtils.get(this, Kind.Dutch); + public ThaiAnalyzer thai() { + return TaggedUnionUtils.get(this, Kind.Thai); } + /** * Is this variant instance of kind {@code fingerprint}? */ @@ -440,6 +1101,336 @@ public ObjectBuilder dutch(Function arabic(ArabicAnalyzer v) { + this._kind = Kind.Arabic; + this._value = v; + return this; + } + + public ObjectBuilder arabic(Function> fn) { + return this.arabic(fn.apply(new ArabicAnalyzer.Builder()).build()); + } + + public ObjectBuilder armenian(ArmenianAnalyzer v) { + this._kind = Kind.Armenian; + this._value = v; + return this; + } + + public ObjectBuilder armenian(Function> fn) { + return this.armenian(fn.apply(new ArmenianAnalyzer.Builder()).build()); + } + + public ObjectBuilder basque(BasqueAnalyzer v) { + this._kind = Kind.Basque; + this._value = v; + return this; + } + + public ObjectBuilder basque(Function> fn) { + return this.basque(fn.apply(new BasqueAnalyzer.Builder()).build()); + } + + public ObjectBuilder bengali(BengaliAnalyzer v) { + this._kind = Kind.Bengali; + this._value = v; + return this; + } + + public ObjectBuilder bengali(Function> fn) { + return this.bengali(fn.apply(new BengaliAnalyzer.Builder()).build()); + } + + public ObjectBuilder brazilian(BrazilianAnalyzer v) { + this._kind = Kind.Brazilian; + this._value = v; + return this; + } + + public ObjectBuilder brazilian(Function> fn) { + return this.brazilian(fn.apply(new BrazilianAnalyzer.Builder()).build()); + } + + public ObjectBuilder bulgarian(BulgarianAnalyzer v) { + this._kind = Kind.Bulgarian; + this._value = v; + return this; + } + + public ObjectBuilder bulgarian(Function> fn) { + return this.bulgarian(fn.apply(new BulgarianAnalyzer.Builder()).build()); + } + + public ObjectBuilder catalan(CatalanAnalyzer v) { + this._kind = Kind.Catalan; + this._value = v; + return this; + } + + public ObjectBuilder catalan(Function> fn) { + return this.catalan(fn.apply(new CatalanAnalyzer.Builder()).build()); + } + + public ObjectBuilder czech(CzechAnalyzer v) { + this._kind = Kind.Czech; + this._value = v; + return this; + } + + public ObjectBuilder czech(Function> fn) { + return this.czech(fn.apply(new CzechAnalyzer.Builder()).build()); + } + + public ObjectBuilder danish(DanishAnalyzer v) { + this._kind = Kind.Danish; + this._value = v; + return this; + } + + public ObjectBuilder danish(Function> fn) { + return this.danish(fn.apply(new DanishAnalyzer.Builder()).build()); + } + + public ObjectBuilder english(EnglishAnalyzer v) { + this._kind = Kind.English; + this._value = v; + return this; + } + + public ObjectBuilder english(Function> fn) { + return this.english(fn.apply(new EnglishAnalyzer.Builder()).build()); + } + + public ObjectBuilder estonian(EstonianAnalyzer v) { + this._kind = Kind.Estonian; + this._value = v; + return this; + } + + public ObjectBuilder estonian(Function> fn) { + return this.estonian(fn.apply(new EstonianAnalyzer.Builder()).build()); + } + + public ObjectBuilder finnish(FinnishAnalyzer v) { + this._kind = Kind.Finnish; + this._value = v; + return this; + } + + public ObjectBuilder finnish(Function> fn) { + return this.finnish(fn.apply(new FinnishAnalyzer.Builder()).build()); + } + + public ObjectBuilder french(FrenchAnalyzer v) { + this._kind = Kind.French; + this._value = v; + return this; + } + + public ObjectBuilder french(Function> fn) { + return this.french(fn.apply(new FrenchAnalyzer.Builder()).build()); + } + + public ObjectBuilder galician(GalicianAnalyzer v) { + this._kind = Kind.Galician; + this._value = v; + return this; + } + + public ObjectBuilder galician(Function> fn) { + return this.galician(fn.apply(new GalicianAnalyzer.Builder()).build()); + } + + public ObjectBuilder german(GermanAnalyzer v) { + this._kind = Kind.German; + this._value = v; + return this; + } + + public ObjectBuilder german(Function> fn) { + return this.german(fn.apply(new GermanAnalyzer.Builder()).build()); + } + + public ObjectBuilder greek(GreekAnalyzer v) { + this._kind = Kind.Greek; + this._value = v; + return this; + } + + public ObjectBuilder greek(Function> fn) { + return this.greek(fn.apply(new GreekAnalyzer.Builder()).build()); + } + + public ObjectBuilder hindi(HindiAnalyzer v) { + this._kind = Kind.Hindi; + this._value = v; + return this; + } + + public ObjectBuilder hindi(Function> fn) { + return this.hindi(fn.apply(new HindiAnalyzer.Builder()).build()); + } + + public ObjectBuilder hungarian(HungarianAnalyzer v) { + this._kind = Kind.Hungarian; + this._value = v; + return this; + } + + public ObjectBuilder hungarian(Function> fn) { + return this.hungarian(fn.apply(new HungarianAnalyzer.Builder()).build()); + } + + public ObjectBuilder indonesian(IndonesianAnalyzer v) { + this._kind = Kind.Indonesian; + this._value = v; + return this; + } + + public ObjectBuilder indonesian(Function> fn) { + return this.indonesian(fn.apply(new IndonesianAnalyzer.Builder()).build()); + } + + public ObjectBuilder irish(IrishAnalyzer v) { + this._kind = Kind.Irish; + this._value = v; + return this; + } + + public ObjectBuilder irish(Function> fn) { + return this.irish(fn.apply(new IrishAnalyzer.Builder()).build()); + } + + public ObjectBuilder italian(ItalianAnalyzer v) { + this._kind = Kind.Italian; + this._value = v; + return this; + } + + public ObjectBuilder italian(Function> fn) { + return this.italian(fn.apply(new ItalianAnalyzer.Builder()).build()); + } + + public ObjectBuilder latvian(LatvianAnalyzer v) { + this._kind = Kind.Latvian; + this._value = v; + return this; + } + + public ObjectBuilder latvian(Function> fn) { + return this.latvian(fn.apply(new LatvianAnalyzer.Builder()).build()); + } + + public ObjectBuilder lithuanian(LithuanianAnalyzer v) { + this._kind = Kind.Lithuanian; + this._value = v; + return this; + } + + public ObjectBuilder lithuanian(Function> fn) { + return this.lithuanian(fn.apply(new LithuanianAnalyzer.Builder()).build()); + } + + public ObjectBuilder norwegian(NorwegianAnalyzer v) { + this._kind = Kind.Norwegian; + this._value = v; + return this; + } + + public ObjectBuilder norwegian(Function> fn) { + return this.norwegian(fn.apply(new NorwegianAnalyzer.Builder()).build()); + } + + public ObjectBuilder persian(PersianAnalyzer v) { + this._kind = Kind.Persian; + this._value = v; + return this; + } + + public ObjectBuilder persian(Function> fn) { + return this.persian(fn.apply(new PersianAnalyzer.Builder()).build()); + } + + public ObjectBuilder portuguese(PortugueseAnalyzer v) { + this._kind = Kind.Portuguese; + this._value = v; + return this; + } + + public ObjectBuilder portuguese(Function> fn) { + return this.portuguese(fn.apply(new PortugueseAnalyzer.Builder()).build()); + } + + public ObjectBuilder romanian(RomanianAnalyzer v) { + this._kind = Kind.Romanian; + this._value = v; + return this; + } + + public ObjectBuilder romanian(Function> fn) { + return this.romanian(fn.apply(new RomanianAnalyzer.Builder()).build()); + } + + public ObjectBuilder russian(RussianAnalyzer v) { + this._kind = Kind.Russian; + this._value = v; + return this; + } + + public ObjectBuilder russian(Function> fn) { + return this.russian(fn.apply(new RussianAnalyzer.Builder()).build()); + } + + public ObjectBuilder sorani(SoraniAnalyzer v) { + this._kind = Kind.Sorani; + this._value = v; + return this; + } + + public ObjectBuilder sorani(Function> fn) { + return this.sorani(fn.apply(new SoraniAnalyzer.Builder()).build()); + } + + public ObjectBuilder spanish(SpanishAnalyzer v) { + this._kind = Kind.Spanish; + this._value = v; + return this; + } + + public ObjectBuilder spanish(Function> fn) { + return this.spanish(fn.apply(new SpanishAnalyzer.Builder()).build()); + } + + public ObjectBuilder swedish(SwedishAnalyzer v) { + this._kind = Kind.Swedish; + this._value = v; + return this; + } + + public ObjectBuilder swedish(Function> fn) { + return this.swedish(fn.apply(new SwedishAnalyzer.Builder()).build()); + } + + public ObjectBuilder turkish(TurkishAnalyzer v) { + this._kind = Kind.Turkish; + this._value = v; + return this; + } + + public ObjectBuilder turkish(Function> fn) { + return this.turkish(fn.apply(new TurkishAnalyzer.Builder()).build()); + } + + public ObjectBuilder thai(ThaiAnalyzer v) { + this._kind = Kind.Thai; + this._value = v; + return this; + } + + public ObjectBuilder thai(Function> fn) { + return this.thai(fn.apply(new ThaiAnalyzer.Builder()).build()); + } + public ObjectBuilder fingerprint(FingerprintAnalyzer v) { this._kind = Kind.Fingerprint; this._value = v; @@ -591,6 +1582,39 @@ protected static void setupAnalyzerDeserializer(ObjectDeserializer op) op.add(Builder::custom, CustomAnalyzer._DESERIALIZER, "custom"); op.add(Builder::dutch, DutchAnalyzer._DESERIALIZER, "dutch"); + op.add(Builder::arabic, ArabicAnalyzer._DESERIALIZER, "arabic"); + op.add(Builder::armenian, ArmenianAnalyzer._DESERIALIZER, "armenian"); + op.add(Builder::basque, BasqueAnalyzer._DESERIALIZER, "basque"); + op.add(Builder::bengali, BengaliAnalyzer._DESERIALIZER, "bengali"); + op.add(Builder::brazilian, BrazilianAnalyzer._DESERIALIZER, "brazilian"); + op.add(Builder::bulgarian, BulgarianAnalyzer._DESERIALIZER, "bulgarian"); + op.add(Builder::catalan, CatalanAnalyzer._DESERIALIZER, "catalan"); + op.add(Builder::czech, CzechAnalyzer._DESERIALIZER, "czech"); + op.add(Builder::danish, DanishAnalyzer._DESERIALIZER, "danish"); + op.add(Builder::english, EnglishAnalyzer._DESERIALIZER, "english"); + op.add(Builder::estonian, EstonianAnalyzer._DESERIALIZER, "estonian"); + op.add(Builder::finnish, FinnishAnalyzer._DESERIALIZER, "finnish"); + op.add(Builder::french, FrenchAnalyzer._DESERIALIZER, "french"); + op.add(Builder::galician, GalicianAnalyzer._DESERIALIZER, "galician"); + op.add(Builder::german, GermanAnalyzer._DESERIALIZER, "german"); + op.add(Builder::greek, GreekAnalyzer._DESERIALIZER, "greek"); + op.add(Builder::hindi, HindiAnalyzer._DESERIALIZER, "hindi"); + op.add(Builder::hungarian, HungarianAnalyzer._DESERIALIZER, "hungarian"); + op.add(Builder::indonesian, IndonesianAnalyzer._DESERIALIZER, "indonesian"); + op.add(Builder::irish, IrishAnalyzer._DESERIALIZER, "irish"); + op.add(Builder::italian, ItalianAnalyzer._DESERIALIZER, "italian"); + op.add(Builder::latvian, LatvianAnalyzer._DESERIALIZER, "latvian"); + op.add(Builder::lithuanian, LithuanianAnalyzer._DESERIALIZER, "lithuanian"); + op.add(Builder::norwegian, NorwegianAnalyzer._DESERIALIZER, "norwegian"); + op.add(Builder::persian, PersianAnalyzer._DESERIALIZER, "persian"); + op.add(Builder::portuguese, PortugueseAnalyzer._DESERIALIZER, "portuguese"); + op.add(Builder::romanian, RomanianAnalyzer._DESERIALIZER, "romanian"); + op.add(Builder::russian, RussianAnalyzer._DESERIALIZER, "russian"); + op.add(Builder::sorani, SoraniAnalyzer._DESERIALIZER, "sorani"); + op.add(Builder::spanish, SpanishAnalyzer._DESERIALIZER, "spanish"); + op.add(Builder::swedish, SwedishAnalyzer._DESERIALIZER, "swedish"); + op.add(Builder::turkish, TurkishAnalyzer._DESERIALIZER, "turkish"); + op.add(Builder::thai, ThaiAnalyzer._DESERIALIZER, "thai"); op.add(Builder::fingerprint, FingerprintAnalyzer._DESERIALIZER, "fingerprint"); op.add(Builder::icuAnalyzer, IcuAnalyzer._DESERIALIZER, "icu_analyzer"); op.add(Builder::keyword, KeywordAnalyzer._DESERIALIZER, "keyword"); diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArabicAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArabicAnalyzer.java new file mode 100644 index 0000000000..e0eecb831b --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArabicAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.ArabicAnalyzer + +@JsonpDeserializable +public class ArabicAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private ArabicAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static ArabicAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Arabic; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "arabic"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ArabicAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link ArabicAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ArabicAnalyzer build() { + _checkSingleUse(); + + return new ArabicAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ArabicAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + ArabicAnalyzer::setupArabicAnalyzerDeserializer + ); + + protected static void setupArabicAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArmenianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArmenianAnalyzer.java new file mode 100644 index 0000000000..aea1e336a3 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArmenianAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.ArmenianAnalyzer + +@JsonpDeserializable +public class ArmenianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private ArmenianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static ArmenianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Armenian; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "armenian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ArmenianAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link ArmenianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ArmenianAnalyzer build() { + _checkSingleUse(); + + return new ArmenianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ArmenianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + ArmenianAnalyzer::setupArmenianAnalyzerDeserializer + ); + + protected static void setupArmenianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BasqueAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BasqueAnalyzer.java new file mode 100644 index 0000000000..d98cd38418 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BasqueAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.BasqueAnalyzer + +@JsonpDeserializable +public class BasqueAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private BasqueAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static BasqueAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Basque; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "basque"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link BasqueAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link BasqueAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public BasqueAnalyzer build() { + _checkSingleUse(); + + return new BasqueAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link BasqueAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + BasqueAnalyzer::setupBasqueAnalyzerDeserializer + ); + + protected static void setupBasqueAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BengaliAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BengaliAnalyzer.java new file mode 100644 index 0000000000..73b2114030 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BengaliAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.BengaliAnalyzer + +@JsonpDeserializable +public class BengaliAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private BengaliAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static BengaliAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Bengali; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "bengali"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link BengaliAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link BengaliAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public BengaliAnalyzer build() { + _checkSingleUse(); + + return new BengaliAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link BengaliAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + BengaliAnalyzer::setupBengaliAnalyzerDeserializer + ); + + protected static void setupBengaliAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BrazilianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BrazilianAnalyzer.java new file mode 100644 index 0000000000..457b4dc420 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BrazilianAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.BrazilianAnalyzer + +@JsonpDeserializable +public class BrazilianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private BrazilianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static BrazilianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Brazilian; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "brazilian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link BrazilianAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link BrazilianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public BrazilianAnalyzer build() { + _checkSingleUse(); + + return new BrazilianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link BrazilianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + BrazilianAnalyzer::setupBrazilianAnalyzerDeserializer + ); + + protected static void setupBrazilianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BulgarianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BulgarianAnalyzer.java new file mode 100644 index 0000000000..4fc055fabe --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BulgarianAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.BulgarianAnalyzer + +@JsonpDeserializable +public class BulgarianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private BulgarianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static BulgarianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Bulgarian; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "bulgarian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link BulgarianAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link BulgarianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public BulgarianAnalyzer build() { + _checkSingleUse(); + + return new BulgarianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link BulgarianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + BulgarianAnalyzer::setupBulgarianAnalyzerDeserializer + ); + + protected static void setupBulgarianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CatalanAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CatalanAnalyzer.java new file mode 100644 index 0000000000..df14d3aa95 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CatalanAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.CatalanAnalyzer + +@JsonpDeserializable +public class CatalanAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private CatalanAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static CatalanAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Catalan; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "catalan"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CatalanAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link CatalanAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CatalanAnalyzer build() { + _checkSingleUse(); + + return new CatalanAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CatalanAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + CatalanAnalyzer::setupCatalanAnalyzerDeserializer + ); + + protected static void setupCatalanAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CzechAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CzechAnalyzer.java new file mode 100644 index 0000000000..9e9747aa69 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CzechAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.CzechAnalyzer + +@JsonpDeserializable +public class CzechAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private CzechAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static CzechAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Czech; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "czech"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CzechAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link CzechAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CzechAnalyzer build() { + _checkSingleUse(); + + return new CzechAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CzechAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + CzechAnalyzer::setupCzechAnalyzerDeserializer + ); + + protected static void setupCzechAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/DanishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/DanishAnalyzer.java new file mode 100644 index 0000000000..67d3c5fada --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/DanishAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.DanishAnalyzer + +@JsonpDeserializable +public class DanishAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private DanishAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static DanishAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Danish; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "danish"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DanishAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link DanishAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DanishAnalyzer build() { + _checkSingleUse(); + + return new DanishAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DanishAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + DanishAnalyzer::setupDanishAnalyzerDeserializer + ); + + protected static void setupDanishAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EnglishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EnglishAnalyzer.java new file mode 100644 index 0000000000..6ce7f33c91 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EnglishAnalyzer.java @@ -0,0 +1,164 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import org.opensearch.client.json.*; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +import javax.annotation.Nullable; +import java.util.List; +import java.util.function.Function; + +// typedef: _types.analysis.EnglishAnalyzer + +@JsonpDeserializable +public class EnglishAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private EnglishAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static EnglishAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.English; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "english"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link EnglishAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link EnglishAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public EnglishAnalyzer build() { + _checkSingleUse(); + + return new EnglishAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link EnglishAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + EnglishAnalyzer::setupEnglishAnalyzerDeserializer + ); + + protected static void setupEnglishAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EstonianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EstonianAnalyzer.java new file mode 100644 index 0000000000..a0546504f5 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EstonianAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.EstonianAnalyzer + +@JsonpDeserializable +public class EstonianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private EstonianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static EstonianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Estonian; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "estonian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link EstonianAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link EstonianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public EstonianAnalyzer build() { + _checkSingleUse(); + + return new EstonianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link EstonianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + EstonianAnalyzer::setupEstonianAnalyzerDeserializer + ); + + protected static void setupEstonianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FinnishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FinnishAnalyzer.java new file mode 100644 index 0000000000..61ded93bb6 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FinnishAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.FinnishAnalyzer + +@JsonpDeserializable +public class FinnishAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private FinnishAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static FinnishAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Finnish; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "finnish"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link FinnishAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link FinnishAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public FinnishAnalyzer build() { + _checkSingleUse(); + + return new FinnishAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link FinnishAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + FinnishAnalyzer::setupFinnishAnalyzerDeserializer + ); + + protected static void setupFinnishAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FrenchAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FrenchAnalyzer.java new file mode 100644 index 0000000000..864ccd382f --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FrenchAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.FrenchAnalyzer + +@JsonpDeserializable +public class FrenchAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private FrenchAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static FrenchAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.French; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "french"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link FrenchAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link FrenchAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public FrenchAnalyzer build() { + _checkSingleUse(); + + return new FrenchAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link FrenchAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + FrenchAnalyzer::setupFrenchAnalyzerDeserializer + ); + + protected static void setupFrenchAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GalicianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GalicianAnalyzer.java new file mode 100644 index 0000000000..fd421dc2d7 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GalicianAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.GalicianAnalyzer + +@JsonpDeserializable +public class GalicianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private GalicianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static GalicianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Galician; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "galician"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GalicianAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link GalicianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GalicianAnalyzer build() { + _checkSingleUse(); + + return new GalicianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GalicianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + GalicianAnalyzer::setupGalicianAnalyzerDeserializer + ); + + protected static void setupGalicianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GermanAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GermanAnalyzer.java new file mode 100644 index 0000000000..b3357d3198 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GermanAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.GermanAnalyzer + +@JsonpDeserializable +public class GermanAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private GermanAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static GermanAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.German; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "german"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GermanAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link GermanAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GermanAnalyzer build() { + _checkSingleUse(); + + return new GermanAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GermanAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + GermanAnalyzer::setupGermanAnalyzerDeserializer + ); + + protected static void setupGermanAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GreekAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GreekAnalyzer.java new file mode 100644 index 0000000000..0401f3e51d --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GreekAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.GreekAnalyzer + +@JsonpDeserializable +public class GreekAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private GreekAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static GreekAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Greek; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "greek"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GreekAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link GreekAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GreekAnalyzer build() { + _checkSingleUse(); + + return new GreekAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GreekAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + GreekAnalyzer::setupGreekAnalyzerDeserializer + ); + + protected static void setupGreekAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HindiAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HindiAnalyzer.java new file mode 100644 index 0000000000..0ad26b6593 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HindiAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.HindiAnalyzer + +@JsonpDeserializable +public class HindiAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private HindiAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static HindiAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Hindi; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "hindi"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link HindiAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link HindiAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public HindiAnalyzer build() { + _checkSingleUse(); + + return new HindiAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link HindiAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + HindiAnalyzer::setupHindiAnalyzerDeserializer + ); + + protected static void setupHindiAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HungarianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HungarianAnalyzer.java new file mode 100644 index 0000000000..ba49430926 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HungarianAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.HungarianAnalyzer + +@JsonpDeserializable +public class HungarianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private HungarianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static HungarianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Hungarian; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "hungarian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link HungarianAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link HungarianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public HungarianAnalyzer build() { + _checkSingleUse(); + + return new HungarianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link HungarianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + HungarianAnalyzer::setupHungarianAnalyzerDeserializer + ); + + protected static void setupHungarianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IndonesianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IndonesianAnalyzer.java new file mode 100644 index 0000000000..562e05c7af --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IndonesianAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.IndonesianAnalyzer + +@JsonpDeserializable +public class IndonesianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private IndonesianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static IndonesianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Indonesian; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "indonesian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndonesianAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link IndonesianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndonesianAnalyzer build() { + _checkSingleUse(); + + return new IndonesianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndonesianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IndonesianAnalyzer::setupIndonesianAnalyzerDeserializer + ); + + protected static void setupIndonesianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IrishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IrishAnalyzer.java new file mode 100644 index 0000000000..95f2ce367b --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IrishAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.IrishAnalyzer + +@JsonpDeserializable +public class IrishAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private IrishAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static IrishAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Irish; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "irish"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IrishAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link IrishAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IrishAnalyzer build() { + _checkSingleUse(); + + return new IrishAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IrishAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + IrishAnalyzer::setupIrishAnalyzerDeserializer + ); + + protected static void setupIrishAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ItalianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ItalianAnalyzer.java new file mode 100644 index 0000000000..7dabce276e --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ItalianAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.ItalianAnalyzer + +@JsonpDeserializable +public class ItalianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private ItalianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static ItalianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Italian; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "italian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ItalianAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link ItalianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ItalianAnalyzer build() { + _checkSingleUse(); + + return new ItalianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ItalianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + ItalianAnalyzer::setupItalianAnalyzerDeserializer + ); + + protected static void setupItalianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LatvianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LatvianAnalyzer.java new file mode 100644 index 0000000000..37c311cee3 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LatvianAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.LatvianAnalyzer + +@JsonpDeserializable +public class LatvianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private LatvianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static LatvianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Latvian; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "latvian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link LatvianAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link LatvianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public LatvianAnalyzer build() { + _checkSingleUse(); + + return new LatvianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link LatvianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + LatvianAnalyzer::setupLatvianAnalyzerDeserializer + ); + + protected static void setupLatvianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LithuanianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LithuanianAnalyzer.java new file mode 100644 index 0000000000..b9c13f47fb --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LithuanianAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.LithuanianAnalyzer + +@JsonpDeserializable +public class LithuanianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private LithuanianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static LithuanianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Lithuanian; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "lithuanian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link LithuanianAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link LithuanianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public LithuanianAnalyzer build() { + _checkSingleUse(); + + return new LithuanianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link LithuanianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + LithuanianAnalyzer::setupLithuanianAnalyzerDeserializer + ); + + protected static void setupLithuanianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/NorwegianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/NorwegianAnalyzer.java new file mode 100644 index 0000000000..e33f8d6c72 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/NorwegianAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.NorwegianAnalyzer + +@JsonpDeserializable +public class NorwegianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private NorwegianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static NorwegianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Norwegian; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "norwegian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link NorwegianAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link NorwegianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public NorwegianAnalyzer build() { + _checkSingleUse(); + + return new NorwegianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link NorwegianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + NorwegianAnalyzer::setupNorwegianAnalyzerDeserializer + ); + + protected static void setupNorwegianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PersianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PersianAnalyzer.java new file mode 100644 index 0000000000..d8a4dcbbb7 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PersianAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.PersianAnalyzer + +@JsonpDeserializable +public class PersianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private PersianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static PersianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Persian; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "persian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PersianAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link PersianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PersianAnalyzer build() { + _checkSingleUse(); + + return new PersianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PersianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + PersianAnalyzer::setupPersianAnalyzerDeserializer + ); + + protected static void setupPersianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PortugueseAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PortugueseAnalyzer.java new file mode 100644 index 0000000000..2f30b9d2d4 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PortugueseAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.PortugueseAnalyzer + +@JsonpDeserializable +public class PortugueseAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private PortugueseAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static PortugueseAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Portuguese; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "portuguese"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PortugueseAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link PortugueseAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PortugueseAnalyzer build() { + _checkSingleUse(); + + return new PortugueseAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PortugueseAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + PortugueseAnalyzer::setupPortugueseAnalyzerDeserializer + ); + + protected static void setupPortugueseAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RomanianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RomanianAnalyzer.java new file mode 100644 index 0000000000..24d9867005 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RomanianAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.RomanianAnalyzer + +@JsonpDeserializable +public class RomanianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private RomanianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static RomanianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Romanian; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "romanian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link RomanianAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link RomanianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public RomanianAnalyzer build() { + _checkSingleUse(); + + return new RomanianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link RomanianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + RomanianAnalyzer::setupRomanianAnalyzerDeserializer + ); + + protected static void setupRomanianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RussianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RussianAnalyzer.java new file mode 100644 index 0000000000..9f6dff4da6 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RussianAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.RussianAnalyzer + +@JsonpDeserializable +public class RussianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private RussianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static RussianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Russian; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "russian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link RussianAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link RussianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public RussianAnalyzer build() { + _checkSingleUse(); + + return new RussianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link RussianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + RussianAnalyzer::setupRussianAnalyzerDeserializer + ); + + protected static void setupRussianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SoraniAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SoraniAnalyzer.java new file mode 100644 index 0000000000..863d6ca146 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SoraniAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.SoraniAnalyzer + +@JsonpDeserializable +public class SoraniAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private SoraniAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static SoraniAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Sorani; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "sorani"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SoraniAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link SoraniAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SoraniAnalyzer build() { + _checkSingleUse(); + + return new SoraniAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SoraniAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + SoraniAnalyzer::setupSoraniAnalyzerDeserializer + ); + + protected static void setupSoraniAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SpanishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SpanishAnalyzer.java new file mode 100644 index 0000000000..ff1b7dd1f8 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SpanishAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.SpanishAnalyzer + +@JsonpDeserializable +public class SpanishAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private SpanishAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static SpanishAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Spanish; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "spanish"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SpanishAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link SpanishAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SpanishAnalyzer build() { + _checkSingleUse(); + + return new SpanishAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SpanishAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + SpanishAnalyzer::setupSpanishAnalyzerDeserializer + ); + + protected static void setupSpanishAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SwedishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SwedishAnalyzer.java new file mode 100644 index 0000000000..cf56594079 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SwedishAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.SwedishAnalyzer + +@JsonpDeserializable +public class SwedishAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private SwedishAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static SwedishAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Swedish; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "swedish"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SwedishAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link SwedishAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SwedishAnalyzer build() { + _checkSingleUse(); + + return new SwedishAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SwedishAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + SwedishAnalyzer::setupSwedishAnalyzerDeserializer + ); + + protected static void setupSwedishAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ThaiAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ThaiAnalyzer.java new file mode 100644 index 0000000000..710eaa5e3f --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ThaiAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.ThaiAnalyzer + +@JsonpDeserializable +public class ThaiAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private ThaiAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static ThaiAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Thai; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "thai"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ThaiAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link ThaiAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ThaiAnalyzer build() { + _checkSingleUse(); + + return new ThaiAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ThaiAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + ThaiAnalyzer::setupThaiAnalyzerDeserializer + ); + + protected static void setupThaiAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/TurkishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/TurkishAnalyzer.java new file mode 100644 index 0000000000..37d5e5c315 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/TurkishAnalyzer.java @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +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.JsonpSerializable; +import org.opensearch.client.json.ObjectBuilderDeserializer; +import org.opensearch.client.json.ObjectDeserializer; +import org.opensearch.client.util.ApiTypeHelper; +import org.opensearch.client.util.ObjectBuilder; +import org.opensearch.client.util.ObjectBuilderBase; + +// typedef: _types.analysis.TurkishAnalyzer + +@JsonpDeserializable +public class TurkishAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + // --------------------------------------------------------------------------------------------- + + private TurkishAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + + } + + public static TurkishAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Turkish; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "turkish"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link TurkishAnalyzer}. + */ + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + /** + * API name: {@code stopwords} + *

+ * Adds all elements of list to stopwords. + */ + public final Builder stopwords(List list) { + this.stopwords = _listAddAll(this.stopwords, list); + return this; + } + + /** + * API name: {@code stopwords} + *

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * Builds a {@link TurkishAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public TurkishAnalyzer build() { + _checkSingleUse(); + + return new TurkishAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link TurkishAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( + Builder::new, + TurkishAnalyzer::setupTurkishAnalyzerDeserializer + ); + + protected static void setupTurkishAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); + + op.ignore("type"); + } + +} From 12bf07b07e4c088913c94ce6389e5a3de24e3005 Mon Sep 17 00:00:00 2001 From: brentam Date: Thu, 21 Dec 2023 23:14:29 +1100 Subject: [PATCH 2/9] test to verify the language analyzers are parsed correctly Signed-off-by: brentam --- .../_types/analysis/AnalyzerKindTest.java | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java b/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java new file mode 100644 index 0000000000..08bd84a3d2 --- /dev/null +++ b/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java @@ -0,0 +1,125 @@ +/* + * 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. + */ + +package org.opensearch.client.opensearch._types.analysis; + +import jakarta.json.stream.JsonParser; +import org.junit.Assert; +import org.junit.Test; +import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.jsonb.JsonbJsonpMapper; +import org.opensearch.client.opensearch.indices.IndexSettings; + +import java.io.StringReader; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.List; + +public class AnalyzerKindTest extends Assert { + + /** + * Test if we can deserialize the language analyzers + * it uses reflection to avoid having to duplicate tests for all 34 currently supported languages + * + * @throws NoSuchMethodException + * @throws InvocationTargetException + * @throws IllegalAccessException + * @throws ClassNotFoundException + */ + @Test + public void testParsingAnalyzersForLanguages() throws NoSuchMethodException, InvocationTargetException, + IllegalAccessException, ClassNotFoundException, NullPointerException { + JsonpMapper mapper = new JsonbJsonpMapper(); + + for (Analyzer.Kind theKind : onlyLanguageAnalyzers) { + String type = theKind.jsonValue(); + String typeCapitalized = type.substring(0, 1).toUpperCase() + type.substring(1); + String json = String.format("{ \"index\": { \"analysis\": { \"analyzer\": { \"some_analyzer\": { \"type\": \"%s\"," + + " \"char_filter\": [ \"html_strip\" ], \"tokenizer\": \"standard\" } } } } } ", type); + + JsonParser parser = mapper.jsonProvider().createParser(new StringReader(json)); + IndexSettings indexSettings = IndexSettings._DESERIALIZER.deserialize(parser, mapper); + Analyzer someAnalyzer = indexSettings.index().analysis().analyzer().get("some_analyzer"); + + // Use reflection to generically check analyzer type + Method isMethod = someAnalyzer.getClass().getMethod("is" + typeCapitalized); + assertTrue((boolean) isMethod.invoke(someAnalyzer)); + + + String analyzerClassName = typeCapitalized + "Analyzer"; + + // Use reflection to generically check analyzer class + Method getAnalyzerMethod = someAnalyzer.getClass().getMethod(type); + Object analyzerInstance = getAnalyzerMethod.invoke(someAnalyzer); + Package pk = analyzerInstance.getClass().getPackage(); + assertEquals(analyzerInstance.getClass(), Class.forName(pk.getName() + "." + analyzerClassName)); + } + } + + private final List onlyLanguageAnalyzers = List.of( + Analyzer.Kind.Arabic, + Analyzer.Kind.Armenian, + Analyzer.Kind.Basque, + Analyzer.Kind.Bengali, + Analyzer.Kind.Brazilian, + Analyzer.Kind.Bulgarian, + Analyzer.Kind.Catalan, + Analyzer.Kind.Czech, + Analyzer.Kind.Danish, + Analyzer.Kind.Dutch, + Analyzer.Kind.English, + Analyzer.Kind.Estonian, + Analyzer.Kind.Finnish, + Analyzer.Kind.French, + Analyzer.Kind.Galician, + Analyzer.Kind.German, + Analyzer.Kind.Greek, + Analyzer.Kind.Hindi, + Analyzer.Kind.Hungarian, + Analyzer.Kind.Indonesian, + Analyzer.Kind.Irish, + Analyzer.Kind.Italian, + Analyzer.Kind.Latvian, + Analyzer.Kind.Lithuanian, + Analyzer.Kind.Norwegian, + Analyzer.Kind.Persian, + Analyzer.Kind.Portuguese, + Analyzer.Kind.Romanian, + Analyzer.Kind.Russian, + Analyzer.Kind.Sorani, + Analyzer.Kind.Spanish, + Analyzer.Kind.Swedish, + Analyzer.Kind.Turkish, + Analyzer.Kind.Thai + ); + +} \ No newline at end of file From 31a76219deee9506a3fbacbf9683ce65654542d2 Mon Sep 17 00:00:00 2001 From: brentam Date: Thu, 21 Dec 2023 23:15:19 +1100 Subject: [PATCH 3/9] dummy CHANGELOG.md Signed-off-by: brentam --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b28c79c7d..5a480c7d38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This section is for maintaining a changelog for all breaking changes for the cli ### Added - Document HTTP/2 support ([#330](https://github.com/opensearch-project/opensearch-java/pull/330)) - Expose HTTP status code through `ResponseException#status` ([#756](https://github.com/opensearch-project/opensearch-java/pull/756)) +- Added support for 33 new language analyzers (only Dutch existed previously) ([#000](https://github.com/opensearch-project/opensearch-java/pull/ooo)) ### Dependencies From 843be49e895e3029f732dddfbbe2054bfbb4fa05 Mon Sep 17 00:00:00 2001 From: brentam Date: Fri, 22 Dec 2023 09:30:00 +1100 Subject: [PATCH 4/9] adding information about the real PR to CHANGELOG.md Signed-off-by: brentam --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a480c7d38..32ac7aabb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ This section is for maintaining a changelog for all breaking changes for the cli ### Added - Document HTTP/2 support ([#330](https://github.com/opensearch-project/opensearch-java/pull/330)) - Expose HTTP status code through `ResponseException#status` ([#756](https://github.com/opensearch-project/opensearch-java/pull/756)) -- Added support for 33 new language analyzers (only Dutch existed previously) ([#000](https://github.com/opensearch-project/opensearch-java/pull/ooo)) +- Added support for 33 new language analyzers (only Dutch existed previously) ([#779](https://github.com/opensearch-project/opensearch-java/pull/779)) ### Dependencies From f3412c6a33441b43548154de0717bae80b604b2d Mon Sep 17 00:00:00 2001 From: brentam Date: Sat, 23 Dec 2023 23:45:09 +1100 Subject: [PATCH 5/9] ran ./gradlew :java-client:spotlessApply Signed-off-by: brentam --- .../opensearch/_types/analysis/Analyzer.java | 34 ------ .../_types/analysis/EnglishAnalyzer.java | 7 +- .../_types/analysis/AnalyzerKindTest.java | 100 +++++++++--------- 3 files changed, 54 insertions(+), 87 deletions(-) diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java index a9041312c6..e48e78be66 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java @@ -237,8 +237,6 @@ public DutchAnalyzer dutch() { return TaggedUnionUtils.get(this, Kind.Dutch); } - - /** * Is this variant instance of kind {@code arabic}? */ @@ -256,7 +254,6 @@ public ArabicAnalyzer arabic() { return TaggedUnionUtils.get(this, Kind.Arabic); } - /** * Is this variant instance of kind {@code armenian}? */ @@ -274,7 +271,6 @@ public ArmenianAnalyzer armenian() { return TaggedUnionUtils.get(this, Kind.Armenian); } - /** * Is this variant instance of kind {@code basque}? */ @@ -292,7 +288,6 @@ public BasqueAnalyzer basque() { return TaggedUnionUtils.get(this, Kind.Basque); } - /** * Is this variant instance of kind {@code bengali}? */ @@ -310,7 +305,6 @@ public BengaliAnalyzer bengali() { return TaggedUnionUtils.get(this, Kind.Bengali); } - /** * Is this variant instance of kind {@code brazilian}? */ @@ -328,7 +322,6 @@ public BrazilianAnalyzer brazilian() { return TaggedUnionUtils.get(this, Kind.Brazilian); } - /** * Is this variant instance of kind {@code bulgarian}? */ @@ -346,7 +339,6 @@ public BulgarianAnalyzer bulgarian() { return TaggedUnionUtils.get(this, Kind.Bulgarian); } - /** * Is this variant instance of kind {@code catalan}? */ @@ -364,7 +356,6 @@ public CatalanAnalyzer catalan() { return TaggedUnionUtils.get(this, Kind.Catalan); } - /** * Is this variant instance of kind {@code czech}? */ @@ -382,7 +373,6 @@ public CzechAnalyzer czech() { return TaggedUnionUtils.get(this, Kind.Czech); } - /** * Is this variant instance of kind {@code danish}? */ @@ -417,7 +407,6 @@ public EnglishAnalyzer english() { return TaggedUnionUtils.get(this, Kind.English); } - /** * Is this variant instance of kind {@code estonian}? */ @@ -435,7 +424,6 @@ public EstonianAnalyzer estonian() { return TaggedUnionUtils.get(this, Kind.Estonian); } - /** * Is this variant instance of kind {@code finnish}? */ @@ -453,7 +441,6 @@ public FinnishAnalyzer finnish() { return TaggedUnionUtils.get(this, Kind.Finnish); } - /** * Is this variant instance of kind {@code french}? */ @@ -471,7 +458,6 @@ public FrenchAnalyzer french() { return TaggedUnionUtils.get(this, Kind.French); } - /** * Is this variant instance of kind {@code galician}? */ @@ -489,7 +475,6 @@ public GalicianAnalyzer galician() { return TaggedUnionUtils.get(this, Kind.Galician); } - /** * Is this variant instance of kind {@code german}? */ @@ -507,7 +492,6 @@ public GermanAnalyzer german() { return TaggedUnionUtils.get(this, Kind.German); } - /** * Is this variant instance of kind {@code greek}? */ @@ -525,7 +509,6 @@ public GreekAnalyzer greek() { return TaggedUnionUtils.get(this, Kind.Greek); } - /** * Is this variant instance of kind {@code hindi}? */ @@ -543,7 +526,6 @@ public HindiAnalyzer hindi() { return TaggedUnionUtils.get(this, Kind.Hindi); } - /** * Is this variant instance of kind {@code hungarian}? */ @@ -561,7 +543,6 @@ public HungarianAnalyzer hungarian() { return TaggedUnionUtils.get(this, Kind.Hungarian); } - /** * Is this variant instance of kind {@code indonesian}? */ @@ -579,7 +560,6 @@ public IndonesianAnalyzer indonesian() { return TaggedUnionUtils.get(this, Kind.Indonesian); } - /** * Is this variant instance of kind {@code irish}? */ @@ -597,7 +577,6 @@ public IrishAnalyzer irish() { return TaggedUnionUtils.get(this, Kind.Irish); } - /** * Is this variant instance of kind {@code italian}? */ @@ -615,7 +594,6 @@ public ItalianAnalyzer italian() { return TaggedUnionUtils.get(this, Kind.Italian); } - /** * Is this variant instance of kind {@code latvian}? */ @@ -633,7 +611,6 @@ public LatvianAnalyzer latvian() { return TaggedUnionUtils.get(this, Kind.Latvian); } - /** * Is this variant instance of kind {@code lithuanian}? */ @@ -651,7 +628,6 @@ public LithuanianAnalyzer lithuanian() { return TaggedUnionUtils.get(this, Kind.Lithuanian); } - /** * Is this variant instance of kind {@code norwegian}? */ @@ -669,7 +645,6 @@ public NorwegianAnalyzer norwegian() { return TaggedUnionUtils.get(this, Kind.Norwegian); } - /** * Is this variant instance of kind {@code persian}? */ @@ -687,7 +662,6 @@ public PersianAnalyzer persian() { return TaggedUnionUtils.get(this, Kind.Persian); } - /** * Is this variant instance of kind {@code portuguese}? */ @@ -705,7 +679,6 @@ public PortugueseAnalyzer portuguese() { return TaggedUnionUtils.get(this, Kind.Portuguese); } - /** * Is this variant instance of kind {@code romanian}? */ @@ -723,7 +696,6 @@ public RomanianAnalyzer romanian() { return TaggedUnionUtils.get(this, Kind.Romanian); } - /** * Is this variant instance of kind {@code russian}? */ @@ -741,7 +713,6 @@ public RussianAnalyzer russian() { return TaggedUnionUtils.get(this, Kind.Russian); } - /** * Is this variant instance of kind {@code sorani}? */ @@ -759,7 +730,6 @@ public SoraniAnalyzer sorani() { return TaggedUnionUtils.get(this, Kind.Sorani); } - /** * Is this variant instance of kind {@code spanish}? */ @@ -777,7 +747,6 @@ public SpanishAnalyzer spanish() { return TaggedUnionUtils.get(this, Kind.Spanish); } - /** * Is this variant instance of kind {@code swedish}? */ @@ -795,7 +764,6 @@ public SwedishAnalyzer swedish() { return TaggedUnionUtils.get(this, Kind.Swedish); } - /** * Is this variant instance of kind {@code turkish}? */ @@ -813,7 +781,6 @@ public TurkishAnalyzer turkish() { return TaggedUnionUtils.get(this, Kind.Turkish); } - /** * Is this variant instance of kind {@code thai}? */ @@ -831,7 +798,6 @@ public ThaiAnalyzer thai() { return TaggedUnionUtils.get(this, Kind.Thai); } - /** * Is this variant instance of kind {@code fingerprint}? */ diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EnglishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EnglishAnalyzer.java index 6ce7f33c91..acdc58d8e9 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EnglishAnalyzer.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EnglishAnalyzer.java @@ -33,15 +33,14 @@ package org.opensearch.client.opensearch._types.analysis; import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.function.Function; +import javax.annotation.Nullable; import org.opensearch.client.json.*; import org.opensearch.client.util.ApiTypeHelper; import org.opensearch.client.util.ObjectBuilder; import org.opensearch.client.util.ObjectBuilderBase; -import javax.annotation.Nullable; -import java.util.List; -import java.util.function.Function; - // typedef: _types.analysis.EnglishAnalyzer @JsonpDeserializable diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java b/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java index 08bd84a3d2..d876d20384 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java @@ -33,38 +33,41 @@ package org.opensearch.client.opensearch._types.analysis; import jakarta.json.stream.JsonParser; +import java.io.StringReader; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.List; import org.junit.Assert; import org.junit.Test; import org.opensearch.client.json.JsonpMapper; import org.opensearch.client.json.jsonb.JsonbJsonpMapper; import org.opensearch.client.opensearch.indices.IndexSettings; -import java.io.StringReader; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.List; - public class AnalyzerKindTest extends Assert { /** * Test if we can deserialize the language analyzers * it uses reflection to avoid having to duplicate tests for all 34 currently supported languages * - * @throws NoSuchMethodException - * @throws InvocationTargetException - * @throws IllegalAccessException - * @throws ClassNotFoundException + * @throws NoSuchMethodException if the specified method is not found through reflection + * @throws InvocationTargetException if an exception occurs during method invocation through reflection + * @throws IllegalAccessException if access to the method is denied through reflection + * @throws ClassNotFoundException if a required class cannot be found + * @throws NullPointerException if a method argument is unexpectedly null */ @Test - public void testParsingAnalyzersForLanguages() throws NoSuchMethodException, InvocationTargetException, - IllegalAccessException, ClassNotFoundException, NullPointerException { + public void testParsingAnalyzersForLanguages() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, + ClassNotFoundException, NullPointerException { JsonpMapper mapper = new JsonbJsonpMapper(); for (Analyzer.Kind theKind : onlyLanguageAnalyzers) { String type = theKind.jsonValue(); String typeCapitalized = type.substring(0, 1).toUpperCase() + type.substring(1); - String json = String.format("{ \"index\": { \"analysis\": { \"analyzer\": { \"some_analyzer\": { \"type\": \"%s\"," + - " \"char_filter\": [ \"html_strip\" ], \"tokenizer\": \"standard\" } } } } } ", type); + String json = String.format( + "{ \"index\": { \"analysis\": { \"analyzer\": { \"some_analyzer\": { \"type\": \"%s\"," + + " \"char_filter\": [ \"html_strip\" ], \"tokenizer\": \"standard\" } } } } } ", + type + ); JsonParser parser = mapper.jsonProvider().createParser(new StringReader(json)); IndexSettings indexSettings = IndexSettings._DESERIALIZER.deserialize(parser, mapper); @@ -74,7 +77,6 @@ public void testParsingAnalyzersForLanguages() throws NoSuchMethodException, Inv Method isMethod = someAnalyzer.getClass().getMethod("is" + typeCapitalized); assertTrue((boolean) isMethod.invoke(someAnalyzer)); - String analyzerClassName = typeCapitalized + "Analyzer"; // Use reflection to generically check analyzer class @@ -86,40 +88,40 @@ public void testParsingAnalyzersForLanguages() throws NoSuchMethodException, Inv } private final List onlyLanguageAnalyzers = List.of( - Analyzer.Kind.Arabic, - Analyzer.Kind.Armenian, - Analyzer.Kind.Basque, - Analyzer.Kind.Bengali, - Analyzer.Kind.Brazilian, - Analyzer.Kind.Bulgarian, - Analyzer.Kind.Catalan, - Analyzer.Kind.Czech, - Analyzer.Kind.Danish, - Analyzer.Kind.Dutch, - Analyzer.Kind.English, - Analyzer.Kind.Estonian, - Analyzer.Kind.Finnish, - Analyzer.Kind.French, - Analyzer.Kind.Galician, - Analyzer.Kind.German, - Analyzer.Kind.Greek, - Analyzer.Kind.Hindi, - Analyzer.Kind.Hungarian, - Analyzer.Kind.Indonesian, - Analyzer.Kind.Irish, - Analyzer.Kind.Italian, - Analyzer.Kind.Latvian, - Analyzer.Kind.Lithuanian, - Analyzer.Kind.Norwegian, - Analyzer.Kind.Persian, - Analyzer.Kind.Portuguese, - Analyzer.Kind.Romanian, - Analyzer.Kind.Russian, - Analyzer.Kind.Sorani, - Analyzer.Kind.Spanish, - Analyzer.Kind.Swedish, - Analyzer.Kind.Turkish, - Analyzer.Kind.Thai + Analyzer.Kind.Arabic, + Analyzer.Kind.Armenian, + Analyzer.Kind.Basque, + Analyzer.Kind.Bengali, + Analyzer.Kind.Brazilian, + Analyzer.Kind.Bulgarian, + Analyzer.Kind.Catalan, + Analyzer.Kind.Czech, + Analyzer.Kind.Danish, + Analyzer.Kind.Dutch, + Analyzer.Kind.English, + Analyzer.Kind.Estonian, + Analyzer.Kind.Finnish, + Analyzer.Kind.French, + Analyzer.Kind.Galician, + Analyzer.Kind.German, + Analyzer.Kind.Greek, + Analyzer.Kind.Hindi, + Analyzer.Kind.Hungarian, + Analyzer.Kind.Indonesian, + Analyzer.Kind.Irish, + Analyzer.Kind.Italian, + Analyzer.Kind.Latvian, + Analyzer.Kind.Lithuanian, + Analyzer.Kind.Norwegian, + Analyzer.Kind.Persian, + Analyzer.Kind.Portuguese, + Analyzer.Kind.Romanian, + Analyzer.Kind.Russian, + Analyzer.Kind.Sorani, + Analyzer.Kind.Spanish, + Analyzer.Kind.Swedish, + Analyzer.Kind.Turkish, + Analyzer.Kind.Thai ); -} \ No newline at end of file +} From 6cb8ea578e91ed910797a43b848a67b9a45dfe9d Mon Sep 17 00:00:00 2001 From: brentam Date: Sun, 31 Dec 2023 10:42:47 +1100 Subject: [PATCH 6/9] Reverting created language *Analyzers, and Analyzer.java changes. Signed-off-by: brentam --- .../opensearch/_types/analysis/Analyzer.java | 1064 +---------------- .../_types/analysis/ArabicAnalyzer.java | 168 --- .../_types/analysis/ArmenianAnalyzer.java | 168 --- .../_types/analysis/BasqueAnalyzer.java | 168 --- .../_types/analysis/BengaliAnalyzer.java | 168 --- .../_types/analysis/BrazilianAnalyzer.java | 168 --- .../_types/analysis/BulgarianAnalyzer.java | 168 --- .../_types/analysis/CatalanAnalyzer.java | 168 --- .../_types/analysis/CzechAnalyzer.java | 168 --- .../_types/analysis/DanishAnalyzer.java | 168 --- .../_types/analysis/EnglishAnalyzer.java | 163 --- .../_types/analysis/EstonianAnalyzer.java | 168 --- .../_types/analysis/FinnishAnalyzer.java | 168 --- .../_types/analysis/FrenchAnalyzer.java | 168 --- .../_types/analysis/GalicianAnalyzer.java | 168 --- .../_types/analysis/GermanAnalyzer.java | 168 --- .../_types/analysis/GreekAnalyzer.java | 168 --- .../_types/analysis/HindiAnalyzer.java | 168 --- .../_types/analysis/HungarianAnalyzer.java | 168 --- .../_types/analysis/IndonesianAnalyzer.java | 168 --- .../_types/analysis/IrishAnalyzer.java | 168 --- .../_types/analysis/ItalianAnalyzer.java | 168 --- .../_types/analysis/LatvianAnalyzer.java | 168 --- .../_types/analysis/LithuanianAnalyzer.java | 168 --- .../_types/analysis/NorwegianAnalyzer.java | 168 --- .../_types/analysis/PersianAnalyzer.java | 168 --- .../_types/analysis/PortugueseAnalyzer.java | 168 --- .../_types/analysis/RomanianAnalyzer.java | 168 --- .../_types/analysis/RussianAnalyzer.java | 168 --- .../_types/analysis/SoraniAnalyzer.java | 168 --- .../_types/analysis/SpanishAnalyzer.java | 168 --- .../_types/analysis/SwedishAnalyzer.java | 168 --- .../_types/analysis/ThaiAnalyzer.java | 168 --- .../_types/analysis/TurkishAnalyzer.java | 168 --- 34 files changed, 37 insertions(+), 6566 deletions(-) delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArabicAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArmenianAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BasqueAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BengaliAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BrazilianAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BulgarianAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CatalanAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CzechAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/DanishAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EnglishAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EstonianAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FinnishAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FrenchAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GalicianAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GermanAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GreekAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HindiAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HungarianAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IndonesianAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IrishAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ItalianAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LatvianAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LithuanianAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/NorwegianAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PersianAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PortugueseAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RomanianAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RussianAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SoraniAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SpanishAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SwedishAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ThaiAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/TurkishAnalyzer.java diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java index e48e78be66..3a60a8daf7 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java @@ -62,6 +62,8 @@ public class Analyzer implements TaggedUnion, Js public enum Kind implements JsonEnum { Custom("custom"), + Dutch("dutch"), + Fingerprint("fingerprint"), IcuAnalyzer("icu_analyzer"), @@ -90,74 +92,6 @@ public enum Kind implements JsonEnum { Cjk("cjk"), - Arabic("arabic"), - - Armenian("armenian"), - - Basque("basque"), - - Bengali("bengali"), - - Brazilian("brazilian"), - - Bulgarian("bulgarian"), - - Catalan("catalan"), - - Czech("czech"), - - Danish("danish"), - - Dutch("dutch"), - - English("english"), - - Estonian("estonian"), - - Finnish("finnish"), - - French("french"), - - Galician("galician"), - - German("german"), - - Greek("greek"), - - Hindi("hindi"), - - Hungarian("hungarian"), - - Indonesian("indonesian"), - - Irish("irish"), - - Italian("italian"), - - Latvian("latvian"), - - Lithuanian("lithuanian"), - - Norwegian("norwegian"), - - Persian("persian"), - - Portuguese("portuguese"), - - Romanian("romanian"), - - Russian("russian"), - - Sorani("sorani"), - - Spanish("spanish"), - - Swedish("swedish"), - - Turkish("turkish"), - - Thai("thai"), - ; private final String jsonValue; @@ -168,634 +102,73 @@ public enum Kind implements JsonEnum { public String jsonValue() { return this.jsonValue; - } - - } - - private final Kind _kind; - private final AnalyzerVariant _value; - - @Override - public final Kind _kind() { - return _kind; - } - - @Override - public final AnalyzerVariant _get() { - return _value; - } - - public Analyzer(AnalyzerVariant value) { - - this._kind = ApiTypeHelper.requireNonNull(value._analyzerKind(), this, ""); - this._value = ApiTypeHelper.requireNonNull(value, this, ""); - - } - - private Analyzer(Builder builder) { - - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); - - } - - public static Analyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Is this variant instance of kind {@code custom}? - */ - public boolean isCustom() { - return _kind == Kind.Custom; - } - - /** - * Get the {@code custom} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code custom} kind. - */ - public CustomAnalyzer custom() { - return TaggedUnionUtils.get(this, Kind.Custom); - } - - /** - * Is this variant instance of kind {@code dutch}? - */ - public boolean isDutch() { - return _kind == Kind.Dutch; - } - - /** - * Get the {@code dutch} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code dutch} kind. - */ - public DutchAnalyzer dutch() { - return TaggedUnionUtils.get(this, Kind.Dutch); - } - - /** - * Is this variant instance of kind {@code arabic}? - */ - public boolean isArabic() { - return _kind == Kind.Arabic; - } - - /** - * Get the {@code arabic} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code arabic} kind. - */ - public ArabicAnalyzer arabic() { - return TaggedUnionUtils.get(this, Kind.Arabic); - } - - /** - * Is this variant instance of kind {@code armenian}? - */ - public boolean isArmenian() { - return _kind == Kind.Armenian; - } - - /** - * Get the {@code armenian} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code armenian} kind. - */ - public ArmenianAnalyzer armenian() { - return TaggedUnionUtils.get(this, Kind.Armenian); - } - - /** - * Is this variant instance of kind {@code basque}? - */ - public boolean isBasque() { - return _kind == Kind.Basque; - } - - /** - * Get the {@code basque} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code basque} kind. - */ - public BasqueAnalyzer basque() { - return TaggedUnionUtils.get(this, Kind.Basque); - } - - /** - * Is this variant instance of kind {@code bengali}? - */ - public boolean isBengali() { - return _kind == Kind.Bengali; - } - - /** - * Get the {@code bengali} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code bengali} kind. - */ - public BengaliAnalyzer bengali() { - return TaggedUnionUtils.get(this, Kind.Bengali); - } - - /** - * Is this variant instance of kind {@code brazilian}? - */ - public boolean isBrazilian() { - return _kind == Kind.Brazilian; - } - - /** - * Get the {@code brazilian} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code brazilian} kind. - */ - public BrazilianAnalyzer brazilian() { - return TaggedUnionUtils.get(this, Kind.Brazilian); - } - - /** - * Is this variant instance of kind {@code bulgarian}? - */ - public boolean isBulgarian() { - return _kind == Kind.Bulgarian; - } - - /** - * Get the {@code bulgarian} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code bulgarian} kind. - */ - public BulgarianAnalyzer bulgarian() { - return TaggedUnionUtils.get(this, Kind.Bulgarian); - } - - /** - * Is this variant instance of kind {@code catalan}? - */ - public boolean isCatalan() { - return _kind == Kind.Catalan; - } - - /** - * Get the {@code catalan} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code catalan} kind. - */ - public CatalanAnalyzer catalan() { - return TaggedUnionUtils.get(this, Kind.Catalan); - } - - /** - * Is this variant instance of kind {@code czech}? - */ - public boolean isCzech() { - return _kind == Kind.Czech; - } - - /** - * Get the {@code czech} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code czech} kind. - */ - public CzechAnalyzer czech() { - return TaggedUnionUtils.get(this, Kind.Czech); - } - - /** - * Is this variant instance of kind {@code danish}? - */ - public boolean isDanish() { - return _kind == Kind.Danish; - } - - /** - * Get the {@code danish} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code danish} kind. - */ - public DanishAnalyzer danish() { - return TaggedUnionUtils.get(this, Kind.Danish); - } - - /** - * Is this variant instance of kind {@code english}? - */ - public boolean isEnglish() { - return _kind == Kind.English; - } - - /** - * Get the {@code english} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code english} kind. - */ - public EnglishAnalyzer english() { - return TaggedUnionUtils.get(this, Kind.English); - } - - /** - * Is this variant instance of kind {@code estonian}? - */ - public boolean isEstonian() { - return _kind == Kind.Estonian; - } - - /** - * Get the {@code estonian} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code estonian} kind. - */ - public EstonianAnalyzer estonian() { - return TaggedUnionUtils.get(this, Kind.Estonian); - } - - /** - * Is this variant instance of kind {@code finnish}? - */ - public boolean isFinnish() { - return _kind == Kind.Finnish; - } - - /** - * Get the {@code finnish} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code finnish} kind. - */ - public FinnishAnalyzer finnish() { - return TaggedUnionUtils.get(this, Kind.Finnish); - } - - /** - * Is this variant instance of kind {@code french}? - */ - public boolean isFrench() { - return _kind == Kind.French; - } - - /** - * Get the {@code french} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code french} kind. - */ - public FrenchAnalyzer french() { - return TaggedUnionUtils.get(this, Kind.French); - } - - /** - * Is this variant instance of kind {@code galician}? - */ - public boolean isGalician() { - return _kind == Kind.Galician; - } - - /** - * Get the {@code galician} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code galician} kind. - */ - public GalicianAnalyzer galician() { - return TaggedUnionUtils.get(this, Kind.Galician); - } - - /** - * Is this variant instance of kind {@code german}? - */ - public boolean isGerman() { - return _kind == Kind.German; - } - - /** - * Get the {@code german} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code german} kind. - */ - public GermanAnalyzer german() { - return TaggedUnionUtils.get(this, Kind.German); - } - - /** - * Is this variant instance of kind {@code greek}? - */ - public boolean isGreek() { - return _kind == Kind.Greek; - } - - /** - * Get the {@code greek} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code greek} kind. - */ - public GreekAnalyzer greek() { - return TaggedUnionUtils.get(this, Kind.Greek); - } - - /** - * Is this variant instance of kind {@code hindi}? - */ - public boolean isHindi() { - return _kind == Kind.Hindi; - } - - /** - * Get the {@code hindi} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code hindi} kind. - */ - public HindiAnalyzer hindi() { - return TaggedUnionUtils.get(this, Kind.Hindi); - } - - /** - * Is this variant instance of kind {@code hungarian}? - */ - public boolean isHungarian() { - return _kind == Kind.Hungarian; - } - - /** - * Get the {@code hungarian} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code hungarian} kind. - */ - public HungarianAnalyzer hungarian() { - return TaggedUnionUtils.get(this, Kind.Hungarian); - } - - /** - * Is this variant instance of kind {@code indonesian}? - */ - public boolean isIndonesian() { - return _kind == Kind.Indonesian; - } - - /** - * Get the {@code indonesian} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code indonesian} kind. - */ - public IndonesianAnalyzer indonesian() { - return TaggedUnionUtils.get(this, Kind.Indonesian); - } - - /** - * Is this variant instance of kind {@code irish}? - */ - public boolean isIrish() { - return _kind == Kind.Irish; - } - - /** - * Get the {@code irish} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code irish} kind. - */ - public IrishAnalyzer irish() { - return TaggedUnionUtils.get(this, Kind.Irish); - } - - /** - * Is this variant instance of kind {@code italian}? - */ - public boolean isItalian() { - return _kind == Kind.Italian; - } - - /** - * Get the {@code italian} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code italian} kind. - */ - public ItalianAnalyzer italian() { - return TaggedUnionUtils.get(this, Kind.Italian); - } - - /** - * Is this variant instance of kind {@code latvian}? - */ - public boolean isLatvian() { - return _kind == Kind.Latvian; - } - - /** - * Get the {@code latvian} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code latvian} kind. - */ - public LatvianAnalyzer latvian() { - return TaggedUnionUtils.get(this, Kind.Latvian); - } - - /** - * Is this variant instance of kind {@code lithuanian}? - */ - public boolean isLithuanian() { - return _kind == Kind.Lithuanian; - } - - /** - * Get the {@code lithuanian} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code lithuanian} kind. - */ - public LithuanianAnalyzer lithuanian() { - return TaggedUnionUtils.get(this, Kind.Lithuanian); - } - - /** - * Is this variant instance of kind {@code norwegian}? - */ - public boolean isNorwegian() { - return _kind == Kind.Norwegian; - } - - /** - * Get the {@code norwegian} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code norwegian} kind. - */ - public NorwegianAnalyzer norwegian() { - return TaggedUnionUtils.get(this, Kind.Norwegian); - } - - /** - * Is this variant instance of kind {@code persian}? - */ - public boolean isPersian() { - return _kind == Kind.Persian; - } - - /** - * Get the {@code persian} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code persian} kind. - */ - public PersianAnalyzer persian() { - return TaggedUnionUtils.get(this, Kind.Persian); - } - - /** - * Is this variant instance of kind {@code portuguese}? - */ - public boolean isPortuguese() { - return _kind == Kind.Portuguese; - } - - /** - * Get the {@code portuguese} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code portuguese} kind. - */ - public PortugueseAnalyzer portuguese() { - return TaggedUnionUtils.get(this, Kind.Portuguese); - } - - /** - * Is this variant instance of kind {@code romanian}? - */ - public boolean isRomanian() { - return _kind == Kind.Romanian; - } - - /** - * Get the {@code romanian} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code romanian} kind. - */ - public RomanianAnalyzer romanian() { - return TaggedUnionUtils.get(this, Kind.Romanian); - } - - /** - * Is this variant instance of kind {@code russian}? - */ - public boolean isRussian() { - return _kind == Kind.Russian; - } + } - /** - * Get the {@code russian} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code russian} kind. - */ - public RussianAnalyzer russian() { - return TaggedUnionUtils.get(this, Kind.Russian); } - /** - * Is this variant instance of kind {@code sorani}? - */ - public boolean isSorani() { - return _kind == Kind.Sorani; - } + private final Kind _kind; + private final AnalyzerVariant _value; - /** - * Get the {@code sorani} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code sorani} kind. - */ - public SoraniAnalyzer sorani() { - return TaggedUnionUtils.get(this, Kind.Sorani); + @Override + public final Kind _kind() { + return _kind; } - /** - * Is this variant instance of kind {@code spanish}? - */ - public boolean isSpanish() { - return _kind == Kind.Spanish; + @Override + public final AnalyzerVariant _get() { + return _value; } - /** - * Get the {@code spanish} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code spanish} kind. - */ - public SpanishAnalyzer spanish() { - return TaggedUnionUtils.get(this, Kind.Spanish); + public Analyzer(AnalyzerVariant value) { + + this._kind = ApiTypeHelper.requireNonNull(value._analyzerKind(), this, ""); + this._value = ApiTypeHelper.requireNonNull(value, this, ""); + } - /** - * Is this variant instance of kind {@code swedish}? - */ - public boolean isSwedish() { - return _kind == Kind.Swedish; + private Analyzer(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + } - /** - * Get the {@code swedish} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code swedish} kind. - */ - public SwedishAnalyzer swedish() { - return TaggedUnionUtils.get(this, Kind.Swedish); + public static Analyzer of(Function> fn) { + return fn.apply(new Builder()).build(); } /** - * Is this variant instance of kind {@code turkish}? + * Is this variant instance of kind {@code custom}? */ - public boolean isTurkish() { - return _kind == Kind.Turkish; + public boolean isCustom() { + return _kind == Kind.Custom; } /** - * Get the {@code turkish} variant value. + * Get the {@code custom} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code turkish} kind. + * if the current variant is not of the {@code custom} kind. */ - public TurkishAnalyzer turkish() { - return TaggedUnionUtils.get(this, Kind.Turkish); + public CustomAnalyzer custom() { + return TaggedUnionUtils.get(this, Kind.Custom); } /** - * Is this variant instance of kind {@code thai}? + * Is this variant instance of kind {@code dutch}? */ - public boolean isThai() { - return _kind == Kind.Thai; + public boolean isDutch() { + return _kind == Kind.Dutch; } /** - * Get the {@code thai} variant value. + * Get the {@code dutch} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code thai} kind. + * if the current variant is not of the {@code dutch} kind. */ - public ThaiAnalyzer thai() { - return TaggedUnionUtils.get(this, Kind.Thai); + public DutchAnalyzer dutch() { + return TaggedUnionUtils.get(this, Kind.Dutch); } /** @@ -1067,336 +440,6 @@ public ObjectBuilder dutch(Function arabic(ArabicAnalyzer v) { - this._kind = Kind.Arabic; - this._value = v; - return this; - } - - public ObjectBuilder arabic(Function> fn) { - return this.arabic(fn.apply(new ArabicAnalyzer.Builder()).build()); - } - - public ObjectBuilder armenian(ArmenianAnalyzer v) { - this._kind = Kind.Armenian; - this._value = v; - return this; - } - - public ObjectBuilder armenian(Function> fn) { - return this.armenian(fn.apply(new ArmenianAnalyzer.Builder()).build()); - } - - public ObjectBuilder basque(BasqueAnalyzer v) { - this._kind = Kind.Basque; - this._value = v; - return this; - } - - public ObjectBuilder basque(Function> fn) { - return this.basque(fn.apply(new BasqueAnalyzer.Builder()).build()); - } - - public ObjectBuilder bengali(BengaliAnalyzer v) { - this._kind = Kind.Bengali; - this._value = v; - return this; - } - - public ObjectBuilder bengali(Function> fn) { - return this.bengali(fn.apply(new BengaliAnalyzer.Builder()).build()); - } - - public ObjectBuilder brazilian(BrazilianAnalyzer v) { - this._kind = Kind.Brazilian; - this._value = v; - return this; - } - - public ObjectBuilder brazilian(Function> fn) { - return this.brazilian(fn.apply(new BrazilianAnalyzer.Builder()).build()); - } - - public ObjectBuilder bulgarian(BulgarianAnalyzer v) { - this._kind = Kind.Bulgarian; - this._value = v; - return this; - } - - public ObjectBuilder bulgarian(Function> fn) { - return this.bulgarian(fn.apply(new BulgarianAnalyzer.Builder()).build()); - } - - public ObjectBuilder catalan(CatalanAnalyzer v) { - this._kind = Kind.Catalan; - this._value = v; - return this; - } - - public ObjectBuilder catalan(Function> fn) { - return this.catalan(fn.apply(new CatalanAnalyzer.Builder()).build()); - } - - public ObjectBuilder czech(CzechAnalyzer v) { - this._kind = Kind.Czech; - this._value = v; - return this; - } - - public ObjectBuilder czech(Function> fn) { - return this.czech(fn.apply(new CzechAnalyzer.Builder()).build()); - } - - public ObjectBuilder danish(DanishAnalyzer v) { - this._kind = Kind.Danish; - this._value = v; - return this; - } - - public ObjectBuilder danish(Function> fn) { - return this.danish(fn.apply(new DanishAnalyzer.Builder()).build()); - } - - public ObjectBuilder english(EnglishAnalyzer v) { - this._kind = Kind.English; - this._value = v; - return this; - } - - public ObjectBuilder english(Function> fn) { - return this.english(fn.apply(new EnglishAnalyzer.Builder()).build()); - } - - public ObjectBuilder estonian(EstonianAnalyzer v) { - this._kind = Kind.Estonian; - this._value = v; - return this; - } - - public ObjectBuilder estonian(Function> fn) { - return this.estonian(fn.apply(new EstonianAnalyzer.Builder()).build()); - } - - public ObjectBuilder finnish(FinnishAnalyzer v) { - this._kind = Kind.Finnish; - this._value = v; - return this; - } - - public ObjectBuilder finnish(Function> fn) { - return this.finnish(fn.apply(new FinnishAnalyzer.Builder()).build()); - } - - public ObjectBuilder french(FrenchAnalyzer v) { - this._kind = Kind.French; - this._value = v; - return this; - } - - public ObjectBuilder french(Function> fn) { - return this.french(fn.apply(new FrenchAnalyzer.Builder()).build()); - } - - public ObjectBuilder galician(GalicianAnalyzer v) { - this._kind = Kind.Galician; - this._value = v; - return this; - } - - public ObjectBuilder galician(Function> fn) { - return this.galician(fn.apply(new GalicianAnalyzer.Builder()).build()); - } - - public ObjectBuilder german(GermanAnalyzer v) { - this._kind = Kind.German; - this._value = v; - return this; - } - - public ObjectBuilder german(Function> fn) { - return this.german(fn.apply(new GermanAnalyzer.Builder()).build()); - } - - public ObjectBuilder greek(GreekAnalyzer v) { - this._kind = Kind.Greek; - this._value = v; - return this; - } - - public ObjectBuilder greek(Function> fn) { - return this.greek(fn.apply(new GreekAnalyzer.Builder()).build()); - } - - public ObjectBuilder hindi(HindiAnalyzer v) { - this._kind = Kind.Hindi; - this._value = v; - return this; - } - - public ObjectBuilder hindi(Function> fn) { - return this.hindi(fn.apply(new HindiAnalyzer.Builder()).build()); - } - - public ObjectBuilder hungarian(HungarianAnalyzer v) { - this._kind = Kind.Hungarian; - this._value = v; - return this; - } - - public ObjectBuilder hungarian(Function> fn) { - return this.hungarian(fn.apply(new HungarianAnalyzer.Builder()).build()); - } - - public ObjectBuilder indonesian(IndonesianAnalyzer v) { - this._kind = Kind.Indonesian; - this._value = v; - return this; - } - - public ObjectBuilder indonesian(Function> fn) { - return this.indonesian(fn.apply(new IndonesianAnalyzer.Builder()).build()); - } - - public ObjectBuilder irish(IrishAnalyzer v) { - this._kind = Kind.Irish; - this._value = v; - return this; - } - - public ObjectBuilder irish(Function> fn) { - return this.irish(fn.apply(new IrishAnalyzer.Builder()).build()); - } - - public ObjectBuilder italian(ItalianAnalyzer v) { - this._kind = Kind.Italian; - this._value = v; - return this; - } - - public ObjectBuilder italian(Function> fn) { - return this.italian(fn.apply(new ItalianAnalyzer.Builder()).build()); - } - - public ObjectBuilder latvian(LatvianAnalyzer v) { - this._kind = Kind.Latvian; - this._value = v; - return this; - } - - public ObjectBuilder latvian(Function> fn) { - return this.latvian(fn.apply(new LatvianAnalyzer.Builder()).build()); - } - - public ObjectBuilder lithuanian(LithuanianAnalyzer v) { - this._kind = Kind.Lithuanian; - this._value = v; - return this; - } - - public ObjectBuilder lithuanian(Function> fn) { - return this.lithuanian(fn.apply(new LithuanianAnalyzer.Builder()).build()); - } - - public ObjectBuilder norwegian(NorwegianAnalyzer v) { - this._kind = Kind.Norwegian; - this._value = v; - return this; - } - - public ObjectBuilder norwegian(Function> fn) { - return this.norwegian(fn.apply(new NorwegianAnalyzer.Builder()).build()); - } - - public ObjectBuilder persian(PersianAnalyzer v) { - this._kind = Kind.Persian; - this._value = v; - return this; - } - - public ObjectBuilder persian(Function> fn) { - return this.persian(fn.apply(new PersianAnalyzer.Builder()).build()); - } - - public ObjectBuilder portuguese(PortugueseAnalyzer v) { - this._kind = Kind.Portuguese; - this._value = v; - return this; - } - - public ObjectBuilder portuguese(Function> fn) { - return this.portuguese(fn.apply(new PortugueseAnalyzer.Builder()).build()); - } - - public ObjectBuilder romanian(RomanianAnalyzer v) { - this._kind = Kind.Romanian; - this._value = v; - return this; - } - - public ObjectBuilder romanian(Function> fn) { - return this.romanian(fn.apply(new RomanianAnalyzer.Builder()).build()); - } - - public ObjectBuilder russian(RussianAnalyzer v) { - this._kind = Kind.Russian; - this._value = v; - return this; - } - - public ObjectBuilder russian(Function> fn) { - return this.russian(fn.apply(new RussianAnalyzer.Builder()).build()); - } - - public ObjectBuilder sorani(SoraniAnalyzer v) { - this._kind = Kind.Sorani; - this._value = v; - return this; - } - - public ObjectBuilder sorani(Function> fn) { - return this.sorani(fn.apply(new SoraniAnalyzer.Builder()).build()); - } - - public ObjectBuilder spanish(SpanishAnalyzer v) { - this._kind = Kind.Spanish; - this._value = v; - return this; - } - - public ObjectBuilder spanish(Function> fn) { - return this.spanish(fn.apply(new SpanishAnalyzer.Builder()).build()); - } - - public ObjectBuilder swedish(SwedishAnalyzer v) { - this._kind = Kind.Swedish; - this._value = v; - return this; - } - - public ObjectBuilder swedish(Function> fn) { - return this.swedish(fn.apply(new SwedishAnalyzer.Builder()).build()); - } - - public ObjectBuilder turkish(TurkishAnalyzer v) { - this._kind = Kind.Turkish; - this._value = v; - return this; - } - - public ObjectBuilder turkish(Function> fn) { - return this.turkish(fn.apply(new TurkishAnalyzer.Builder()).build()); - } - - public ObjectBuilder thai(ThaiAnalyzer v) { - this._kind = Kind.Thai; - this._value = v; - return this; - } - - public ObjectBuilder thai(Function> fn) { - return this.thai(fn.apply(new ThaiAnalyzer.Builder()).build()); - } - public ObjectBuilder fingerprint(FingerprintAnalyzer v) { this._kind = Kind.Fingerprint; this._value = v; @@ -1548,39 +591,6 @@ protected static void setupAnalyzerDeserializer(ObjectDeserializer op) op.add(Builder::custom, CustomAnalyzer._DESERIALIZER, "custom"); op.add(Builder::dutch, DutchAnalyzer._DESERIALIZER, "dutch"); - op.add(Builder::arabic, ArabicAnalyzer._DESERIALIZER, "arabic"); - op.add(Builder::armenian, ArmenianAnalyzer._DESERIALIZER, "armenian"); - op.add(Builder::basque, BasqueAnalyzer._DESERIALIZER, "basque"); - op.add(Builder::bengali, BengaliAnalyzer._DESERIALIZER, "bengali"); - op.add(Builder::brazilian, BrazilianAnalyzer._DESERIALIZER, "brazilian"); - op.add(Builder::bulgarian, BulgarianAnalyzer._DESERIALIZER, "bulgarian"); - op.add(Builder::catalan, CatalanAnalyzer._DESERIALIZER, "catalan"); - op.add(Builder::czech, CzechAnalyzer._DESERIALIZER, "czech"); - op.add(Builder::danish, DanishAnalyzer._DESERIALIZER, "danish"); - op.add(Builder::english, EnglishAnalyzer._DESERIALIZER, "english"); - op.add(Builder::estonian, EstonianAnalyzer._DESERIALIZER, "estonian"); - op.add(Builder::finnish, FinnishAnalyzer._DESERIALIZER, "finnish"); - op.add(Builder::french, FrenchAnalyzer._DESERIALIZER, "french"); - op.add(Builder::galician, GalicianAnalyzer._DESERIALIZER, "galician"); - op.add(Builder::german, GermanAnalyzer._DESERIALIZER, "german"); - op.add(Builder::greek, GreekAnalyzer._DESERIALIZER, "greek"); - op.add(Builder::hindi, HindiAnalyzer._DESERIALIZER, "hindi"); - op.add(Builder::hungarian, HungarianAnalyzer._DESERIALIZER, "hungarian"); - op.add(Builder::indonesian, IndonesianAnalyzer._DESERIALIZER, "indonesian"); - op.add(Builder::irish, IrishAnalyzer._DESERIALIZER, "irish"); - op.add(Builder::italian, ItalianAnalyzer._DESERIALIZER, "italian"); - op.add(Builder::latvian, LatvianAnalyzer._DESERIALIZER, "latvian"); - op.add(Builder::lithuanian, LithuanianAnalyzer._DESERIALIZER, "lithuanian"); - op.add(Builder::norwegian, NorwegianAnalyzer._DESERIALIZER, "norwegian"); - op.add(Builder::persian, PersianAnalyzer._DESERIALIZER, "persian"); - op.add(Builder::portuguese, PortugueseAnalyzer._DESERIALIZER, "portuguese"); - op.add(Builder::romanian, RomanianAnalyzer._DESERIALIZER, "romanian"); - op.add(Builder::russian, RussianAnalyzer._DESERIALIZER, "russian"); - op.add(Builder::sorani, SoraniAnalyzer._DESERIALIZER, "sorani"); - op.add(Builder::spanish, SpanishAnalyzer._DESERIALIZER, "spanish"); - op.add(Builder::swedish, SwedishAnalyzer._DESERIALIZER, "swedish"); - op.add(Builder::turkish, TurkishAnalyzer._DESERIALIZER, "turkish"); - op.add(Builder::thai, ThaiAnalyzer._DESERIALIZER, "thai"); op.add(Builder::fingerprint, FingerprintAnalyzer._DESERIALIZER, "fingerprint"); op.add(Builder::icuAnalyzer, IcuAnalyzer._DESERIALIZER, "icu_analyzer"); op.add(Builder::keyword, KeywordAnalyzer._DESERIALIZER, "keyword"); diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArabicAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArabicAnalyzer.java deleted file mode 100644 index e0eecb831b..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArabicAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.ArabicAnalyzer - -@JsonpDeserializable -public class ArabicAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private ArabicAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static ArabicAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Arabic; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "arabic"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ArabicAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link ArabicAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ArabicAnalyzer build() { - _checkSingleUse(); - - return new ArabicAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ArabicAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - ArabicAnalyzer::setupArabicAnalyzerDeserializer - ); - - protected static void setupArabicAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArmenianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArmenianAnalyzer.java deleted file mode 100644 index aea1e336a3..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ArmenianAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.ArmenianAnalyzer - -@JsonpDeserializable -public class ArmenianAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private ArmenianAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static ArmenianAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Armenian; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "armenian"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ArmenianAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link ArmenianAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ArmenianAnalyzer build() { - _checkSingleUse(); - - return new ArmenianAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ArmenianAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - ArmenianAnalyzer::setupArmenianAnalyzerDeserializer - ); - - protected static void setupArmenianAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BasqueAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BasqueAnalyzer.java deleted file mode 100644 index d98cd38418..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BasqueAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.BasqueAnalyzer - -@JsonpDeserializable -public class BasqueAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private BasqueAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static BasqueAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Basque; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "basque"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link BasqueAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link BasqueAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public BasqueAnalyzer build() { - _checkSingleUse(); - - return new BasqueAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link BasqueAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - BasqueAnalyzer::setupBasqueAnalyzerDeserializer - ); - - protected static void setupBasqueAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BengaliAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BengaliAnalyzer.java deleted file mode 100644 index 73b2114030..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BengaliAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.BengaliAnalyzer - -@JsonpDeserializable -public class BengaliAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private BengaliAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static BengaliAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Bengali; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "bengali"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link BengaliAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link BengaliAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public BengaliAnalyzer build() { - _checkSingleUse(); - - return new BengaliAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link BengaliAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - BengaliAnalyzer::setupBengaliAnalyzerDeserializer - ); - - protected static void setupBengaliAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BrazilianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BrazilianAnalyzer.java deleted file mode 100644 index 457b4dc420..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BrazilianAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.BrazilianAnalyzer - -@JsonpDeserializable -public class BrazilianAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private BrazilianAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static BrazilianAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Brazilian; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "brazilian"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link BrazilianAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link BrazilianAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public BrazilianAnalyzer build() { - _checkSingleUse(); - - return new BrazilianAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link BrazilianAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - BrazilianAnalyzer::setupBrazilianAnalyzerDeserializer - ); - - protected static void setupBrazilianAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BulgarianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BulgarianAnalyzer.java deleted file mode 100644 index 4fc055fabe..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/BulgarianAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.BulgarianAnalyzer - -@JsonpDeserializable -public class BulgarianAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private BulgarianAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static BulgarianAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Bulgarian; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "bulgarian"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link BulgarianAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link BulgarianAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public BulgarianAnalyzer build() { - _checkSingleUse(); - - return new BulgarianAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link BulgarianAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - BulgarianAnalyzer::setupBulgarianAnalyzerDeserializer - ); - - protected static void setupBulgarianAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CatalanAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CatalanAnalyzer.java deleted file mode 100644 index df14d3aa95..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CatalanAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.CatalanAnalyzer - -@JsonpDeserializable -public class CatalanAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private CatalanAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static CatalanAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Catalan; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "catalan"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link CatalanAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link CatalanAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public CatalanAnalyzer build() { - _checkSingleUse(); - - return new CatalanAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link CatalanAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - CatalanAnalyzer::setupCatalanAnalyzerDeserializer - ); - - protected static void setupCatalanAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CzechAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CzechAnalyzer.java deleted file mode 100644 index 9e9747aa69..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CzechAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.CzechAnalyzer - -@JsonpDeserializable -public class CzechAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private CzechAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static CzechAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Czech; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "czech"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link CzechAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link CzechAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public CzechAnalyzer build() { - _checkSingleUse(); - - return new CzechAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link CzechAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - CzechAnalyzer::setupCzechAnalyzerDeserializer - ); - - protected static void setupCzechAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/DanishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/DanishAnalyzer.java deleted file mode 100644 index 67d3c5fada..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/DanishAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.DanishAnalyzer - -@JsonpDeserializable -public class DanishAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private DanishAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static DanishAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Danish; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "danish"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DanishAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link DanishAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DanishAnalyzer build() { - _checkSingleUse(); - - return new DanishAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DanishAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - DanishAnalyzer::setupDanishAnalyzerDeserializer - ); - - protected static void setupDanishAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EnglishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EnglishAnalyzer.java deleted file mode 100644 index acdc58d8e9..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EnglishAnalyzer.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -import javax.annotation.Nullable; -import org.opensearch.client.json.*; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.EnglishAnalyzer - -@JsonpDeserializable -public class EnglishAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private EnglishAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static EnglishAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.English; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "english"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link EnglishAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link EnglishAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public EnglishAnalyzer build() { - _checkSingleUse(); - - return new EnglishAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link EnglishAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - EnglishAnalyzer::setupEnglishAnalyzerDeserializer - ); - - protected static void setupEnglishAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EstonianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EstonianAnalyzer.java deleted file mode 100644 index a0546504f5..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EstonianAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.EstonianAnalyzer - -@JsonpDeserializable -public class EstonianAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private EstonianAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static EstonianAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Estonian; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "estonian"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link EstonianAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link EstonianAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public EstonianAnalyzer build() { - _checkSingleUse(); - - return new EstonianAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link EstonianAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - EstonianAnalyzer::setupEstonianAnalyzerDeserializer - ); - - protected static void setupEstonianAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FinnishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FinnishAnalyzer.java deleted file mode 100644 index 61ded93bb6..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FinnishAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.FinnishAnalyzer - -@JsonpDeserializable -public class FinnishAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private FinnishAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static FinnishAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Finnish; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "finnish"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link FinnishAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link FinnishAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public FinnishAnalyzer build() { - _checkSingleUse(); - - return new FinnishAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link FinnishAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - FinnishAnalyzer::setupFinnishAnalyzerDeserializer - ); - - protected static void setupFinnishAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FrenchAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FrenchAnalyzer.java deleted file mode 100644 index 864ccd382f..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/FrenchAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.FrenchAnalyzer - -@JsonpDeserializable -public class FrenchAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private FrenchAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static FrenchAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.French; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "french"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link FrenchAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link FrenchAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public FrenchAnalyzer build() { - _checkSingleUse(); - - return new FrenchAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link FrenchAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - FrenchAnalyzer::setupFrenchAnalyzerDeserializer - ); - - protected static void setupFrenchAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GalicianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GalicianAnalyzer.java deleted file mode 100644 index fd421dc2d7..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GalicianAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.GalicianAnalyzer - -@JsonpDeserializable -public class GalicianAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private GalicianAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static GalicianAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Galician; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "galician"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GalicianAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link GalicianAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GalicianAnalyzer build() { - _checkSingleUse(); - - return new GalicianAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link GalicianAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - GalicianAnalyzer::setupGalicianAnalyzerDeserializer - ); - - protected static void setupGalicianAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GermanAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GermanAnalyzer.java deleted file mode 100644 index b3357d3198..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GermanAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.GermanAnalyzer - -@JsonpDeserializable -public class GermanAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private GermanAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static GermanAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.German; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "german"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GermanAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link GermanAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GermanAnalyzer build() { - _checkSingleUse(); - - return new GermanAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link GermanAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - GermanAnalyzer::setupGermanAnalyzerDeserializer - ); - - protected static void setupGermanAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GreekAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GreekAnalyzer.java deleted file mode 100644 index 0401f3e51d..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/GreekAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.GreekAnalyzer - -@JsonpDeserializable -public class GreekAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private GreekAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static GreekAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Greek; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "greek"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link GreekAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link GreekAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public GreekAnalyzer build() { - _checkSingleUse(); - - return new GreekAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link GreekAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - GreekAnalyzer::setupGreekAnalyzerDeserializer - ); - - protected static void setupGreekAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HindiAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HindiAnalyzer.java deleted file mode 100644 index 0ad26b6593..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HindiAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.HindiAnalyzer - -@JsonpDeserializable -public class HindiAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private HindiAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static HindiAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Hindi; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "hindi"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link HindiAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link HindiAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public HindiAnalyzer build() { - _checkSingleUse(); - - return new HindiAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link HindiAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - HindiAnalyzer::setupHindiAnalyzerDeserializer - ); - - protected static void setupHindiAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HungarianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HungarianAnalyzer.java deleted file mode 100644 index ba49430926..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/HungarianAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.HungarianAnalyzer - -@JsonpDeserializable -public class HungarianAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private HungarianAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static HungarianAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Hungarian; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "hungarian"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link HungarianAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link HungarianAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public HungarianAnalyzer build() { - _checkSingleUse(); - - return new HungarianAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link HungarianAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - HungarianAnalyzer::setupHungarianAnalyzerDeserializer - ); - - protected static void setupHungarianAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IndonesianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IndonesianAnalyzer.java deleted file mode 100644 index 562e05c7af..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IndonesianAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.IndonesianAnalyzer - -@JsonpDeserializable -public class IndonesianAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private IndonesianAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static IndonesianAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Indonesian; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "indonesian"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IndonesianAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link IndonesianAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IndonesianAnalyzer build() { - _checkSingleUse(); - - return new IndonesianAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IndonesianAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - IndonesianAnalyzer::setupIndonesianAnalyzerDeserializer - ); - - protected static void setupIndonesianAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IrishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IrishAnalyzer.java deleted file mode 100644 index 95f2ce367b..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/IrishAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.IrishAnalyzer - -@JsonpDeserializable -public class IrishAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private IrishAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static IrishAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Irish; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "irish"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link IrishAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link IrishAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public IrishAnalyzer build() { - _checkSingleUse(); - - return new IrishAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link IrishAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - IrishAnalyzer::setupIrishAnalyzerDeserializer - ); - - protected static void setupIrishAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ItalianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ItalianAnalyzer.java deleted file mode 100644 index 7dabce276e..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ItalianAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.ItalianAnalyzer - -@JsonpDeserializable -public class ItalianAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private ItalianAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static ItalianAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Italian; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "italian"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ItalianAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link ItalianAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ItalianAnalyzer build() { - _checkSingleUse(); - - return new ItalianAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ItalianAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - ItalianAnalyzer::setupItalianAnalyzerDeserializer - ); - - protected static void setupItalianAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LatvianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LatvianAnalyzer.java deleted file mode 100644 index 37c311cee3..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LatvianAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.LatvianAnalyzer - -@JsonpDeserializable -public class LatvianAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private LatvianAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static LatvianAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Latvian; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "latvian"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link LatvianAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link LatvianAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public LatvianAnalyzer build() { - _checkSingleUse(); - - return new LatvianAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link LatvianAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - LatvianAnalyzer::setupLatvianAnalyzerDeserializer - ); - - protected static void setupLatvianAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LithuanianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LithuanianAnalyzer.java deleted file mode 100644 index b9c13f47fb..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LithuanianAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.LithuanianAnalyzer - -@JsonpDeserializable -public class LithuanianAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private LithuanianAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static LithuanianAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Lithuanian; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "lithuanian"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link LithuanianAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link LithuanianAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public LithuanianAnalyzer build() { - _checkSingleUse(); - - return new LithuanianAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link LithuanianAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - LithuanianAnalyzer::setupLithuanianAnalyzerDeserializer - ); - - protected static void setupLithuanianAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/NorwegianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/NorwegianAnalyzer.java deleted file mode 100644 index e33f8d6c72..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/NorwegianAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.NorwegianAnalyzer - -@JsonpDeserializable -public class NorwegianAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private NorwegianAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static NorwegianAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Norwegian; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "norwegian"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link NorwegianAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link NorwegianAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public NorwegianAnalyzer build() { - _checkSingleUse(); - - return new NorwegianAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link NorwegianAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - NorwegianAnalyzer::setupNorwegianAnalyzerDeserializer - ); - - protected static void setupNorwegianAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PersianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PersianAnalyzer.java deleted file mode 100644 index d8a4dcbbb7..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PersianAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.PersianAnalyzer - -@JsonpDeserializable -public class PersianAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private PersianAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static PersianAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Persian; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "persian"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PersianAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link PersianAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PersianAnalyzer build() { - _checkSingleUse(); - - return new PersianAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PersianAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - PersianAnalyzer::setupPersianAnalyzerDeserializer - ); - - protected static void setupPersianAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PortugueseAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PortugueseAnalyzer.java deleted file mode 100644 index 2f30b9d2d4..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/PortugueseAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.PortugueseAnalyzer - -@JsonpDeserializable -public class PortugueseAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private PortugueseAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static PortugueseAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Portuguese; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "portuguese"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link PortugueseAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link PortugueseAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public PortugueseAnalyzer build() { - _checkSingleUse(); - - return new PortugueseAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link PortugueseAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - PortugueseAnalyzer::setupPortugueseAnalyzerDeserializer - ); - - protected static void setupPortugueseAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RomanianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RomanianAnalyzer.java deleted file mode 100644 index 24d9867005..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RomanianAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.RomanianAnalyzer - -@JsonpDeserializable -public class RomanianAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private RomanianAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static RomanianAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Romanian; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "romanian"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RomanianAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link RomanianAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RomanianAnalyzer build() { - _checkSingleUse(); - - return new RomanianAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link RomanianAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - RomanianAnalyzer::setupRomanianAnalyzerDeserializer - ); - - protected static void setupRomanianAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RussianAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RussianAnalyzer.java deleted file mode 100644 index 9f6dff4da6..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/RussianAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.RussianAnalyzer - -@JsonpDeserializable -public class RussianAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private RussianAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static RussianAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Russian; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "russian"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link RussianAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link RussianAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public RussianAnalyzer build() { - _checkSingleUse(); - - return new RussianAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link RussianAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - RussianAnalyzer::setupRussianAnalyzerDeserializer - ); - - protected static void setupRussianAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SoraniAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SoraniAnalyzer.java deleted file mode 100644 index 863d6ca146..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SoraniAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.SoraniAnalyzer - -@JsonpDeserializable -public class SoraniAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private SoraniAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static SoraniAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Sorani; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "sorani"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SoraniAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link SoraniAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SoraniAnalyzer build() { - _checkSingleUse(); - - return new SoraniAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SoraniAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - SoraniAnalyzer::setupSoraniAnalyzerDeserializer - ); - - protected static void setupSoraniAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SpanishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SpanishAnalyzer.java deleted file mode 100644 index ff1b7dd1f8..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SpanishAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.SpanishAnalyzer - -@JsonpDeserializable -public class SpanishAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private SpanishAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static SpanishAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Spanish; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "spanish"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SpanishAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link SpanishAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SpanishAnalyzer build() { - _checkSingleUse(); - - return new SpanishAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SpanishAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - SpanishAnalyzer::setupSpanishAnalyzerDeserializer - ); - - protected static void setupSpanishAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SwedishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SwedishAnalyzer.java deleted file mode 100644 index cf56594079..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/SwedishAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.SwedishAnalyzer - -@JsonpDeserializable -public class SwedishAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private SwedishAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static SwedishAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Swedish; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "swedish"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link SwedishAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link SwedishAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public SwedishAnalyzer build() { - _checkSingleUse(); - - return new SwedishAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link SwedishAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - SwedishAnalyzer::setupSwedishAnalyzerDeserializer - ); - - protected static void setupSwedishAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ThaiAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ThaiAnalyzer.java deleted file mode 100644 index 710eaa5e3f..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/ThaiAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.ThaiAnalyzer - -@JsonpDeserializable -public class ThaiAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private ThaiAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static ThaiAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Thai; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "thai"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link ThaiAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link ThaiAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public ThaiAnalyzer build() { - _checkSingleUse(); - - return new ThaiAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link ThaiAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - ThaiAnalyzer::setupThaiAnalyzerDeserializer - ); - - protected static void setupThaiAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/TurkishAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/TurkishAnalyzer.java deleted file mode 100644 index 37d5e5c315..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/TurkishAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.TurkishAnalyzer - -@JsonpDeserializable -public class TurkishAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private TurkishAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static TurkishAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Turkish; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "turkish"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link TurkishAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link TurkishAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public TurkishAnalyzer build() { - _checkSingleUse(); - - return new TurkishAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link TurkishAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - TurkishAnalyzer::setupTurkishAnalyzerDeserializer - ); - - protected static void setupTurkishAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} From aee463224a8f4c96e579a3a402a5b087f6a0d5b6 Mon Sep 17 00:00:00 2001 From: brentam Date: Sun, 31 Dec 2023 15:30:10 +1100 Subject: [PATCH 7/9] draft changes to language analyser and analyzer kindd Signed-off-by: brentam --- .../opensearch/_types/analysis/Analyzer.java | 145 ++++++------ .../_types/analysis/AnalyzerBuilders.java | 8 - .../_types/analysis/CjkAnalyzer.java | 179 --------------- .../_types/analysis/DutchAnalyzer.java | 168 -------------- .../opensearch/_types/analysis/Language.java | 71 +++--- .../_types/analysis/LanguageAnalyzer.java | 16 +- .../_types/analysis/AnalyzerKindTest.java | 210 +++++++++++++----- 7 files changed, 276 insertions(+), 521 deletions(-) delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CjkAnalyzer.java delete mode 100644 java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/DutchAnalyzer.java diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java index 3a60a8daf7..e67fb06497 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Analyzer.java @@ -33,6 +33,8 @@ package org.opensearch.client.opensearch._types.analysis; import jakarta.json.stream.JsonGenerator; + +import java.util.Arrays; import java.util.function.Function; import org.opensearch.client.json.JsonEnum; import org.opensearch.client.json.JsonpDeserializable; @@ -62,8 +64,6 @@ public class Analyzer implements TaggedUnion, Js public enum Kind implements JsonEnum { Custom("custom"), - Dutch("dutch"), - Fingerprint("fingerprint"), IcuAnalyzer("icu_analyzer"), @@ -72,8 +72,6 @@ public enum Kind implements JsonEnum { Kuromoji("kuromoji"), - Language("language"), - Nori("nori"), Pattern("pattern"), @@ -92,6 +90,74 @@ public enum Kind implements JsonEnum { Cjk("cjk"), + Arabic("arabic"), + + Armenian("armenian"), + + Basque("basque"), + + Bengali("bengali"), + + Brazilian("brazilian"), + + Bulgarian("bulgarian"), + + Catalan("catalan"), + + Czech("czech"), + + Danish("danish"), + + Dutch("dutch"), + + English("english"), + + Estonian("estonian"), + + Finnish("finnish"), + + French("french"), + + Galician("galician"), + + German("german"), + + Greek("greek"), + + Hindi("hindi"), + + Hungarian("hungarian"), + + Indonesian("indonesian"), + + Irish("irish"), + + Italian("italian"), + + Latvian("latvian"), + + Lithuanian("lithuanian"), + + Norwegian("norwegian"), + + Persian("persian"), + + Portuguese("portuguese"), + + Romanian("romanian"), + + Russian("russian"), + + Sorani("sorani"), + + Spanish("spanish"), + + Swedish("swedish"), + + Turkish("turkish"), + + Thai("thai"), + ; private final String jsonValue; @@ -154,23 +220,6 @@ public CustomAnalyzer custom() { return TaggedUnionUtils.get(this, Kind.Custom); } - /** - * Is this variant instance of kind {@code dutch}? - */ - public boolean isDutch() { - return _kind == Kind.Dutch; - } - - /** - * Get the {@code dutch} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code dutch} kind. - */ - public DutchAnalyzer dutch() { - return TaggedUnionUtils.get(this, Kind.Dutch); - } - /** * Is this variant instance of kind {@code fingerprint}? */ @@ -239,22 +288,6 @@ public KuromojiAnalyzer kuromoji() { return TaggedUnionUtils.get(this, Kind.Kuromoji); } - /** - * Is this variant instance of kind {@code language}? - */ - public boolean isLanguage() { - return _kind == Kind.Language; - } - - /** - * Get the {@code language} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code language} kind. - */ - public LanguageAnalyzer language() { - return TaggedUnionUtils.get(this, Kind.Language); - } /** * Is this variant instance of kind {@code nori}? @@ -399,16 +432,6 @@ public boolean isCjk() { return _kind == Kind.Cjk; } - /** - * Get the {@code cjk} variant value. - * - * @throws IllegalStateException - * if the current variant is not of the {@code cjk} kind. - */ - public CjkAnalyzer cjk() { - return TaggedUnionUtils.get(this, Kind.Cjk); - } - @Override public void serialize(JsonGenerator generator, JsonpMapper mapper) { @@ -430,16 +453,6 @@ public ObjectBuilder custom(Function dutch(DutchAnalyzer v) { - this._kind = Kind.Dutch; - this._value = v; - return this; - } - - public ObjectBuilder dutch(Function> fn) { - return this.dutch(fn.apply(new DutchAnalyzer.Builder()).build()); - } - public ObjectBuilder fingerprint(FingerprintAnalyzer v) { this._kind = Kind.Fingerprint; this._value = v; @@ -481,7 +494,7 @@ public ObjectBuilder kuromoji(Function language(LanguageAnalyzer v) { - this._kind = Kind.Language; + this._kind = Kind.valueOf(v.language().name()); this._value = v; return this; } @@ -570,16 +583,6 @@ public ObjectBuilder smartcn() { return this.smartcn(new SmartcnAnalyzer.Builder().build()); } - public ObjectBuilder cjk(CjkAnalyzer v) { - this._kind = Kind.Cjk; - this._value = v; - return this; - } - - public ObjectBuilder cjk(Function> fn) { - return this.cjk(fn.apply(new CjkAnalyzer.Builder()).build()); - } - public Analyzer build() { _checkSingleUse(); return new Analyzer(this); @@ -589,8 +592,11 @@ public Analyzer build() { protected static void setupAnalyzerDeserializer(ObjectDeserializer op) { + for (Language value : Language.values()) { + op.add(Builder::language, LanguageAnalyzer._DESERIALIZER, value.jsonValue().toLowerCase()); + //TODO should we lowercase in the Language Enum? + } op.add(Builder::custom, CustomAnalyzer._DESERIALIZER, "custom"); - op.add(Builder::dutch, DutchAnalyzer._DESERIALIZER, "dutch"); op.add(Builder::fingerprint, FingerprintAnalyzer._DESERIALIZER, "fingerprint"); op.add(Builder::icuAnalyzer, IcuAnalyzer._DESERIALIZER, "icu_analyzer"); op.add(Builder::keyword, KeywordAnalyzer._DESERIALIZER, "keyword"); @@ -604,7 +610,6 @@ protected static void setupAnalyzerDeserializer(ObjectDeserializer op) op.add(Builder::stop, StopAnalyzer._DESERIALIZER, "stop"); op.add(Builder::whitespace, WhitespaceAnalyzer._DESERIALIZER, "whitespace"); op.add(Builder::smartcn, SmartcnAnalyzer._DESERIALIZER, Kind.Smartcn.jsonValue()); - op.add(Builder::cjk, CjkAnalyzer._DESERIALIZER, Kind.Cjk.jsonValue()); op.setTypeProperty("type", null); diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerBuilders.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerBuilders.java index a721a52b9c..f275029212 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerBuilders.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerBuilders.java @@ -46,14 +46,6 @@ public static CustomAnalyzer.Builder custom() { return new CustomAnalyzer.Builder(); } - /** - * Creates a builder for the {@link DutchAnalyzer dutch} {@code Analyzer} - * variant. - */ - public static DutchAnalyzer.Builder dutch() { - return new DutchAnalyzer.Builder(); - } - /** * Creates a builder for the {@link FingerprintAnalyzer fingerprint} * {@code Analyzer} variant. diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CjkAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CjkAnalyzer.java deleted file mode 100644 index d653cbdfea..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/CjkAnalyzer.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * 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. - */ - -/* - * Modifications Copyright OpenSearch Contributors. See - * GitHub history for details. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.LanguageAnalyzer - -@JsonpDeserializable -public class CjkAnalyzer implements AnalyzerVariant, JsonpSerializable { - @Nullable - private final List stopwords; - - @Nullable - private final String stopwordsPath; - - // --------------------------------------------------------------------------------------------- - - private CjkAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - this.stopwordsPath = builder.stopwordsPath; - - } - - public static CjkAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Cjk; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * API name: {@code stopwords_path} - */ - @Nullable - public final String stopwordsPath() { - return this.stopwordsPath; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", Analyzer.Kind.Cjk.jsonValue()); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - if (this.stopwordsPath != null) { - generator.writeKey("stopwords_path"); - generator.write(this.stopwordsPath); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link CjkAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - @Nullable - private String stopwordsPath; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * API name: {@code stopwords_path} - */ - public final Builder stopwordsPath(@Nullable String value) { - this.stopwordsPath = value; - return this; - } - - /** - * Builds a {@link CjkAnalyzer}. - * - * @throws NullPointerException - * if some required fields are null. - */ - public CjkAnalyzer build() { - _checkSingleUse(); - - return new CjkAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link CjkAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - CjkAnalyzer::setupLanguageAnalyzerDeserializer - ); - - protected static void setupLanguageAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - op.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/DutchAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/DutchAnalyzer.java deleted file mode 100644 index bcaa49f64d..0000000000 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/DutchAnalyzer.java +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import java.util.List; -import java.util.function.Function; -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.JsonpSerializable; -import org.opensearch.client.json.ObjectBuilderDeserializer; -import org.opensearch.client.json.ObjectDeserializer; -import org.opensearch.client.util.ApiTypeHelper; -import org.opensearch.client.util.ObjectBuilder; -import org.opensearch.client.util.ObjectBuilderBase; - -// typedef: _types.analysis.DutchAnalyzer - -@JsonpDeserializable -public class DutchAnalyzer implements AnalyzerVariant, JsonpSerializable { - private final List stopwords; - - // --------------------------------------------------------------------------------------------- - - private DutchAnalyzer(Builder builder) { - - this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); - - } - - public static DutchAnalyzer of(Function> fn) { - return fn.apply(new Builder()).build(); - } - - /** - * Analyzer variant kind. - */ - @Override - public Analyzer.Kind _analyzerKind() { - return Analyzer.Kind.Dutch; - } - - /** - * API name: {@code stopwords} - */ - public final List stopwords() { - return this.stopwords; - } - - /** - * Serialize this object to JSON. - */ - public void serialize(JsonGenerator generator, JsonpMapper mapper) { - generator.writeStartObject(); - serializeInternal(generator, mapper); - generator.writeEnd(); - } - - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { - - generator.write("type", "dutch"); - - if (ApiTypeHelper.isDefined(this.stopwords)) { - generator.writeKey("stopwords"); - generator.writeStartArray(); - for (String item0 : this.stopwords) { - generator.write(item0); - - } - generator.writeEnd(); - - } - - } - - // --------------------------------------------------------------------------------------------- - - /** - * Builder for {@link DutchAnalyzer}. - */ - - public static class Builder extends ObjectBuilderBase implements ObjectBuilder { - @Nullable - private List stopwords; - - /** - * API name: {@code stopwords} - *

- * Adds all elements of list to stopwords. - */ - public final Builder stopwords(List list) { - this.stopwords = _listAddAll(this.stopwords, list); - return this; - } - - /** - * API name: {@code stopwords} - *

- * Adds one or more values to stopwords. - */ - public final Builder stopwords(String value, String... values) { - this.stopwords = _listAdd(this.stopwords, value, values); - return this; - } - - /** - * Builds a {@link DutchAnalyzer}. - * - * @throws NullPointerException - * if some of the required fields are null. - */ - public DutchAnalyzer build() { - _checkSingleUse(); - - return new DutchAnalyzer(this); - } - } - - // --------------------------------------------------------------------------------------------- - - /** - * Json deserializer for {@link DutchAnalyzer} - */ - public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy( - Builder::new, - DutchAnalyzer::setupDutchAnalyzerDeserializer - ); - - protected static void setupDutchAnalyzerDeserializer(ObjectDeserializer op) { - - op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); - - op.ignore("type"); - } - -} diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Language.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Language.java index c90e4eeec3..de012e359c 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Language.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/Language.java @@ -35,76 +35,77 @@ import org.opensearch.client.json.JsonEnum; import org.opensearch.client.json.JsonpDeserializable; +import java.util.Arrays; + @JsonpDeserializable public enum Language implements JsonEnum { - Arabic("Arabic"), - - Armenian("Armenian"), + Arabic("arabic"), - Basque("Basque"), + Armenian("armenian"), - Brazilian("Brazilian"), + Basque("basque"), - Bulgarian("Bulgarian"), + Brazilian("brazilian"), - Catalan("Catalan"), + Bulgarian("bulgarian"), - Chinese("Chinese"), + Catalan("catalan"), - Cjk("Cjk"), + Chinese("chinese"), - Czech("Czech"), + Cjk("cjk"), - Danish("Danish"), + Czech("czech"), - Dutch("Dutch"), + Danish("danish"), - English("English"), + Dutch("dutch"), - Estonian("Estonian"), + English("english"), - Finnish("Finnish"), + Estonian("estonian"), - French("French"), + Finnish("finnish"), - Galician("Galician"), + French("french"), - German("German"), + Galician("galician"), - Greek("Greek"), + German("german"), - Hindi("Hindi"), + Greek("greek"), - Hungarian("Hungarian"), + Hindi("hindi"), - Indonesian("Indonesian"), + Hungarian("hungarian"), - Irish("Irish"), + Indonesian("indonesian"), - Italian("Italian"), + Irish("irish"), - Latvian("Latvian"), + Italian("italian"), - Norwegian("Norwegian"), + Latvian("latvian"), - Persian("Persian"), + Norwegian("norwegian"), - Portuguese("Portuguese"), + Persian("persian"), - Romanian("Romanian"), + Portuguese("portuguese"), - Russian("Russian"), + Romanian("romanian"), - Sorani("Sorani"), + Russian("russian"), - Spanish("Spanish"), + Sorani("sorani"), - Swedish("Swedish"), + Spanish("spanish"), - Turkish("Turkish"), + Swedish("swedish"), - Thai("Thai"), + Turkish("turkish"), + Thai("thai"), ; private final String jsonValue; diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LanguageAnalyzer.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LanguageAnalyzer.java index d2684dc242..bf1b0ecc75 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LanguageAnalyzer.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/LanguageAnalyzer.java @@ -50,6 +50,7 @@ @JsonpDeserializable public class LanguageAnalyzer implements AnalyzerVariant, JsonpSerializable { + @Nullable private final String version; @@ -68,7 +69,7 @@ private LanguageAnalyzer(Builder builder) { this.version = builder.version; this.language = ApiTypeHelper.requireNonNull(builder.language, this, "language"); - this.stemExclusion = ApiTypeHelper.unmodifiableRequired(builder.stemExclusion, this, "stemExclusion"); + this.stemExclusion = builder.stemExclusion; // ApiTypeHelper.unmodifiableRequired(builder.stemExclusion, this, "stemExclusion"); this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); this.stopwordsPath = builder.stopwordsPath; @@ -83,7 +84,7 @@ public static LanguageAnalyzer of(Function op) { op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version"); - op.add(Builder::language, Language._DESERIALIZER, "language"); + op.add(Builder::language, Language._DESERIALIZER, "type"); op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stem_exclusion"); op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "stopwords"); op.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); - op.ignore("type"); } } diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java b/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java index d876d20384..27087062bc 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java @@ -32,42 +32,48 @@ package org.opensearch.client.opensearch._types.analysis; +import jakarta.json.stream.JsonGenerator; import jakarta.json.stream.JsonParser; -import java.io.StringReader; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.List; import org.junit.Assert; import org.junit.Test; import org.opensearch.client.json.JsonpMapper; +import org.opensearch.client.json.JsonpSerializable; import org.opensearch.client.json.jsonb.JsonbJsonpMapper; +import org.opensearch.client.opensearch.cluster.stats.CharFilterTypes; import org.opensearch.client.opensearch.indices.IndexSettings; +import org.opensearch.client.opensearch.indices.IndexSettingsAnalysis; +import org.opensearch.core.index.Index; + +import java.io.StringReader; +import java.io.StringWriter; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public class AnalyzerKindTest extends Assert { /** - * Test if we can deserialize the language analyzers - * it uses reflection to avoid having to duplicate tests for all 34 currently supported languages + * Test if we can deserialize the language analyzers + * it uses reflection to avoid having to duplicate tests for all 34 currently supported languages * - * @throws NoSuchMethodException if the specified method is not found through reflection - * @throws InvocationTargetException if an exception occurs during method invocation through reflection - * @throws IllegalAccessException if access to the method is denied through reflection - * @throws ClassNotFoundException if a required class cannot be found - * @throws NullPointerException if a method argument is unexpectedly null + * @throws NoSuchMethodException + * @throws InvocationTargetException + * @throws IllegalAccessException + * @throws ClassNotFoundException */ @Test - public void testParsingAnalyzersForLanguages() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, - ClassNotFoundException, NullPointerException { + public void testParsingAnalyzersForLanguages() throws NoSuchMethodException, InvocationTargetException, + IllegalAccessException, ClassNotFoundException, NullPointerException { JsonpMapper mapper = new JsonbJsonpMapper(); for (Analyzer.Kind theKind : onlyLanguageAnalyzers) { String type = theKind.jsonValue(); String typeCapitalized = type.substring(0, 1).toUpperCase() + type.substring(1); - String json = String.format( - "{ \"index\": { \"analysis\": { \"analyzer\": { \"some_analyzer\": { \"type\": \"%s\"," - + " \"char_filter\": [ \"html_strip\" ], \"tokenizer\": \"standard\" } } } } } ", - type - ); + String json = String.format("{ \"index\": { \"analysis\": { \"analyzer\": { \"some_analyzer\": { \"type\": \"%s\"," + + " \"char_filter\": [ \"html_strip\" ], \"tokenizer\": \"standard\" } } } } } ", type); JsonParser parser = mapper.jsonProvider().createParser(new StringReader(json)); IndexSettings indexSettings = IndexSettings._DESERIALIZER.deserialize(parser, mapper); @@ -77,6 +83,7 @@ public void testParsingAnalyzersForLanguages() throws NoSuchMethodException, Inv Method isMethod = someAnalyzer.getClass().getMethod("is" + typeCapitalized); assertTrue((boolean) isMethod.invoke(someAnalyzer)); + String analyzerClassName = typeCapitalized + "Analyzer"; // Use reflection to generically check analyzer class @@ -87,41 +94,140 @@ public void testParsingAnalyzersForLanguages() throws NoSuchMethodException, Inv } } + @Test + public void testParsingAnalyzer() { + + JsonpMapper mapper = new JsonbJsonpMapper(); + String json = "{ \"index\": { \"analysis\": { \"analyzer\": { \"some_analyzer\": { \"type\": \"english\", \"char_filter\": [ \"html_strip\" ], \"tokenizer\": \"standard\" } } } } } "; + + JsonParser parser = mapper.jsonProvider().createParser(new StringReader(json)); + IndexSettings indexSettings = IndexSettings._DESERIALIZER.deserialize(parser, mapper); + System.out.println(toJson(indexSettings)); + assertTrue(true); + } + + + +// @Test +// public void testAnParsingAnalyzer3() { +// Map map2 = new HashMap<>(); +// map2.put("some_analyzer", DutchAnalyzer.of(en -> en)._toAnalyzer()); +// Map map = new HashMap<>(); +// map.put("some_analyzersss", DutchAnalyzer.of(en -> en)._toAnalyzer()); +// IndexSettingsAnalysis settings = IndexSettingsAnalysis.of( +// a -> +// +// a. charFilter("htm",CharFilter.of(c->c.name("html_strip"))) +// ); +// +// System.out.println(toJson(settings)); +// } + + @Test + public void testParsingAnalyzer2() { + + JsonpMapper mapper = new JsonbJsonpMapper(); + String json = "{ \"index\": { \"analysis\": { \"analyzer\": { \"some_analyzer\": { \"type\": \"english\", \"version\": \"2\", \"char_filter\": [ \"html_strip\" ], \"tokenizer\": \"standard\" } } } } } "; + + JsonParser parser = mapper.jsonProvider().createParser(new StringReader(json)); + IndexSettings indexSettings = IndexSettings._DESERIALIZER.deserialize(parser, mapper); + System.out.println(toJson(indexSettings)); + assertTrue(true); + } + @Test + public void testLanguage() { + Map map = new HashMap<>(); + map.put("some_analyzer", + LanguageAnalyzer.of( + l -> l.language(Language.German). + stemExclusion(new ArrayList<>()) + ) + ._toAnalyzer()); + IndexSettings settings = IndexSettings.of( + it -> it.analysis(a -> + a.analyzer(map) + + ) + ); + + System.out.println(toJson(settings)); + } + + @Test + public void testParsingLanguageANother() { + + JsonpMapper mapper = new JsonbJsonpMapper(); + String json = "{ \"index\": {\"analysis\":{\"analyzer\":{\"some_analyzer\":{\"type\":\"language\",\"language\":\"German\",\"stem_exclusion\":[]}}}} } "; + + JsonParser parser = mapper.jsonProvider().createParser(new StringReader(json)); + IndexSettings indexSettings = IndexSettings._DESERIALIZER.deserialize(parser, mapper); + System.out.println(toJson(indexSettings)); + assertTrue(true); + } + +// @Test +// public void testParsingAnalyzer3() { +// Map map = new HashMap<>(); +// map.put("english_analyzer", DutchAnalyzer.of(en -> en)._toAnalyzer()); +// IndexSettings settings = IndexSettings.of( +// it -> it.analysis(a -> +// a.analyzer(map)) +// ); +// +// System.out.println(toJson(settings)); +// } + + @Test + public void testPassingLanguageAnalyzer() { + String[] v= new String[]{"", ""}; + CharFilterDefinition fd2= CharFilterDefinitionBuilders.htmlStrip().build()._toCharFilterDefinition(); +// CharFilterDefinition fd= CharFilterDefinition. of(v -> v.htmlStrip( +// HtmlStripCharFilter.of(h->h.self()) +// )); + Map map = new HashMap<>(); + map.put("some_analyzer", + + LanguageAnalyzer.of(l -> l.language(Language.German). + stemExclusion(new ArrayList<>())) + ._toAnalyzer()); + IndexSettingsAnalysis settings = IndexSettingsAnalysis.of( + anl -> anl + .analyzer(map) + .charFilter("kkk",CharFilter.of(a->a.name("html"))) +// .charFilter("aaaa",CharFilter.of(i->i.definition(CharFilterDefinitionBuilders.htmlStrip().build()._toCharFilterDefinition()))) + // .charFilter("some_char_filter", CharFilter.of(c -> c.name("html_strip"))) + ); + + System.out.println(toJson(settings)); + } + + private String toJson(JsonpSerializable obj) { + JsonpMapper mapper = new JsonbJsonpMapper(); + StringWriter stringWriter = new StringWriter(); + try (JsonGenerator generator = mapper.jsonProvider().createGenerator(stringWriter)) { + mapper.serialize(obj, generator); + } + return stringWriter.toString(); + } + private final List onlyLanguageAnalyzers = List.of( - Analyzer.Kind.Arabic, - Analyzer.Kind.Armenian, - Analyzer.Kind.Basque, - Analyzer.Kind.Bengali, - Analyzer.Kind.Brazilian, - Analyzer.Kind.Bulgarian, - Analyzer.Kind.Catalan, - Analyzer.Kind.Czech, - Analyzer.Kind.Danish, - Analyzer.Kind.Dutch, - Analyzer.Kind.English, - Analyzer.Kind.Estonian, - Analyzer.Kind.Finnish, - Analyzer.Kind.French, - Analyzer.Kind.Galician, - Analyzer.Kind.German, - Analyzer.Kind.Greek, - Analyzer.Kind.Hindi, - Analyzer.Kind.Hungarian, - Analyzer.Kind.Indonesian, - Analyzer.Kind.Irish, - Analyzer.Kind.Italian, - Analyzer.Kind.Latvian, - Analyzer.Kind.Lithuanian, - Analyzer.Kind.Norwegian, - Analyzer.Kind.Persian, - Analyzer.Kind.Portuguese, - Analyzer.Kind.Romanian, - Analyzer.Kind.Russian, - Analyzer.Kind.Sorani, - Analyzer.Kind.Spanish, - Analyzer.Kind.Swedish, - Analyzer.Kind.Turkish, - Analyzer.Kind.Thai + ); + @Test + public void testPassingLanguageAnalyzerss() { + Map map = new HashMap<>(); + map.put("some_analyzer", + + LanguageAnalyzer.of(l -> l.language(Language.German). + stemExclusion(new ArrayList<>())) + ._toAnalyzer()); + IndexSettingsAnalysis settings = IndexSettingsAnalysis.of( + anl -> anl + .analyzer(map) + ); + + System.out.println(toJson(settings)); + } } + From 5154ee60d73e33eac805bb371cd52a22c65dd81f Mon Sep 17 00:00:00 2001 From: brentam Date: Sun, 31 Dec 2023 15:35:09 +1100 Subject: [PATCH 8/9] removing obsolete test class Signed-off-by: brentam --- .../_types/analysis/AnalyzerKindTest.java | 233 ------------------ 1 file changed, 233 deletions(-) delete mode 100644 java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java b/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java deleted file mode 100644 index 27087062bc..0000000000 --- a/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * 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. - */ - -package org.opensearch.client.opensearch._types.analysis; - -import jakarta.json.stream.JsonGenerator; -import jakarta.json.stream.JsonParser; -import org.junit.Assert; -import org.junit.Test; -import org.opensearch.client.json.JsonpMapper; -import org.opensearch.client.json.JsonpSerializable; -import org.opensearch.client.json.jsonb.JsonbJsonpMapper; -import org.opensearch.client.opensearch.cluster.stats.CharFilterTypes; -import org.opensearch.client.opensearch.indices.IndexSettings; -import org.opensearch.client.opensearch.indices.IndexSettingsAnalysis; -import org.opensearch.core.index.Index; - -import java.io.StringReader; -import java.io.StringWriter; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AnalyzerKindTest extends Assert { - - /** - * Test if we can deserialize the language analyzers - * it uses reflection to avoid having to duplicate tests for all 34 currently supported languages - * - * @throws NoSuchMethodException - * @throws InvocationTargetException - * @throws IllegalAccessException - * @throws ClassNotFoundException - */ - @Test - public void testParsingAnalyzersForLanguages() throws NoSuchMethodException, InvocationTargetException, - IllegalAccessException, ClassNotFoundException, NullPointerException { - JsonpMapper mapper = new JsonbJsonpMapper(); - - for (Analyzer.Kind theKind : onlyLanguageAnalyzers) { - String type = theKind.jsonValue(); - String typeCapitalized = type.substring(0, 1).toUpperCase() + type.substring(1); - String json = String.format("{ \"index\": { \"analysis\": { \"analyzer\": { \"some_analyzer\": { \"type\": \"%s\"," + - " \"char_filter\": [ \"html_strip\" ], \"tokenizer\": \"standard\" } } } } } ", type); - - JsonParser parser = mapper.jsonProvider().createParser(new StringReader(json)); - IndexSettings indexSettings = IndexSettings._DESERIALIZER.deserialize(parser, mapper); - Analyzer someAnalyzer = indexSettings.index().analysis().analyzer().get("some_analyzer"); - - // Use reflection to generically check analyzer type - Method isMethod = someAnalyzer.getClass().getMethod("is" + typeCapitalized); - assertTrue((boolean) isMethod.invoke(someAnalyzer)); - - - String analyzerClassName = typeCapitalized + "Analyzer"; - - // Use reflection to generically check analyzer class - Method getAnalyzerMethod = someAnalyzer.getClass().getMethod(type); - Object analyzerInstance = getAnalyzerMethod.invoke(someAnalyzer); - Package pk = analyzerInstance.getClass().getPackage(); - assertEquals(analyzerInstance.getClass(), Class.forName(pk.getName() + "." + analyzerClassName)); - } - } - - @Test - public void testParsingAnalyzer() { - - JsonpMapper mapper = new JsonbJsonpMapper(); - String json = "{ \"index\": { \"analysis\": { \"analyzer\": { \"some_analyzer\": { \"type\": \"english\", \"char_filter\": [ \"html_strip\" ], \"tokenizer\": \"standard\" } } } } } "; - - JsonParser parser = mapper.jsonProvider().createParser(new StringReader(json)); - IndexSettings indexSettings = IndexSettings._DESERIALIZER.deserialize(parser, mapper); - System.out.println(toJson(indexSettings)); - assertTrue(true); - } - - - -// @Test -// public void testAnParsingAnalyzer3() { -// Map map2 = new HashMap<>(); -// map2.put("some_analyzer", DutchAnalyzer.of(en -> en)._toAnalyzer()); -// Map map = new HashMap<>(); -// map.put("some_analyzersss", DutchAnalyzer.of(en -> en)._toAnalyzer()); -// IndexSettingsAnalysis settings = IndexSettingsAnalysis.of( -// a -> -// -// a. charFilter("htm",CharFilter.of(c->c.name("html_strip"))) -// ); -// -// System.out.println(toJson(settings)); -// } - - @Test - public void testParsingAnalyzer2() { - - JsonpMapper mapper = new JsonbJsonpMapper(); - String json = "{ \"index\": { \"analysis\": { \"analyzer\": { \"some_analyzer\": { \"type\": \"english\", \"version\": \"2\", \"char_filter\": [ \"html_strip\" ], \"tokenizer\": \"standard\" } } } } } "; - - JsonParser parser = mapper.jsonProvider().createParser(new StringReader(json)); - IndexSettings indexSettings = IndexSettings._DESERIALIZER.deserialize(parser, mapper); - System.out.println(toJson(indexSettings)); - assertTrue(true); - } - @Test - public void testLanguage() { - Map map = new HashMap<>(); - map.put("some_analyzer", - LanguageAnalyzer.of( - l -> l.language(Language.German). - stemExclusion(new ArrayList<>()) - ) - ._toAnalyzer()); - IndexSettings settings = IndexSettings.of( - it -> it.analysis(a -> - a.analyzer(map) - - ) - ); - - System.out.println(toJson(settings)); - } - - @Test - public void testParsingLanguageANother() { - - JsonpMapper mapper = new JsonbJsonpMapper(); - String json = "{ \"index\": {\"analysis\":{\"analyzer\":{\"some_analyzer\":{\"type\":\"language\",\"language\":\"German\",\"stem_exclusion\":[]}}}} } "; - - JsonParser parser = mapper.jsonProvider().createParser(new StringReader(json)); - IndexSettings indexSettings = IndexSettings._DESERIALIZER.deserialize(parser, mapper); - System.out.println(toJson(indexSettings)); - assertTrue(true); - } - -// @Test -// public void testParsingAnalyzer3() { -// Map map = new HashMap<>(); -// map.put("english_analyzer", DutchAnalyzer.of(en -> en)._toAnalyzer()); -// IndexSettings settings = IndexSettings.of( -// it -> it.analysis(a -> -// a.analyzer(map)) -// ); -// -// System.out.println(toJson(settings)); -// } - - @Test - public void testPassingLanguageAnalyzer() { - String[] v= new String[]{"", ""}; - CharFilterDefinition fd2= CharFilterDefinitionBuilders.htmlStrip().build()._toCharFilterDefinition(); -// CharFilterDefinition fd= CharFilterDefinition. of(v -> v.htmlStrip( -// HtmlStripCharFilter.of(h->h.self()) -// )); - Map map = new HashMap<>(); - map.put("some_analyzer", - - LanguageAnalyzer.of(l -> l.language(Language.German). - stemExclusion(new ArrayList<>())) - ._toAnalyzer()); - IndexSettingsAnalysis settings = IndexSettingsAnalysis.of( - anl -> anl - .analyzer(map) - .charFilter("kkk",CharFilter.of(a->a.name("html"))) -// .charFilter("aaaa",CharFilter.of(i->i.definition(CharFilterDefinitionBuilders.htmlStrip().build()._toCharFilterDefinition()))) - // .charFilter("some_char_filter", CharFilter.of(c -> c.name("html_strip"))) - ); - - System.out.println(toJson(settings)); - } - - private String toJson(JsonpSerializable obj) { - JsonpMapper mapper = new JsonbJsonpMapper(); - StringWriter stringWriter = new StringWriter(); - try (JsonGenerator generator = mapper.jsonProvider().createGenerator(stringWriter)) { - mapper.serialize(obj, generator); - } - return stringWriter.toString(); - } - - private final List onlyLanguageAnalyzers = List.of( - - ); - - @Test - public void testPassingLanguageAnalyzerss() { - Map map = new HashMap<>(); - map.put("some_analyzer", - - LanguageAnalyzer.of(l -> l.language(Language.German). - stemExclusion(new ArrayList<>())) - ._toAnalyzer()); - IndexSettingsAnalysis settings = IndexSettingsAnalysis.of( - anl -> anl - .analyzer(map) - ); - - System.out.println(toJson(settings)); - } -} - From a38b9ba8df40cdb3d8e255e2b44b4f63390a4253 Mon Sep 17 00:00:00 2001 From: brentam Date: Sun, 31 Dec 2023 15:39:52 +1100 Subject: [PATCH 9/9] temporary commenting this test until we decide if we keep the CjkAnalyser Signed-off-by: brentam --- .../opensearch/experiments/ParsingTests.java | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/experiments/ParsingTests.java b/java-client/src/test/java/org/opensearch/client/opensearch/experiments/ParsingTests.java index 6963f82f89..68c728ba18 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/experiments/ParsingTests.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/experiments/ParsingTests.java @@ -157,20 +157,21 @@ public void testSmartcn_StopFilter() { TokenFilterDefinition analyzer2 = fromJson(str, TokenFilterDefinition._DESERIALIZER); } - @Test - public void testCjk_Analyzer() { - final Analyzer analyzer = new Analyzer.Builder().cjk(b -> b.stopwords(Arrays.asList("a", "b", "c")).stopwordsPath("path")).build(); - - assertTrue(analyzer.isCjk()); - - String str = toJson(analyzer); - assertEquals("{\"type\":\"cjk\",\"stopwords\":[\"a\",\"b\",\"c\"],\"stopwords_path\":\"path\"}", str); - - Analyzer analyzer2 = fromJson(str, Analyzer._DESERIALIZER); - assertTrue(analyzer2.isCjk()); - assertEquals(analyzer.cjk().stopwords(), analyzer2.cjk().stopwords()); - assertEquals(analyzer.cjk().stopwordsPath(), analyzer2.cjk().stopwordsPath()); - } +// temporary commenting this test until we decide if we keep the CjkAnalyser +// @Test +// public void testCjk_Analyzer() { +// final Analyzer analyzer = new Analyzer.Builder().cjk(b -> b.stopwords(Arrays.asList("a", "b", "c")).stopwordsPath("path")).build(); +// +// assertTrue(analyzer.isCjk()); +// +// String str = toJson(analyzer); +// assertEquals("{\"type\":\"cjk\",\"stopwords\":[\"a\",\"b\",\"c\"],\"stopwords_path\":\"path\"}", str); +// +// Analyzer analyzer2 = fromJson(str, Analyzer._DESERIALIZER); +// assertTrue(analyzer2.isCjk()); +// assertEquals(analyzer.cjk().stopwords(), analyzer2.cjk().stopwords()); +// assertEquals(analyzer.cjk().stopwordsPath(), analyzer2.cjk().stopwordsPath()); +// } @Test public void testFieldMappingResponse() {