diff --git a/CHANGELOG.md b/CHANGELOG.md index f3a10a5a53..dcf5d6b801 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,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) ([#779](https://github.com/opensearch-project/opensearch-java/pull/779)) ### Dependencies 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..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 @@ -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; @@ -114,61 +180,622 @@ public final Kind _kind() { return _kind; } - @Override - public final AnalyzerVariant _get() { - return _value; + @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; } - public Analyzer(AnalyzerVariant value) { + /** + * 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); + } - this._kind = ApiTypeHelper.requireNonNull(value._analyzerKind(), this, ""); - this._value = ApiTypeHelper.requireNonNull(value, this, ""); + /** + * Is this variant instance of kind {@code sorani}? + */ + public boolean isSorani() { + return _kind == Kind.Sorani; + } + /** + * 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); } - private Analyzer(Builder builder) { + /** + * Is this variant instance of kind {@code spanish}? + */ + public boolean isSpanish() { + return _kind == Kind.Spanish; + } - this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); - this._value = ApiTypeHelper.requireNonNull(builder._value, 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); + } + /** + * 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); } /** @@ -440,6 +1067,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 +1548,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..acdc58d8e9 --- /dev/null +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/analysis/EnglishAnalyzer.java @@ -0,0 +1,163 @@ +/* + * 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 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"); + } + +} 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..d876d20384 --- /dev/null +++ b/java-client/src/test/java/org/opensearch/client/opensearch/_types/analysis/AnalyzerKindTest.java @@ -0,0 +1,127 @@ +/* + * 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 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; + +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 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 { + 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 + ); + +}