diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/Analyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/Analyzer.java index 78fbdec16..6108a2b94 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/Analyzer.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/Analyzer.java @@ -72,32 +72,104 @@ public class Analyzer implements OpenTaggedUnion, JsonpSe */ public enum Kind implements JsonEnum { + Arabic("arabic"), + + Armenian("armenian"), + + Basque("basque"), + + Bengali("bengali"), + + Brazilian("brazilian"), + + Bulgarian("bulgarian"), + + Catalan("catalan"), + + Chinese("chinese"), + + Cjk("cjk"), + Custom("custom"), + Czech("czech"), + + Danish("danish"), + Dutch("dutch"), + English("english"), + + Estonian("estonian"), + Fingerprint("fingerprint"), + Finnish("finnish"), + + French("french"), + + Galician("galician"), + + German("german"), + + Greek("greek"), + + Hindi("hindi"), + + Hungarian("hungarian"), + IcuAnalyzer("icu_analyzer"), + Indonesian("indonesian"), + + Irish("irish"), + + Italian("italian"), + Keyword("keyword"), Kuromoji("kuromoji"), Language("language"), + Latvian("latvian"), + + Lithuanian("lithuanian"), + Nori("nori"), + Norwegian("norwegian"), + Pattern("pattern"), + Persian("persian"), + + Portuguese("portuguese"), + + Romanian("romanian"), + + Russian("russian"), + + Serbian("serbian"), + Simple("simple"), Snowball("snowball"), + Sorani("sorani"), + + Spanish("spanish"), + Standard("standard"), Stop("stop"), + Swedish("swedish"), + + Thai("thai"), + + Turkish("turkish"), + Whitespace("whitespace"), /** A custom {@code Analyzer} defined by a plugin */ @@ -161,326 +233,1144 @@ public Analyzer(String kind, JsonData value) { } /** - * Is this variant instance of kind {@code custom}? + * Is this variant instance of kind {@code arabic}? */ - public boolean isCustom() { - return _kind == Kind.Custom; + public boolean isArabic() { + return _kind == Kind.Arabic; } /** - * Get the {@code custom} variant value. + * Get the {@code arabic} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code custom} kind. + * if the current variant is not of the {@code arabic} kind. */ - public CustomAnalyzer custom() { - return TaggedUnionUtils.get(this, Kind.Custom); + public ArabicAnalyzer arabic() { + return TaggedUnionUtils.get(this, Kind.Arabic); } /** - * Is this variant instance of kind {@code dutch}? + * Is this variant instance of kind {@code armenian}? */ - public boolean isDutch() { - return _kind == Kind.Dutch; + public boolean isArmenian() { + return _kind == Kind.Armenian; } /** - * Get the {@code dutch} variant value. + * Get the {@code armenian} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code dutch} kind. + * if the current variant is not of the {@code armenian} kind. */ - public DutchAnalyzer dutch() { - return TaggedUnionUtils.get(this, Kind.Dutch); + public ArmenianAnalyzer armenian() { + return TaggedUnionUtils.get(this, Kind.Armenian); } /** - * Is this variant instance of kind {@code fingerprint}? + * Is this variant instance of kind {@code basque}? */ - public boolean isFingerprint() { - return _kind == Kind.Fingerprint; + public boolean isBasque() { + return _kind == Kind.Basque; } /** - * Get the {@code fingerprint} variant value. + * Get the {@code basque} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code fingerprint} kind. + * if the current variant is not of the {@code basque} kind. */ - public FingerprintAnalyzer fingerprint() { - return TaggedUnionUtils.get(this, Kind.Fingerprint); + public BasqueAnalyzer basque() { + return TaggedUnionUtils.get(this, Kind.Basque); } /** - * Is this variant instance of kind {@code icu_analyzer}? + * Is this variant instance of kind {@code bengali}? */ - public boolean isIcuAnalyzer() { - return _kind == Kind.IcuAnalyzer; + public boolean isBengali() { + return _kind == Kind.Bengali; } /** - * Get the {@code icu_analyzer} variant value. + * Get the {@code bengali} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code icu_analyzer} kind. + * if the current variant is not of the {@code bengali} kind. */ - public IcuAnalyzer icuAnalyzer() { - return TaggedUnionUtils.get(this, Kind.IcuAnalyzer); + public BengaliAnalyzer bengali() { + return TaggedUnionUtils.get(this, Kind.Bengali); } /** - * Is this variant instance of kind {@code keyword}? + * Is this variant instance of kind {@code brazilian}? */ - public boolean isKeyword() { - return _kind == Kind.Keyword; + public boolean isBrazilian() { + return _kind == Kind.Brazilian; } /** - * Get the {@code keyword} variant value. + * Get the {@code brazilian} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code keyword} kind. + * if the current variant is not of the {@code brazilian} kind. */ - public KeywordAnalyzer keyword() { - return TaggedUnionUtils.get(this, Kind.Keyword); + public BrazilianAnalyzer brazilian() { + return TaggedUnionUtils.get(this, Kind.Brazilian); } /** - * Is this variant instance of kind {@code kuromoji}? + * Is this variant instance of kind {@code bulgarian}? */ - public boolean isKuromoji() { - return _kind == Kind.Kuromoji; + public boolean isBulgarian() { + return _kind == Kind.Bulgarian; } /** - * Get the {@code kuromoji} variant value. + * Get the {@code bulgarian} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code kuromoji} kind. + * if the current variant is not of the {@code bulgarian} kind. */ - public KuromojiAnalyzer kuromoji() { - return TaggedUnionUtils.get(this, Kind.Kuromoji); + public BulgarianAnalyzer bulgarian() { + return TaggedUnionUtils.get(this, Kind.Bulgarian); } /** - * Is this variant instance of kind {@code language}? + * Is this variant instance of kind {@code catalan}? */ - public boolean isLanguage() { - return _kind == Kind.Language; + public boolean isCatalan() { + return _kind == Kind.Catalan; } /** - * Get the {@code language} variant value. + * Get the {@code catalan} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code language} kind. + * if the current variant is not of the {@code catalan} kind. */ - public LanguageAnalyzer language() { - return TaggedUnionUtils.get(this, Kind.Language); + public CatalanAnalyzer catalan() { + return TaggedUnionUtils.get(this, Kind.Catalan); } /** - * Is this variant instance of kind {@code nori}? + * Is this variant instance of kind {@code chinese}? */ - public boolean isNori() { - return _kind == Kind.Nori; + public boolean isChinese() { + return _kind == Kind.Chinese; } /** - * Get the {@code nori} variant value. + * Get the {@code chinese} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code nori} kind. + * if the current variant is not of the {@code chinese} kind. */ - public NoriAnalyzer nori() { - return TaggedUnionUtils.get(this, Kind.Nori); + public ChineseAnalyzer chinese() { + return TaggedUnionUtils.get(this, Kind.Chinese); } /** - * Is this variant instance of kind {@code pattern}? + * Is this variant instance of kind {@code cjk}? */ - public boolean isPattern() { - return _kind == Kind.Pattern; + public boolean isCjk() { + return _kind == Kind.Cjk; } /** - * Get the {@code pattern} variant value. + * Get the {@code cjk} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code pattern} kind. + * if the current variant is not of the {@code cjk} kind. */ - public PatternAnalyzer pattern() { - return TaggedUnionUtils.get(this, Kind.Pattern); + public CjkAnalyzer cjk() { + return TaggedUnionUtils.get(this, Kind.Cjk); } /** - * Is this variant instance of kind {@code simple}? + * Is this variant instance of kind {@code custom}? */ - public boolean isSimple() { - return _kind == Kind.Simple; + public boolean isCustom() { + return _kind == Kind.Custom; } /** - * Get the {@code simple} variant value. + * Get the {@code custom} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code simple} kind. + * if the current variant is not of the {@code custom} kind. */ - public SimpleAnalyzer simple() { - return TaggedUnionUtils.get(this, Kind.Simple); + public CustomAnalyzer custom() { + return TaggedUnionUtils.get(this, Kind.Custom); } /** - * Is this variant instance of kind {@code snowball}? + * Is this variant instance of kind {@code czech}? */ - public boolean isSnowball() { - return _kind == Kind.Snowball; + public boolean isCzech() { + return _kind == Kind.Czech; } /** - * Get the {@code snowball} variant value. + * Get the {@code czech} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code snowball} kind. + * if the current variant is not of the {@code czech} kind. */ - public SnowballAnalyzer snowball() { - return TaggedUnionUtils.get(this, Kind.Snowball); + public CzechAnalyzer czech() { + return TaggedUnionUtils.get(this, Kind.Czech); } /** - * Is this variant instance of kind {@code standard}? + * Is this variant instance of kind {@code danish}? */ - public boolean isStandard() { - return _kind == Kind.Standard; + public boolean isDanish() { + return _kind == Kind.Danish; } /** - * Get the {@code standard} variant value. + * Get the {@code danish} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code standard} kind. + * if the current variant is not of the {@code danish} kind. */ - public StandardAnalyzer standard() { - return TaggedUnionUtils.get(this, Kind.Standard); + public DanishAnalyzer danish() { + return TaggedUnionUtils.get(this, Kind.Danish); } /** - * Is this variant instance of kind {@code stop}? + * Is this variant instance of kind {@code dutch}? */ - public boolean isStop() { - return _kind == Kind.Stop; + public boolean isDutch() { + return _kind == Kind.Dutch; } /** - * Get the {@code stop} variant value. + * Get the {@code dutch} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code stop} kind. + * if the current variant is not of the {@code dutch} kind. */ - public StopAnalyzer stop() { - return TaggedUnionUtils.get(this, Kind.Stop); + public DutchAnalyzer dutch() { + return TaggedUnionUtils.get(this, Kind.Dutch); } /** - * Is this variant instance of kind {@code whitespace}? + * Is this variant instance of kind {@code english}? */ - public boolean isWhitespace() { - return _kind == Kind.Whitespace; + public boolean isEnglish() { + return _kind == Kind.English; } /** - * Get the {@code whitespace} variant value. + * Get the {@code english} variant value. * * @throws IllegalStateException - * if the current variant is not of the {@code whitespace} kind. + * if the current variant is not of the {@code english} kind. */ - public WhitespaceAnalyzer whitespace() { - return TaggedUnionUtils.get(this, Kind.Whitespace); + public EnglishAnalyzer english() { + return TaggedUnionUtils.get(this, Kind.English); } - @Nullable - private final String _customKind; + /** + * Is this variant instance of kind {@code estonian}? + */ + public boolean isEstonian() { + return _kind == Kind.Estonian; + } /** - * Is this a custom {@code Analyzer} defined by a plugin? + * Get the {@code estonian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code estonian} kind. */ - public boolean _isCustom() { - return _kind == Kind._Custom; + public EstonianAnalyzer estonian() { + return TaggedUnionUtils.get(this, Kind.Estonian); } /** - * Get the actual kind when {@code _kind()} equals {@link Kind#_Custom} - * (plugin-defined variant). + * Is this variant instance of kind {@code fingerprint}? */ - @Nullable - public final String _customKind() { - return _customKind; + public boolean isFingerprint() { + return _kind == Kind.Fingerprint; } /** - * Get the custom plugin-defined variant value. + * Get the {@code fingerprint} variant value. * * @throws IllegalStateException - * if the current variant is not {@link Kind#_Custom}. + * if the current variant is not of the {@code fingerprint} kind. */ - public JsonData _custom() { - return TaggedUnionUtils.get(this, Kind._Custom); + public FingerprintAnalyzer fingerprint() { + return TaggedUnionUtils.get(this, Kind.Fingerprint); } - @Override - public void serialize(JsonGenerator generator, JsonpMapper mapper) { + /** + * Is this variant instance of kind {@code finnish}? + */ + public boolean isFinnish() { + return _kind == Kind.Finnish; + } - mapper.serialize(_value, generator); + /** + * 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; } - @Override - public String toString() { - return JsonpUtils.toString(this); + /** + * 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); } - public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { - private Kind _kind; - private Object _value; - private String _customKind; + /** + * Is this variant instance of kind {@code galician}? + */ + public boolean isGalician() { + return _kind == Kind.Galician; + } - @Override - protected Builder self() { - return this; - } - public ObjectBuilder custom(CustomAnalyzer v) { - this._kind = Kind.Custom; - this._value = v; - return this; - } + /** + * 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); + } - public ObjectBuilder custom(Function> fn) { - return this.custom(fn.apply(new CustomAnalyzer.Builder()).build()); - } + /** + * Is this variant instance of kind {@code german}? + */ + public boolean isGerman() { + return _kind == Kind.German; + } - public ObjectBuilder dutch(DutchAnalyzer v) { - this._kind = Kind.Dutch; - this._value = v; - return this; - } + /** + * 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); + } - public ObjectBuilder dutch(Function> fn) { - return this.dutch(fn.apply(new DutchAnalyzer.Builder()).build()); - } + /** + * Is this variant instance of kind {@code greek}? + */ + public boolean isGreek() { + return _kind == Kind.Greek; + } - public ObjectBuilder fingerprint(FingerprintAnalyzer v) { - this._kind = Kind.Fingerprint; - this._value = v; - return this; - } + /** + * 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); + } - public ObjectBuilder fingerprint( - Function> fn) { - return this.fingerprint(fn.apply(new FingerprintAnalyzer.Builder()).build()); - } + /** + * Is this variant instance of kind {@code hindi}? + */ + public boolean isHindi() { + return _kind == Kind.Hindi; + } - public ObjectBuilder icuAnalyzer(IcuAnalyzer v) { - this._kind = Kind.IcuAnalyzer; + /** + * 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 icu_analyzer}? + */ + public boolean isIcuAnalyzer() { + return _kind == Kind.IcuAnalyzer; + } + + /** + * Get the {@code icu_analyzer} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code icu_analyzer} kind. + */ + public IcuAnalyzer icuAnalyzer() { + return TaggedUnionUtils.get(this, Kind.IcuAnalyzer); + } + + /** + * 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 keyword}? + */ + public boolean isKeyword() { + return _kind == Kind.Keyword; + } + + /** + * Get the {@code keyword} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code keyword} kind. + */ + public KeywordAnalyzer keyword() { + return TaggedUnionUtils.get(this, Kind.Keyword); + } + + /** + * Is this variant instance of kind {@code kuromoji}? + */ + public boolean isKuromoji() { + return _kind == Kind.Kuromoji; + } + + /** + * Get the {@code kuromoji} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code kuromoji} kind. + */ + public KuromojiAnalyzer kuromoji() { + return TaggedUnionUtils.get(this, Kind.Kuromoji); + } + + /** + * Is this variant instance of kind {@code language}? + */ + public boolean isLanguage() { + return _kind == Kind.Language; + } + + /** + * Get the {@code language} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code language} kind. + */ + public LanguageAnalyzer language() { + return TaggedUnionUtils.get(this, Kind.Language); + } + + /** + * Is this variant instance of kind {@code 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 nori}? + */ + public boolean isNori() { + return _kind == Kind.Nori; + } + + /** + * Get the {@code nori} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code nori} kind. + */ + public NoriAnalyzer nori() { + return TaggedUnionUtils.get(this, Kind.Nori); + } + + /** + * 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 pattern}? + */ + public boolean isPattern() { + return _kind == Kind.Pattern; + } + + /** + * Get the {@code pattern} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code pattern} kind. + */ + public PatternAnalyzer pattern() { + return TaggedUnionUtils.get(this, Kind.Pattern); + } + + /** + * Is this variant instance of kind {@code persian}? + */ + public boolean isPersian() { + return _kind == Kind.Persian; + } + + /** + * Get the {@code persian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code persian} kind. + */ + public PersianAnalyzer persian() { + return TaggedUnionUtils.get(this, Kind.Persian); + } + + /** + * Is this variant instance of kind {@code portuguese}? + */ + public boolean isPortuguese() { + return _kind == Kind.Portuguese; + } + + /** + * Get the {@code portuguese} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code portuguese} kind. + */ + public PortugueseAnalyzer portuguese() { + return TaggedUnionUtils.get(this, Kind.Portuguese); + } + + /** + * Is this variant instance of kind {@code romanian}? + */ + public boolean isRomanian() { + return _kind == Kind.Romanian; + } + + /** + * Get the {@code romanian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code romanian} kind. + */ + public RomanianAnalyzer romanian() { + return TaggedUnionUtils.get(this, Kind.Romanian); + } + + /** + * Is this variant instance of kind {@code russian}? + */ + public boolean isRussian() { + return _kind == Kind.Russian; + } + + /** + * Get the {@code russian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code russian} kind. + */ + public RussianAnalyzer russian() { + return TaggedUnionUtils.get(this, Kind.Russian); + } + + /** + * Is this variant instance of kind {@code serbian}? + */ + public boolean isSerbian() { + return _kind == Kind.Serbian; + } + + /** + * Get the {@code serbian} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code serbian} kind. + */ + public SerbianAnalyzer serbian() { + return TaggedUnionUtils.get(this, Kind.Serbian); + } + + /** + * Is this variant instance of kind {@code simple}? + */ + public boolean isSimple() { + return _kind == Kind.Simple; + } + + /** + * Get the {@code simple} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code simple} kind. + */ + public SimpleAnalyzer simple() { + return TaggedUnionUtils.get(this, Kind.Simple); + } + + /** + * Is this variant instance of kind {@code snowball}? + */ + public boolean isSnowball() { + return _kind == Kind.Snowball; + } + + /** + * Get the {@code snowball} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code snowball} kind. + */ + public SnowballAnalyzer snowball() { + return TaggedUnionUtils.get(this, Kind.Snowball); + } + + /** + * 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); + } + + /** + * Is this variant instance of kind {@code spanish}? + */ + public boolean isSpanish() { + return _kind == Kind.Spanish; + } + + /** + * 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 standard}? + */ + public boolean isStandard() { + return _kind == Kind.Standard; + } + + /** + * Get the {@code standard} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code standard} kind. + */ + public StandardAnalyzer standard() { + return TaggedUnionUtils.get(this, Kind.Standard); + } + + /** + * Is this variant instance of kind {@code stop}? + */ + public boolean isStop() { + return _kind == Kind.Stop; + } + + /** + * Get the {@code stop} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code stop} kind. + */ + public StopAnalyzer stop() { + return TaggedUnionUtils.get(this, Kind.Stop); + } + + /** + * Is this variant instance of kind {@code swedish}? + */ + public boolean isSwedish() { + return _kind == Kind.Swedish; + } + + /** + * 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 thai}? + */ + public boolean isThai() { + return _kind == Kind.Thai; + } + + /** + * Get the {@code thai} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code thai} kind. + */ + public ThaiAnalyzer thai() { + return TaggedUnionUtils.get(this, Kind.Thai); + } + + /** + * Is this variant instance of kind {@code turkish}? + */ + public boolean isTurkish() { + return _kind == Kind.Turkish; + } + + /** + * Get the {@code turkish} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code turkish} kind. + */ + public TurkishAnalyzer turkish() { + return TaggedUnionUtils.get(this, Kind.Turkish); + } + + /** + * Is this variant instance of kind {@code whitespace}? + */ + public boolean isWhitespace() { + return _kind == Kind.Whitespace; + } + + /** + * Get the {@code whitespace} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code whitespace} kind. + */ + public WhitespaceAnalyzer whitespace() { + return TaggedUnionUtils.get(this, Kind.Whitespace); + } + + @Nullable + private final String _customKind; + + /** + * Is this a custom {@code Analyzer} defined by a plugin? + */ + public boolean _isCustom() { + return _kind == Kind._Custom; + } + + /** + * Get the actual kind when {@code _kind()} equals {@link Kind#_Custom} + * (plugin-defined variant). + */ + @Nullable + public final String _customKind() { + return _customKind; + } + + /** + * Get the custom plugin-defined variant value. + * + * @throws IllegalStateException + * if the current variant is not {@link Kind#_Custom}. + */ + public JsonData _custom() { + return TaggedUnionUtils.get(this, Kind._Custom); + } + + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + + mapper.serialize(_value, generator); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Kind _kind; + private Object _value; + private String _customKind; + + @Override + protected Builder self() { + return this; + } + public ObjectBuilder 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 chinese(ChineseAnalyzer v) { + this._kind = Kind.Chinese; + this._value = v; + return this; + } + + public ObjectBuilder chinese(Function> fn) { + return this.chinese(fn.apply(new ChineseAnalyzer.Builder()).build()); + } + + public ObjectBuilder cjk(CjkAnalyzer v) { + this._kind = Kind.Cjk; + this._value = v; + return this; + } + + public ObjectBuilder cjk(Function> fn) { + return this.cjk(fn.apply(new CjkAnalyzer.Builder()).build()); + } + + public ObjectBuilder custom(CustomAnalyzer v) { + this._kind = Kind.Custom; + this._value = v; + return this; + } + + public ObjectBuilder custom(Function> fn) { + return this.custom(fn.apply(new CustomAnalyzer.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 dutch(DutchAnalyzer v) { + this._kind = Kind.Dutch; + this._value = v; + return this; + } + + public ObjectBuilder dutch(Function> fn) { + return this.dutch(fn.apply(new DutchAnalyzer.Builder()).build()); + } + + public ObjectBuilder 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 fingerprint(FingerprintAnalyzer v) { + this._kind = Kind.Fingerprint; + this._value = v; + return this; + } + + public ObjectBuilder fingerprint( + Function> fn) { + return this.fingerprint(fn.apply(new FingerprintAnalyzer.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 icuAnalyzer(IcuAnalyzer v) { + this._kind = Kind.IcuAnalyzer; this._value = v; return this; } @@ -489,6 +1379,37 @@ public ObjectBuilder icuAnalyzer(Function 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 keyword(KeywordAnalyzer v) { this._kind = Kind.Keyword; this._value = v; @@ -521,6 +1442,27 @@ public ObjectBuilder language( return this.language(fn.apply(new LanguageAnalyzer.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 nori(NoriAnalyzer v) { this._kind = Kind.Nori; this._value = v; @@ -531,6 +1473,17 @@ public ObjectBuilder nori(Function 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 pattern(PatternAnalyzer v) { this._kind = Kind.Pattern; this._value = v; @@ -541,6 +1494,58 @@ public ObjectBuilder pattern(Function 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 serbian(SerbianAnalyzer v) { + this._kind = Kind.Serbian; + this._value = v; + return this; + } + + public ObjectBuilder serbian(Function> fn) { + return this.serbian(fn.apply(new SerbianAnalyzer.Builder()).build()); + } + public ObjectBuilder simple(SimpleAnalyzer v) { this._kind = Kind.Simple; this._value = v; @@ -562,6 +1567,26 @@ public ObjectBuilder snowball( return this.snowball(fn.apply(new SnowballAnalyzer.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 standard(StandardAnalyzer v) { this._kind = Kind.Standard; this._value = v; @@ -583,6 +1608,36 @@ public ObjectBuilder stop(Function 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 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 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 whitespace(WhitespaceAnalyzer v) { this._kind = Kind.Whitespace; this._value = v; @@ -619,19 +1674,55 @@ public Analyzer build() { protected static void setupAnalyzerDeserializer(ObjectDeserializer op) { + 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::chinese, ChineseAnalyzer._DESERIALIZER, "chinese"); + op.add(Builder::cjk, CjkAnalyzer._DESERIALIZER, "cjk"); op.add(Builder::custom, CustomAnalyzer._DESERIALIZER, "custom"); + op.add(Builder::czech, CzechAnalyzer._DESERIALIZER, "czech"); + op.add(Builder::danish, DanishAnalyzer._DESERIALIZER, "danish"); op.add(Builder::dutch, DutchAnalyzer._DESERIALIZER, "dutch"); + op.add(Builder::english, EnglishAnalyzer._DESERIALIZER, "english"); + op.add(Builder::estonian, EstonianAnalyzer._DESERIALIZER, "estonian"); op.add(Builder::fingerprint, FingerprintAnalyzer._DESERIALIZER, "fingerprint"); + 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::icuAnalyzer, IcuAnalyzer._DESERIALIZER, "icu_analyzer"); + op.add(Builder::indonesian, IndonesianAnalyzer._DESERIALIZER, "indonesian"); + op.add(Builder::irish, IrishAnalyzer._DESERIALIZER, "irish"); + op.add(Builder::italian, ItalianAnalyzer._DESERIALIZER, "italian"); op.add(Builder::keyword, KeywordAnalyzer._DESERIALIZER, "keyword"); op.add(Builder::kuromoji, KuromojiAnalyzer._DESERIALIZER, "kuromoji"); op.add(Builder::language, LanguageAnalyzer._DESERIALIZER, "language"); + op.add(Builder::latvian, LatvianAnalyzer._DESERIALIZER, "latvian"); + op.add(Builder::lithuanian, LithuanianAnalyzer._DESERIALIZER, "lithuanian"); op.add(Builder::nori, NoriAnalyzer._DESERIALIZER, "nori"); + op.add(Builder::norwegian, NorwegianAnalyzer._DESERIALIZER, "norwegian"); op.add(Builder::pattern, PatternAnalyzer._DESERIALIZER, "pattern"); + 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::serbian, SerbianAnalyzer._DESERIALIZER, "serbian"); op.add(Builder::simple, SimpleAnalyzer._DESERIALIZER, "simple"); op.add(Builder::snowball, SnowballAnalyzer._DESERIALIZER, "snowball"); + op.add(Builder::sorani, SoraniAnalyzer._DESERIALIZER, "sorani"); + op.add(Builder::spanish, SpanishAnalyzer._DESERIALIZER, "spanish"); op.add(Builder::standard, StandardAnalyzer._DESERIALIZER, "standard"); op.add(Builder::stop, StopAnalyzer._DESERIALIZER, "stop"); + op.add(Builder::swedish, SwedishAnalyzer._DESERIALIZER, "swedish"); + op.add(Builder::thai, ThaiAnalyzer._DESERIALIZER, "thai"); + op.add(Builder::turkish, TurkishAnalyzer._DESERIALIZER, "turkish"); op.add(Builder::whitespace, WhitespaceAnalyzer._DESERIALIZER, "whitespace"); op.setUnknownFieldHandler((builder, name, parser, mapper) -> { diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/AnalyzerBuilders.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/AnalyzerBuilders.java index f43787382..77c01248c 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/AnalyzerBuilders.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/AnalyzerBuilders.java @@ -44,6 +44,166 @@ public class AnalyzerBuilders { private AnalyzerBuilders() { } + /** + * Creates a builder for the {@link ArabicAnalyzer arabic} {@code Analyzer} + * variant. + */ + public static ArabicAnalyzer.Builder arabic() { + return new ArabicAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link ArabicAnalyzer arabic} {@code Analyzer} + * variant. + */ + public static Analyzer arabic(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.arabic(fn.apply(new ArabicAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link ArmenianAnalyzer armenian} {@code Analyzer} + * variant. + */ + public static ArmenianAnalyzer.Builder armenian() { + return new ArmenianAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link ArmenianAnalyzer armenian} {@code Analyzer} + * variant. + */ + public static Analyzer armenian(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.armenian(fn.apply(new ArmenianAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link BasqueAnalyzer basque} {@code Analyzer} + * variant. + */ + public static BasqueAnalyzer.Builder basque() { + return new BasqueAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link BasqueAnalyzer basque} {@code Analyzer} + * variant. + */ + public static Analyzer basque(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.basque(fn.apply(new BasqueAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link BengaliAnalyzer bengali} {@code Analyzer} + * variant. + */ + public static BengaliAnalyzer.Builder bengali() { + return new BengaliAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link BengaliAnalyzer bengali} {@code Analyzer} + * variant. + */ + public static Analyzer bengali(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.bengali(fn.apply(new BengaliAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link BrazilianAnalyzer brazilian} + * {@code Analyzer} variant. + */ + public static BrazilianAnalyzer.Builder brazilian() { + return new BrazilianAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link BrazilianAnalyzer brazilian} + * {@code Analyzer} variant. + */ + public static Analyzer brazilian(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.brazilian(fn.apply(new BrazilianAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link BulgarianAnalyzer bulgarian} + * {@code Analyzer} variant. + */ + public static BulgarianAnalyzer.Builder bulgarian() { + return new BulgarianAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link BulgarianAnalyzer bulgarian} + * {@code Analyzer} variant. + */ + public static Analyzer bulgarian(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.bulgarian(fn.apply(new BulgarianAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link CatalanAnalyzer catalan} {@code Analyzer} + * variant. + */ + public static CatalanAnalyzer.Builder catalan() { + return new CatalanAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link CatalanAnalyzer catalan} {@code Analyzer} + * variant. + */ + public static Analyzer catalan(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.catalan(fn.apply(new CatalanAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link ChineseAnalyzer chinese} {@code Analyzer} + * variant. + */ + public static ChineseAnalyzer.Builder chinese() { + return new ChineseAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link ChineseAnalyzer chinese} {@code Analyzer} + * variant. + */ + public static Analyzer chinese(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.chinese(fn.apply(new ChineseAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link CjkAnalyzer cjk} {@code Analyzer} variant. + */ + public static CjkAnalyzer.Builder cjk() { + return new CjkAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link CjkAnalyzer cjk} {@code Analyzer} variant. + */ + public static Analyzer cjk(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.cjk(fn.apply(new CjkAnalyzer.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link CustomAnalyzer custom} {@code Analyzer} * variant. @@ -62,6 +222,42 @@ public static Analyzer custom(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.czech(fn.apply(new CzechAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link DanishAnalyzer danish} {@code Analyzer} + * variant. + */ + public static DanishAnalyzer.Builder danish() { + return new DanishAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link DanishAnalyzer danish} {@code Analyzer} + * variant. + */ + public static Analyzer danish(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.danish(fn.apply(new DanishAnalyzer.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link DutchAnalyzer dutch} {@code Analyzer} * variant. @@ -80,6 +276,42 @@ public static Analyzer dutch(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.english(fn.apply(new EnglishAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link EstonianAnalyzer estonian} {@code Analyzer} + * variant. + */ + public static EstonianAnalyzer.Builder estonian() { + return new EstonianAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link EstonianAnalyzer estonian} {@code Analyzer} + * variant. + */ + public static Analyzer estonian(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.estonian(fn.apply(new EstonianAnalyzer.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link FingerprintAnalyzer fingerprint} * {@code Analyzer} variant. @@ -98,6 +330,132 @@ public static Analyzer fingerprint(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.finnish(fn.apply(new FinnishAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link FrenchAnalyzer french} {@code Analyzer} + * variant. + */ + public static FrenchAnalyzer.Builder french() { + return new FrenchAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link FrenchAnalyzer french} {@code Analyzer} + * variant. + */ + public static Analyzer french(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.french(fn.apply(new FrenchAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link GalicianAnalyzer galician} {@code Analyzer} + * variant. + */ + public static GalicianAnalyzer.Builder galician() { + return new GalicianAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link GalicianAnalyzer galician} {@code Analyzer} + * variant. + */ + public static Analyzer galician(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.galician(fn.apply(new GalicianAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link GermanAnalyzer german} {@code Analyzer} + * variant. + */ + public static GermanAnalyzer.Builder german() { + return new GermanAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link GermanAnalyzer german} {@code Analyzer} + * variant. + */ + public static Analyzer german(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.german(fn.apply(new GermanAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link GreekAnalyzer greek} {@code Analyzer} + * variant. + */ + public static GreekAnalyzer.Builder greek() { + return new GreekAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link GreekAnalyzer greek} {@code Analyzer} + * variant. + */ + public static Analyzer greek(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.greek(fn.apply(new GreekAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link HindiAnalyzer hindi} {@code Analyzer} + * variant. + */ + public static HindiAnalyzer.Builder hindi() { + return new HindiAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link HindiAnalyzer hindi} {@code Analyzer} + * variant. + */ + public static Analyzer hindi(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.hindi(fn.apply(new HindiAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link HungarianAnalyzer hungarian} + * {@code Analyzer} variant. + */ + public static HungarianAnalyzer.Builder hungarian() { + return new HungarianAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link HungarianAnalyzer hungarian} + * {@code Analyzer} variant. + */ + public static Analyzer hungarian(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.hungarian(fn.apply(new HungarianAnalyzer.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link IcuAnalyzer icu_analyzer} {@code Analyzer} * variant. @@ -116,6 +474,60 @@ public static Analyzer icuAnalyzer(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.indonesian(fn.apply(new IndonesianAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link IrishAnalyzer irish} {@code Analyzer} + * variant. + */ + public static IrishAnalyzer.Builder irish() { + return new IrishAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link IrishAnalyzer irish} {@code Analyzer} + * variant. + */ + public static Analyzer irish(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.irish(fn.apply(new IrishAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link ItalianAnalyzer italian} {@code Analyzer} + * variant. + */ + public static ItalianAnalyzer.Builder italian() { + return new ItalianAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link ItalianAnalyzer italian} {@code Analyzer} + * variant. + */ + public static Analyzer italian(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.italian(fn.apply(new ItalianAnalyzer.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link KeywordAnalyzer keyword} {@code Analyzer} * variant. @@ -170,6 +582,42 @@ public static Analyzer language(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.latvian(fn.apply(new LatvianAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link LithuanianAnalyzer lithuanian} + * {@code Analyzer} variant. + */ + public static LithuanianAnalyzer.Builder lithuanian() { + return new LithuanianAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link LithuanianAnalyzer lithuanian} + * {@code Analyzer} variant. + */ + public static Analyzer lithuanian(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.lithuanian(fn.apply(new LithuanianAnalyzer.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link NoriAnalyzer nori} {@code Analyzer} variant. */ @@ -186,6 +634,24 @@ public static Analyzer nori(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.norwegian(fn.apply(new NorwegianAnalyzer.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link PatternAnalyzer pattern} {@code Analyzer} * variant. @@ -204,6 +670,96 @@ public static Analyzer pattern(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.persian(fn.apply(new PersianAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link PortugueseAnalyzer portuguese} + * {@code Analyzer} variant. + */ + public static PortugueseAnalyzer.Builder portuguese() { + return new PortugueseAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link PortugueseAnalyzer portuguese} + * {@code Analyzer} variant. + */ + public static Analyzer portuguese(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.portuguese(fn.apply(new PortugueseAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link RomanianAnalyzer romanian} {@code Analyzer} + * variant. + */ + public static RomanianAnalyzer.Builder romanian() { + return new RomanianAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link RomanianAnalyzer romanian} {@code Analyzer} + * variant. + */ + public static Analyzer romanian(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.romanian(fn.apply(new RomanianAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link RussianAnalyzer russian} {@code Analyzer} + * variant. + */ + public static RussianAnalyzer.Builder russian() { + return new RussianAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link RussianAnalyzer russian} {@code Analyzer} + * variant. + */ + public static Analyzer russian(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.russian(fn.apply(new RussianAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link SerbianAnalyzer serbian} {@code Analyzer} + * variant. + */ + public static SerbianAnalyzer.Builder serbian() { + return new SerbianAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link SerbianAnalyzer serbian} {@code Analyzer} + * variant. + */ + public static Analyzer serbian(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.serbian(fn.apply(new SerbianAnalyzer.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link SimpleAnalyzer simple} {@code Analyzer} * variant. @@ -240,6 +796,42 @@ public static Analyzer snowball(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.sorani(fn.apply(new SoraniAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link SpanishAnalyzer spanish} {@code Analyzer} + * variant. + */ + public static SpanishAnalyzer.Builder spanish() { + return new SpanishAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link SpanishAnalyzer spanish} {@code Analyzer} + * variant. + */ + public static Analyzer spanish(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.spanish(fn.apply(new SpanishAnalyzer.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link StandardAnalyzer standard} {@code Analyzer} * variant. @@ -274,6 +866,58 @@ public static Analyzer stop(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.swedish(fn.apply(new SwedishAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link ThaiAnalyzer thai} {@code Analyzer} variant. + */ + public static ThaiAnalyzer.Builder thai() { + return new ThaiAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link ThaiAnalyzer thai} {@code Analyzer} variant. + */ + public static Analyzer thai(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.thai(fn.apply(new ThaiAnalyzer.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link TurkishAnalyzer turkish} {@code Analyzer} + * variant. + */ + public static TurkishAnalyzer.Builder turkish() { + return new TurkishAnalyzer.Builder(); + } + + /** + * Creates a Analyzer of the {@link TurkishAnalyzer turkish} {@code Analyzer} + * variant. + */ + public static Analyzer turkish(Function> fn) { + Analyzer.Builder builder = new Analyzer.Builder(); + builder.turkish(fn.apply(new TurkishAnalyzer.Builder()).build()); + return builder.build(); + } + /** * Creates a builder for the {@link WhitespaceAnalyzer whitespace} * {@code Analyzer} variant. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ArabicAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ArabicAnalyzer.java new file mode 100644 index 000000000..ea64986f3 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ArabicAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.ArabicAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ArabicAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private ArabicAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ArabicAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ArmenianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ArmenianAnalyzer.java new file mode 100644 index 000000000..3e4da7101 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ArmenianAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.ArmenianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ArmenianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private ArmenianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ArmenianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/BasqueAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/BasqueAnalyzer.java new file mode 100644 index 000000000..6e9685bb4 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/BasqueAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.BasqueAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class BasqueAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private BasqueAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link BasqueAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/BengaliAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/BengaliAnalyzer.java new file mode 100644 index 000000000..ff8e26057 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/BengaliAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.BengaliAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class BengaliAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private BengaliAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link BengaliAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/BrazilianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/BrazilianAnalyzer.java new file mode 100644 index 000000000..b3ff95083 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/BrazilianAnalyzer.java @@ -0,0 +1,217 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.BrazilianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class BrazilianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + // --------------------------------------------------------------------------------------------- + + private BrazilianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "brazilian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link BrazilianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/BulgarianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/BulgarianAnalyzer.java new file mode 100644 index 000000000..bce4548fe --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/BulgarianAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.BulgarianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class BulgarianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private BulgarianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link BulgarianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CatalanAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CatalanAnalyzer.java new file mode 100644 index 000000000..be3608b7e --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CatalanAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.CatalanAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CatalanAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private CatalanAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CatalanAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ChineseAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ChineseAnalyzer.java new file mode 100644 index 000000000..23af63468 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ChineseAnalyzer.java @@ -0,0 +1,217 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.ChineseAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ChineseAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + // --------------------------------------------------------------------------------------------- + + private ChineseAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + + } + + public static ChineseAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Chinese; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "chinese"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ChineseAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ChineseAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ChineseAnalyzer build() { + _checkSingleUse(); + + return new ChineseAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ChineseAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + ChineseAnalyzer::setupChineseAnalyzerDeserializer); + + protected static void setupChineseAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stopwords"); + op.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CjkAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CjkAnalyzer.java new file mode 100644 index 000000000..bf48d0fe7 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CjkAnalyzer.java @@ -0,0 +1,216 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.CjkAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CjkAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + // --------------------------------------------------------------------------------------------- + + private CjkAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + + } + + public static CjkAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Cjk; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "cjk"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CjkAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CjkAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CjkAnalyzer build() { + _checkSingleUse(); + + return new CjkAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CjkAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + CjkAnalyzer::setupCjkAnalyzerDeserializer); + + protected static void setupCjkAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stopwords"); + op.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CzechAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CzechAnalyzer.java new file mode 100644 index 000000000..9f6ba9e73 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CzechAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.CzechAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CzechAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private CzechAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CzechAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/DanishAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/DanishAnalyzer.java new file mode 100644 index 000000000..c8f6d9137 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/DanishAnalyzer.java @@ -0,0 +1,217 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.DanishAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DanishAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + // --------------------------------------------------------------------------------------------- + + private DanishAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "danish"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DanishAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/DutchAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/DutchAnalyzer.java index 518b1e66a..7148de8c1 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/DutchAnalyzer.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/DutchAnalyzer.java @@ -63,11 +63,18 @@ public class DutchAnalyzer implements AnalyzerVariant, JsonpSerializable { private final List stopwords; + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + // --------------------------------------------------------------------------------------------- private DutchAnalyzer(Builder builder) { this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); } @@ -90,6 +97,21 @@ public final List stopwords() { return this.stopwords; } + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + /** * Serialize this object to JSON. */ @@ -113,6 +135,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } } @@ -131,6 +168,12 @@ public static class Builder extends WithJsonObjectBuilderBase implement @Nullable private List stopwords; + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + /** * API name: {@code stopwords} *

@@ -151,6 +194,34 @@ public final Builder stopwords(String value, String... values) { return this; } + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + @Override protected Builder self() { return this; @@ -181,6 +252,9 @@ protected static void setupDutchAnalyzerDeserializer(ObjectDeserializerAPI + * specification + */ +@JsonpDeserializable +public class EnglishAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private EnglishAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link EnglishAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/EstonianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/EstonianAnalyzer.java new file mode 100644 index 000000000..85227ec6d --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/EstonianAnalyzer.java @@ -0,0 +1,217 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.EstonianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class EstonianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + // --------------------------------------------------------------------------------------------- + + private EstonianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "estonian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link EstonianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/FinnishAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/FinnishAnalyzer.java new file mode 100644 index 000000000..1a5082228 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/FinnishAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.FinnishAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class FinnishAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private FinnishAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link FinnishAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/FrenchAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/FrenchAnalyzer.java new file mode 100644 index 000000000..2101cf9bb --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/FrenchAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.FrenchAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class FrenchAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private FrenchAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link FrenchAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/GalicianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/GalicianAnalyzer.java new file mode 100644 index 000000000..68444dfb0 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/GalicianAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.GalicianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GalicianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private GalicianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GalicianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/GermanAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/GermanAnalyzer.java new file mode 100644 index 000000000..d55757c1c --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/GermanAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.GermanAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GermanAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private GermanAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GermanAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/GreekAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/GreekAnalyzer.java new file mode 100644 index 000000000..d6bc8132d --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/GreekAnalyzer.java @@ -0,0 +1,217 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.GreekAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GreekAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + // --------------------------------------------------------------------------------------------- + + private GreekAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "greek"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GreekAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/HindiAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/HindiAnalyzer.java new file mode 100644 index 000000000..0c0d2ae59 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/HindiAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.HindiAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class HindiAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private HindiAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link HindiAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/HungarianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/HungarianAnalyzer.java new file mode 100644 index 000000000..bfafdc917 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/HungarianAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.HungarianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class HungarianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private HungarianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link HungarianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IndonesianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IndonesianAnalyzer.java new file mode 100644 index 000000000..1d8bba61b --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IndonesianAnalyzer.java @@ -0,0 +1,264 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.IndonesianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndonesianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private IndonesianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndonesianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IrishAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IrishAnalyzer.java new file mode 100644 index 000000000..d7305fc8d --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IrishAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.IrishAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IrishAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private IrishAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IrishAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ItalianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ItalianAnalyzer.java new file mode 100644 index 000000000..c6b1f8aa2 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ItalianAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.ItalianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ItalianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private ItalianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ItalianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/LatvianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/LatvianAnalyzer.java new file mode 100644 index 000000000..d9704dc34 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/LatvianAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.LatvianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class LatvianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private LatvianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link LatvianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/LithuanianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/LithuanianAnalyzer.java new file mode 100644 index 000000000..945665910 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/LithuanianAnalyzer.java @@ -0,0 +1,264 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.LithuanianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class LithuanianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private LithuanianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link LithuanianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NorwegianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NorwegianAnalyzer.java new file mode 100644 index 000000000..a769cb153 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NorwegianAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.NorwegianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class NorwegianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private NorwegianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link NorwegianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PersianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PersianAnalyzer.java new file mode 100644 index 000000000..7f6fcfb2f --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PersianAnalyzer.java @@ -0,0 +1,217 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.PersianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class PersianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + // --------------------------------------------------------------------------------------------- + + private PersianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "persian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PersianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PhoneticTokenFilter.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PhoneticTokenFilter.java index 508311e3c..019fc839c 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PhoneticTokenFilter.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PhoneticTokenFilter.java @@ -66,11 +66,13 @@ public class PhoneticTokenFilter extends TokenFilterBase implements TokenFilterD @Nullable private final Integer maxCodeLen; + @Nullable private final PhoneticNameType nameType; @Nullable private final Boolean replace; + @Nullable private final PhoneticRuleType ruleType; // --------------------------------------------------------------------------------------------- @@ -79,11 +81,11 @@ private PhoneticTokenFilter(Builder builder) { super(builder); this.encoder = ApiTypeHelper.requireNonNull(builder.encoder, this, "encoder"); - this.languageset = ApiTypeHelper.unmodifiableRequired(builder.languageset, this, "languageset"); + this.languageset = ApiTypeHelper.unmodifiable(builder.languageset); this.maxCodeLen = builder.maxCodeLen; - this.nameType = ApiTypeHelper.requireNonNull(builder.nameType, this, "nameType"); + this.nameType = builder.nameType; this.replace = builder.replace; - this.ruleType = ApiTypeHelper.requireNonNull(builder.ruleType, this, "ruleType"); + this.ruleType = builder.ruleType; } @@ -107,7 +109,7 @@ public final PhoneticEncoder encoder() { } /** - * Required - API name: {@code languageset} + * API name: {@code languageset} */ public final List languageset() { return this.languageset; @@ -122,8 +124,9 @@ public final Integer maxCodeLen() { } /** - * Required - API name: {@code name_type} + * API name: {@code name_type} */ + @Nullable public final PhoneticNameType nameType() { return this.nameType; } @@ -137,8 +140,9 @@ public final Boolean replace() { } /** - * Required - API name: {@code rule_type} + * API name: {@code rule_type} */ + @Nullable public final PhoneticRuleType ruleType() { return this.ruleType; } @@ -163,15 +167,19 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.write(this.maxCodeLen); } - generator.writeKey("name_type"); - this.nameType.serialize(generator, mapper); + if (this.nameType != null) { + generator.writeKey("name_type"); + this.nameType.serialize(generator, mapper); + } if (this.replace != null) { generator.writeKey("replace"); generator.write(this.replace); } - generator.writeKey("rule_type"); - this.ruleType.serialize(generator, mapper); + if (this.ruleType != null) { + generator.writeKey("rule_type"); + this.ruleType.serialize(generator, mapper); + } } @@ -186,16 +194,19 @@ public static class Builder extends TokenFilterBase.AbstractBuilder ObjectBuilder { private PhoneticEncoder encoder; + @Nullable private List languageset; @Nullable private Integer maxCodeLen; + @Nullable private PhoneticNameType nameType; @Nullable private Boolean replace; + @Nullable private PhoneticRuleType ruleType; /** @@ -207,7 +218,7 @@ public final Builder encoder(PhoneticEncoder value) { } /** - * Required - API name: {@code languageset} + * API name: {@code languageset} *

* Adds all elements of list to languageset. */ @@ -217,7 +228,7 @@ public final Builder languageset(List list) { } /** - * Required - API name: {@code languageset} + * API name: {@code languageset} *

* Adds one or more values to languageset. */ @@ -235,9 +246,9 @@ public final Builder maxCodeLen(@Nullable Integer value) { } /** - * Required - API name: {@code name_type} + * API name: {@code name_type} */ - public final Builder nameType(PhoneticNameType value) { + public final Builder nameType(@Nullable PhoneticNameType value) { this.nameType = value; return this; } @@ -251,9 +262,9 @@ public final Builder replace(@Nullable Boolean value) { } /** - * Required - API name: {@code rule_type} + * API name: {@code rule_type} */ - public final Builder ruleType(PhoneticRuleType value) { + public final Builder ruleType(@Nullable PhoneticRuleType value) { this.ruleType = value; return this; } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PortugueseAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PortugueseAnalyzer.java new file mode 100644 index 000000000..27c85d66a --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PortugueseAnalyzer.java @@ -0,0 +1,264 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.PortugueseAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class PortugueseAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private PortugueseAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PortugueseAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/RomanianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/RomanianAnalyzer.java new file mode 100644 index 000000000..84a074457 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/RomanianAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.RomanianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class RomanianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private RomanianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link RomanianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/RussianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/RussianAnalyzer.java new file mode 100644 index 000000000..5e872ec82 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/RussianAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.RussianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class RussianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private RussianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link RussianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SerbianAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SerbianAnalyzer.java new file mode 100644 index 000000000..42012a3a5 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SerbianAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.SerbianAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SerbianAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private SerbianAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + public static SerbianAnalyzer of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Analyzer variant kind. + */ + @Override + public Analyzer.Kind _analyzerKind() { + return Analyzer.Kind.Serbian; + } + + /** + * API name: {@code stopwords} + */ + public final List stopwords() { + return this.stopwords; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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", "serbian"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SerbianAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SerbianAnalyzer}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SerbianAnalyzer build() { + _checkSingleUse(); + + return new SerbianAnalyzer(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SerbianAnalyzer} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + SerbianAnalyzer::setupSerbianAnalyzerDeserializer); + + protected static void setupSerbianAnalyzerDeserializer(ObjectDeserializer op) { + + op.add(Builder::stopwords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stopwords"); + op.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SoraniAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SoraniAnalyzer.java new file mode 100644 index 000000000..a56c6f581 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SoraniAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.SoraniAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SoraniAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private SoraniAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SoraniAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SpanishAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SpanishAnalyzer.java new file mode 100644 index 000000000..aa3db52d6 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SpanishAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.SpanishAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SpanishAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private SpanishAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SpanishAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SwedishAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SwedishAnalyzer.java new file mode 100644 index 000000000..230c906ae --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SwedishAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.SwedishAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SwedishAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private SwedishAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SwedishAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ThaiAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ThaiAnalyzer.java new file mode 100644 index 000000000..429fa14aa --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ThaiAnalyzer.java @@ -0,0 +1,216 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.ThaiAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ThaiAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + // --------------------------------------------------------------------------------------------- + + private ThaiAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + serializeInternal(generator, mapper); + generator.writeEnd(); + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + generator.write("type", "thai"); + + if (ApiTypeHelper.isDefined(this.stopwords)) { + generator.writeKey("stopwords"); + generator.writeStartArray(); + for (String item0 : this.stopwords) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ThaiAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TurkishAnalyzer.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TurkishAnalyzer.java new file mode 100644 index 000000000..64b0832ad --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TurkishAnalyzer.java @@ -0,0 +1,262 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch._types.analysis; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: _types.analysis.TurkishAnalyzer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class TurkishAnalyzer implements AnalyzerVariant, JsonpSerializable { + private final List stopwords; + + @Nullable + private final String stopwordsPath; + + private final List stemExclusion; + + // --------------------------------------------------------------------------------------------- + + private TurkishAnalyzer(Builder builder) { + + this.stopwords = ApiTypeHelper.unmodifiable(builder.stopwords); + this.stopwordsPath = builder.stopwordsPath; + this.stemExclusion = ApiTypeHelper.unmodifiable(builder.stemExclusion); + + } + + 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; + } + + /** + * API name: {@code stopwords_path} + */ + @Nullable + public final String stopwordsPath() { + return this.stopwordsPath; + } + + /** + * API name: {@code stem_exclusion} + */ + public final List stemExclusion() { + return this.stemExclusion; + } + + /** + * 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(); + + } + if (this.stopwordsPath != null) { + generator.writeKey("stopwords_path"); + generator.write(this.stopwordsPath); + + } + if (ApiTypeHelper.isDefined(this.stemExclusion)) { + generator.writeKey("stem_exclusion"); + generator.writeStartArray(); + for (String item0 : this.stemExclusion) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link TurkishAnalyzer}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List stopwords; + + @Nullable + private String stopwordsPath; + + @Nullable + private List stemExclusion; + + /** + * API name: {@code stopwords} + *

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

+ * Adds one or more values to stopwords. + */ + public final Builder stopwords(String value, String... values) { + this.stopwords = _listAdd(this.stopwords, value, values); + return this; + } + + /** + * API name: {@code stopwords_path} + */ + public final Builder stopwordsPath(@Nullable String value) { + this.stopwordsPath = value; + return this; + } + + /** + * API name: {@code stem_exclusion} + *

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

+ * Adds one or more values to stemExclusion. + */ + public final Builder stemExclusion(String value, String... values) { + this.stemExclusion = _listAdd(this.stemExclusion, value, values); + return this; + } + + @Override + protected Builder self() { + 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.add(Builder::stopwordsPath, JsonpDeserializer.stringDeserializer(), "stopwords_path"); + op.add(Builder::stemExclusion, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "stem_exclusion"); + + op.ignore("type"); + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/scripts_painless_execute/PainlessContextSetup.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/scripts_painless_execute/PainlessContextSetup.java index 22658f9b7..f97e35159 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/scripts_painless_execute/PainlessContextSetup.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/scripts_painless_execute/PainlessContextSetup.java @@ -66,6 +66,7 @@ public class PainlessContextSetup implements JsonpSerializable { private final String index; + @Nullable private final Query query; // --------------------------------------------------------------------------------------------- @@ -74,7 +75,7 @@ private PainlessContextSetup(Builder builder) { this.document = ApiTypeHelper.requireNonNull(builder.document, this, "document"); this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); - this.query = ApiTypeHelper.requireNonNull(builder.query, this, "query"); + this.query = builder.query; } @@ -104,10 +105,11 @@ public final String index() { } /** - * Required - Use this parameter to specify a query for computing a score. + * Use this parameter to specify a query for computing a score. *

* API name: {@code query} */ + @Nullable public final Query query() { return this.query; } @@ -129,8 +131,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("index"); generator.write(this.index); - generator.writeKey("query"); - this.query.serialize(generator, mapper); + if (this.query != null) { + generator.writeKey("query"); + this.query.serialize(generator, mapper); + + } } @@ -152,6 +157,7 @@ public static class Builder extends WithJsonObjectBuilderBase private String index; + @Nullable private Query query; /** @@ -178,17 +184,17 @@ public final Builder index(String value) { } /** - * Required - Use this parameter to specify a query for computing a score. + * Use this parameter to specify a query for computing a score. *

* API name: {@code query} */ - public final Builder query(Query value) { + public final Builder query(@Nullable Query value) { this.query = value; return this; } /** - * Required - Use this parameter to specify a query for computing a score. + * Use this parameter to specify a query for computing a score. *

* API name: {@code query} */ diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlightField.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlightField.java index 42c469861..188995237 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlightField.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlightField.java @@ -19,7 +19,6 @@ package co.elastic.clients.elasticsearch.core.search; -import co.elastic.clients.elasticsearch._types.analysis.Analyzer; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -65,9 +64,6 @@ public class HighlightField extends HighlightBase { private final List matchedFields; - @Nullable - private final Analyzer analyzer; - // --------------------------------------------------------------------------------------------- private HighlightField(Builder builder) { @@ -75,7 +71,6 @@ private HighlightField(Builder builder) { this.fragmentOffset = builder.fragmentOffset; this.matchedFields = ApiTypeHelper.unmodifiable(builder.matchedFields); - this.analyzer = builder.analyzer; } @@ -98,14 +93,6 @@ public final List matchedFields() { return this.matchedFields; } - /** - * API name: {@code analyzer} - */ - @Nullable - public final Analyzer analyzer() { - return this.analyzer; - } - protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { super.serializeInternal(generator, mapper); @@ -124,11 +111,6 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeEnd(); } - if (this.analyzer != null) { - generator.writeKey("analyzer"); - this.analyzer.serialize(generator, mapper); - - } } @@ -147,9 +129,6 @@ public static class Builder extends HighlightBase.AbstractBuilder @Nullable private List matchedFields; - @Nullable - private Analyzer analyzer; - /** * API name: {@code fragment_offset} */ @@ -178,21 +157,6 @@ public final Builder matchedFields(String value, String... values) { return this; } - /** - * API name: {@code analyzer} - */ - public final Builder analyzer(@Nullable Analyzer value) { - this.analyzer = value; - return this; - } - - /** - * API name: {@code analyzer} - */ - public final Builder analyzer(Function> fn) { - return this.analyzer(fn.apply(new Analyzer.Builder()).build()); - } - @Override protected Builder self() { return this; @@ -224,7 +188,6 @@ protected static void setupHighlightFieldDeserializer(ObjectDeserializer 1) { hash = hash.substring(1); } - window.location = "https://github.com/elastic/elasticsearch-specification/tree/d7c8eb52cfc6467517ab13eaf245d04c5a032019/specification/" + (paths[hash] || ""); + window.location = "https://github.com/elastic/elasticsearch-specification/tree/849b48056b38ca2fd576688e9604a7dad0e77c40/specification/" + (paths[hash] || ""); - Please see the Elasticsearch API specification. + Please see the Elasticsearch API specification. diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DeleteGeoipDatabaseRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DeleteGeoipDatabaseRequest.java new file mode 100644 index 000000000..30bb5db65 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DeleteGeoipDatabaseRequest.java @@ -0,0 +1,288 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch.ingest; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.endpoints.SimpleEndpoint; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: ingest.delete_geoip_database.Request + +/** + * Deletes a geoip database configuration. + * + * @see API + * specification + */ + +public class DeleteGeoipDatabaseRequest extends RequestBase { + private final List id; + + @Nullable + private final Time masterTimeout; + + @Nullable + private final Time timeout; + + // --------------------------------------------------------------------------------------------- + + private DeleteGeoipDatabaseRequest(Builder builder) { + + this.id = ApiTypeHelper.unmodifiable(builder.id); + this.masterTimeout = builder.masterTimeout; + this.timeout = builder.timeout; + + } + + public static DeleteGeoipDatabaseRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * A comma-separated list of geoip database configurations to delete + *

+ * API name: {@code id} + */ + public final List id() { + return this.id; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * Period to wait for a response. If no response is received before the timeout + * expires, the request fails and returns an error. + *

+ * API name: {@code timeout} + */ + @Nullable + public final Time timeout() { + return this.timeout; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteGeoipDatabaseRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private List id; + + @Nullable + private Time masterTimeout; + + @Nullable + private Time timeout; + + /** + * A comma-separated list of geoip database configurations to delete + *

+ * API name: {@code id} + *

+ * Adds all elements of list to id. + */ + public final Builder id(List list) { + this.id = _listAddAll(this.id, list); + return this; + } + + /** + * A comma-separated list of geoip database configurations to delete + *

+ * API name: {@code id} + *

+ * Adds one or more values to id. + */ + public final Builder id(String value, String... values) { + this.id = _listAdd(this.id, value, values); + return this; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Period to wait for a response. If no response is received before the timeout + * expires, the request fails and returns an error. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(@Nullable Time value) { + this.timeout = value; + return this; + } + + /** + * Period to wait for a response. If no response is received before the timeout + * expires, the request fails and returns an error. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(Function> fn) { + return this.timeout(fn.apply(new Time.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteGeoipDatabaseRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteGeoipDatabaseRequest build() { + _checkSingleUse(); + + return new DeleteGeoipDatabaseRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ingest.delete_geoip_database}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/ingest.delete_geoip_database", + + // Request method + request -> { + return "DELETE"; + + }, + + // Request path + request -> { + final int _id = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.id())) + propsSet |= _id; + + if (propsSet == (_id)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_ingest"); + buf.append("/geoip"); + buf.append("/database"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.id.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _id = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.id())) + propsSet |= _id; + + if (propsSet == (_id)) { + params.put("id", request.id.stream().map(v -> v).collect(Collectors.joining(","))); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, DeleteGeoipDatabaseResponse._DESERIALIZER); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DeleteGeoipDatabaseResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DeleteGeoipDatabaseResponse.java new file mode 100644 index 000000000..5f51d1669 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/DeleteGeoipDatabaseResponse.java @@ -0,0 +1,109 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch.ingest; + +import co.elastic.clients.elasticsearch._types.AcknowledgedResponseBase; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: ingest.delete_geoip_database.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DeleteGeoipDatabaseResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private DeleteGeoipDatabaseResponse(Builder builder) { + super(builder); + + } + + public static DeleteGeoipDatabaseResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteGeoipDatabaseResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteGeoipDatabaseResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteGeoipDatabaseResponse build() { + _checkSingleUse(); + + return new DeleteGeoipDatabaseResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeleteGeoipDatabaseResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DeleteGeoipDatabaseResponse::setupDeleteGeoipDatabaseResponseDeserializer); + + protected static void setupDeleteGeoipDatabaseResponseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestAsyncClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestAsyncClient.java index aabf05ae2..c364a4a8c 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestAsyncClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestAsyncClient.java @@ -65,6 +65,52 @@ public ElasticsearchIngestAsyncClient withTransportOptions(@Nullable TransportOp return new ElasticsearchIngestAsyncClient(this.transport, transportOptions); } + // ----- Endpoint: ingest.delete_geoip_database + + /** + * Deletes a geoip database configuration. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture deleteGeoipDatabase(DeleteGeoipDatabaseRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteGeoipDatabaseRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Deletes a geoip database configuration. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteGeoipDatabaseRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture deleteGeoipDatabase( + Function> fn) { + return deleteGeoipDatabase(fn.apply(new DeleteGeoipDatabaseRequest.Builder()).build()); + } + + /** + * Deletes a geoip database configuration. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture deleteGeoipDatabase() { + return this.transport.performRequestAsync(new DeleteGeoipDatabaseRequest.Builder().build(), + DeleteGeoipDatabaseRequest._ENDPOINT, this.transportOptions); + } + // ----- Endpoint: ingest.delete_pipeline /** @@ -112,6 +158,52 @@ public CompletableFuture geoIpStats() { this.transportOptions); } + // ----- Endpoint: ingest.get_geoip_database + + /** + * Returns information about one or more geoip database configurations. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getGeoipDatabase(GetGeoipDatabaseRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetGeoipDatabaseRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns information about one or more geoip database configurations. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetGeoipDatabaseRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture getGeoipDatabase( + Function> fn) { + return getGeoipDatabase(fn.apply(new GetGeoipDatabaseRequest.Builder()).build()); + } + + /** + * Returns information about one or more geoip database configurations. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getGeoipDatabase() { + return this.transport.performRequestAsync(new GetGeoipDatabaseRequest.Builder().build(), + GetGeoipDatabaseRequest._ENDPOINT, this.transportOptions); + } + // ----- Endpoint: ingest.get_pipeline /** diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestClient.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestClient.java index e4c15b13e..36f54b0c7 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestClient.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestClient.java @@ -65,6 +65,54 @@ public ElasticsearchIngestClient withTransportOptions(@Nullable TransportOptions return new ElasticsearchIngestClient(this.transport, transportOptions); } + // ----- Endpoint: ingest.delete_geoip_database + + /** + * Deletes a geoip database configuration. + * + * @see Documentation + * on elastic.co + */ + + public DeleteGeoipDatabaseResponse deleteGeoipDatabase(DeleteGeoipDatabaseRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteGeoipDatabaseRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Deletes a geoip database configuration. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteGeoipDatabaseRequest} + * @see Documentation + * on elastic.co + */ + + public final DeleteGeoipDatabaseResponse deleteGeoipDatabase( + Function> fn) + throws IOException, ElasticsearchException { + return deleteGeoipDatabase(fn.apply(new DeleteGeoipDatabaseRequest.Builder()).build()); + } + + /** + * Deletes a geoip database configuration. + * + * @see Documentation + * on elastic.co + */ + + public DeleteGeoipDatabaseResponse deleteGeoipDatabase() throws IOException, ElasticsearchException { + return this.transport.performRequest(new DeleteGeoipDatabaseRequest.Builder().build(), + DeleteGeoipDatabaseRequest._ENDPOINT, this.transportOptions); + } + // ----- Endpoint: ingest.delete_pipeline /** @@ -114,6 +162,54 @@ public GeoIpStatsResponse geoIpStats() throws IOException, ElasticsearchExceptio this.transportOptions); } + // ----- Endpoint: ingest.get_geoip_database + + /** + * Returns information about one or more geoip database configurations. + * + * @see Documentation + * on elastic.co + */ + + public GetGeoipDatabaseResponse getGeoipDatabase(GetGeoipDatabaseRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetGeoipDatabaseRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns information about one or more geoip database configurations. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetGeoipDatabaseRequest} + * @see Documentation + * on elastic.co + */ + + public final GetGeoipDatabaseResponse getGeoipDatabase( + Function> fn) + throws IOException, ElasticsearchException { + return getGeoipDatabase(fn.apply(new GetGeoipDatabaseRequest.Builder()).build()); + } + + /** + * Returns information about one or more geoip database configurations. + * + * @see Documentation + * on elastic.co + */ + + public GetGeoipDatabaseResponse getGeoipDatabase() throws IOException, ElasticsearchException { + return this.transport.performRequest(new GetGeoipDatabaseRequest.Builder().build(), + GetGeoipDatabaseRequest._ENDPOINT, this.transportOptions); + } + // ----- Endpoint: ingest.get_pipeline /** diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/GetGeoipDatabaseRequest.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/GetGeoipDatabaseRequest.java new file mode 100644 index 000000000..d25608a2e --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/GetGeoipDatabaseRequest.java @@ -0,0 +1,261 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch.ingest; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.endpoints.SimpleEndpoint; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.stream.Collectors; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: ingest.get_geoip_database.Request + +/** + * Returns information about one or more geoip database configurations. + * + * @see API + * specification + */ + +public class GetGeoipDatabaseRequest extends RequestBase { + private final List id; + + @Nullable + private final Time masterTimeout; + + // --------------------------------------------------------------------------------------------- + + private GetGeoipDatabaseRequest(Builder builder) { + + this.id = ApiTypeHelper.unmodifiable(builder.id); + this.masterTimeout = builder.masterTimeout; + + } + + public static GetGeoipDatabaseRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Comma-separated list of database configuration IDs to retrieve. Wildcard + * (*) expressions are supported. To get all database + * configurations, omit this parameter or use *. + *

+ * API name: {@code id} + */ + public final List id() { + return this.id; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetGeoipDatabaseRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private List id; + + @Nullable + private Time masterTimeout; + + /** + * Comma-separated list of database configuration IDs to retrieve. Wildcard + * (*) expressions are supported. To get all database + * configurations, omit this parameter or use *. + *

+ * API name: {@code id} + *

+ * Adds all elements of list to id. + */ + public final Builder id(List list) { + this.id = _listAddAll(this.id, list); + return this; + } + + /** + * Comma-separated list of database configuration IDs to retrieve. Wildcard + * (*) expressions are supported. To get all database + * configurations, omit this parameter or use *. + *

+ * API name: {@code id} + *

+ * Adds one or more values to id. + */ + public final Builder id(String value, String... values) { + this.id = _listAdd(this.id, value, values); + return this; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Period to wait for a connection to the master node. If no response is + * received before the timeout expires, the request fails and returns an error. + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetGeoipDatabaseRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetGeoipDatabaseRequest build() { + _checkSingleUse(); + + return new GetGeoipDatabaseRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code ingest.get_geoip_database}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/ingest.get_geoip_database", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _id = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.id())) + propsSet |= _id; + + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_ingest"); + buf.append("/geoip"); + buf.append("/database"); + return buf.toString(); + } + if (propsSet == (_id)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_ingest"); + buf.append("/geoip"); + buf.append("/database"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.id.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _id = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.id())) + propsSet |= _id; + + if (propsSet == 0) { + } + if (propsSet == (_id)) { + params.put("id", request.id.stream().map(v -> v).collect(Collectors.joining(","))); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, GetGeoipDatabaseResponse._DESERIALIZER); +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/GetGeoipDatabaseResponse.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/GetGeoipDatabaseResponse.java new file mode 100644 index 000000000..022cd766e --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/GetGeoipDatabaseResponse.java @@ -0,0 +1,189 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch.ingest; + +import co.elastic.clients.elasticsearch.ingest.get_geoip_database.DatabaseConfigurationMetadata; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: ingest.get_geoip_database.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GetGeoipDatabaseResponse implements JsonpSerializable { + private final List databases; + + // --------------------------------------------------------------------------------------------- + + private GetGeoipDatabaseResponse(Builder builder) { + + this.databases = ApiTypeHelper.unmodifiableRequired(builder.databases, this, "databases"); + + } + + public static GetGeoipDatabaseResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code databases} + */ + public final List databases() { + return this.databases; + } + + /** + * 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) { + + if (ApiTypeHelper.isDefined(this.databases)) { + generator.writeKey("databases"); + generator.writeStartArray(); + for (DatabaseConfigurationMetadata item0 : this.databases) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetGeoipDatabaseResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private List databases; + + /** + * Required - API name: {@code databases} + *

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

+ * Adds one or more values to databases. + */ + public final Builder databases(DatabaseConfigurationMetadata value, DatabaseConfigurationMetadata... values) { + this.databases = _listAdd(this.databases, value, values); + return this; + } + + /** + * Required - API name: {@code databases} + *

+ * Adds a value to databases using a builder lambda. + */ + public final Builder databases( + Function> fn) { + return databases(fn.apply(new DatabaseConfigurationMetadata.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetGeoipDatabaseResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetGeoipDatabaseResponse build() { + _checkSingleUse(); + + return new GetGeoipDatabaseResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GetGeoipDatabaseResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, GetGeoipDatabaseResponse::setupGetGeoipDatabaseResponseDeserializer); + + protected static void setupGetGeoipDatabaseResponseDeserializer( + ObjectDeserializer op) { + + op.add(Builder::databases, JsonpDeserializer.arrayDeserializer(DatabaseConfigurationMetadata._DESERIALIZER), + "databases"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/geo_ip_stats/GeoIpDownloadStatistics.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/geo_ip_stats/GeoIpDownloadStatistics.java index b0d8dbbf4..470b42f71 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/geo_ip_stats/GeoIpDownloadStatistics.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/geo_ip_stats/GeoIpDownloadStatistics.java @@ -66,10 +66,12 @@ public class GeoIpDownloadStatistics implements JsonpSerializable { private final long totalDownloadTime; - private final int databaseCount; + private final int databasesCount; private final int skippedUpdates; + private final int expiredDatabases; + // --------------------------------------------------------------------------------------------- private GeoIpDownloadStatistics(Builder builder) { @@ -78,8 +80,9 @@ private GeoIpDownloadStatistics(Builder builder) { "successfulDownloads"); this.failedDownloads = ApiTypeHelper.requireNonNull(builder.failedDownloads, this, "failedDownloads"); this.totalDownloadTime = ApiTypeHelper.requireNonNull(builder.totalDownloadTime, this, "totalDownloadTime"); - this.databaseCount = ApiTypeHelper.requireNonNull(builder.databaseCount, this, "databaseCount"); + this.databasesCount = ApiTypeHelper.requireNonNull(builder.databasesCount, this, "databasesCount"); this.skippedUpdates = ApiTypeHelper.requireNonNull(builder.skippedUpdates, this, "skippedUpdates"); + this.expiredDatabases = ApiTypeHelper.requireNonNull(builder.expiredDatabases, this, "expiredDatabases"); } @@ -117,10 +120,10 @@ public final long totalDownloadTime() { /** * Required - Current number of databases available for use. *

- * API name: {@code database_count} + * API name: {@code databases_count} */ - public final int databaseCount() { - return this.databaseCount; + public final int databasesCount() { + return this.databasesCount; } /** @@ -132,6 +135,15 @@ public final int skippedUpdates() { return this.skippedUpdates; } + /** + * Required - Total number of databases not updated after 30 days + *

+ * API name: {@code expired_databases} + */ + public final int expiredDatabases() { + return this.expiredDatabases; + } + /** * Serialize this object to JSON. */ @@ -152,12 +164,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { generator.writeKey("total_download_time"); generator.write(this.totalDownloadTime); - generator.writeKey("database_count"); - generator.write(this.databaseCount); + generator.writeKey("databases_count"); + generator.write(this.databasesCount); generator.writeKey("skipped_updates"); generator.write(this.skippedUpdates); + generator.writeKey("expired_databases"); + generator.write(this.expiredDatabases); + } @Override @@ -180,10 +195,12 @@ public static class Builder extends WithJsonObjectBuilderBase private Long totalDownloadTime; - private Integer databaseCount; + private Integer databasesCount; private Integer skippedUpdates; + private Integer expiredDatabases; + /** * Required - Total number of successful database downloads. *

@@ -217,10 +234,10 @@ public final Builder totalDownloadTime(long value) { /** * Required - Current number of databases available for use. *

- * API name: {@code database_count} + * API name: {@code databases_count} */ - public final Builder databaseCount(int value) { - this.databaseCount = value; + public final Builder databasesCount(int value) { + this.databasesCount = value; return this; } @@ -234,6 +251,16 @@ public final Builder skippedUpdates(int value) { return this; } + /** + * Required - Total number of databases not updated after 30 days + *

+ * API name: {@code expired_databases} + */ + public final Builder expiredDatabases(int value) { + this.expiredDatabases = value; + return this; + } + @Override protected Builder self() { return this; @@ -266,8 +293,9 @@ protected static void setupGeoIpDownloadStatisticsDeserializer( op.add(Builder::successfulDownloads, JsonpDeserializer.integerDeserializer(), "successful_downloads"); op.add(Builder::failedDownloads, JsonpDeserializer.integerDeserializer(), "failed_downloads"); op.add(Builder::totalDownloadTime, JsonpDeserializer.longDeserializer(), "total_download_time"); - op.add(Builder::databaseCount, JsonpDeserializer.integerDeserializer(), "database_count"); + op.add(Builder::databasesCount, JsonpDeserializer.integerDeserializer(), "databases_count"); op.add(Builder::skippedUpdates, JsonpDeserializer.integerDeserializer(), "skipped_updates"); + op.add(Builder::expiredDatabases, JsonpDeserializer.integerDeserializer(), "expired_databases"); } diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/get_geoip_database/DatabaseConfiguration.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/get_geoip_database/DatabaseConfiguration.java new file mode 100644 index 000000000..9b425b11b --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/get_geoip_database/DatabaseConfiguration.java @@ -0,0 +1,187 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch.ingest.get_geoip_database; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: ingest.get_geoip_database.DatabaseConfiguration + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DatabaseConfiguration implements JsonpSerializable { + private final String name; + + private final Maxmind maxmind; + + // --------------------------------------------------------------------------------------------- + + private DatabaseConfiguration(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.maxmind = ApiTypeHelper.requireNonNull(builder.maxmind, this, "maxmind"); + + } + + public static DatabaseConfiguration of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * Required - API name: {@code maxmind} + */ + public final Maxmind maxmind() { + return this.maxmind; + } + + /** + * 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.writeKey("name"); + generator.write(this.name); + + generator.writeKey("maxmind"); + this.maxmind.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DatabaseConfiguration}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private String name; + + private Maxmind maxmind; + + /** + * Required - API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Required - API name: {@code maxmind} + */ + public final Builder maxmind(Maxmind value) { + this.maxmind = value; + return this; + } + + /** + * Required - API name: {@code maxmind} + */ + public final Builder maxmind(Function> fn) { + return this.maxmind(fn.apply(new Maxmind.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DatabaseConfiguration}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DatabaseConfiguration build() { + _checkSingleUse(); + + return new DatabaseConfiguration(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DatabaseConfiguration} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DatabaseConfiguration::setupDatabaseConfigurationDeserializer); + + protected static void setupDatabaseConfigurationDeserializer(ObjectDeserializer op) { + + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::maxmind, Maxmind._DESERIALIZER, "maxmind"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/get_geoip_database/DatabaseConfigurationMetadata.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/get_geoip_database/DatabaseConfigurationMetadata.java new file mode 100644 index 000000000..e60e80755 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/get_geoip_database/DatabaseConfigurationMetadata.java @@ -0,0 +1,238 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch.ingest.get_geoip_database; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Long; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: ingest.get_geoip_database.DatabaseConfigurationMetadata + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DatabaseConfigurationMetadata implements JsonpSerializable { + private final String id; + + private final long version; + + private final long modifiedDateMillis; + + private final DatabaseConfiguration database; + + // --------------------------------------------------------------------------------------------- + + private DatabaseConfigurationMetadata(Builder builder) { + + this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); + this.version = ApiTypeHelper.requireNonNull(builder.version, this, "version"); + this.modifiedDateMillis = ApiTypeHelper.requireNonNull(builder.modifiedDateMillis, this, "modifiedDateMillis"); + this.database = ApiTypeHelper.requireNonNull(builder.database, this, "database"); + + } + + public static DatabaseConfigurationMetadata of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code id} + */ + public final String id() { + return this.id; + } + + /** + * Required - API name: {@code version} + */ + public final long version() { + return this.version; + } + + /** + * Required - API name: {@code modified_date_millis} + */ + public final long modifiedDateMillis() { + return this.modifiedDateMillis; + } + + /** + * Required - API name: {@code database} + */ + public final DatabaseConfiguration database() { + return this.database; + } + + /** + * 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.writeKey("id"); + generator.write(this.id); + + generator.writeKey("version"); + generator.write(this.version); + + generator.writeKey("modified_date_millis"); + generator.write(this.modifiedDateMillis); + + generator.writeKey("database"); + this.database.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DatabaseConfigurationMetadata}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private String id; + + private Long version; + + private Long modifiedDateMillis; + + private DatabaseConfiguration database; + + /** + * Required - API name: {@code id} + */ + public final Builder id(String value) { + this.id = value; + return this; + } + + /** + * Required - API name: {@code version} + */ + public final Builder version(long value) { + this.version = value; + return this; + } + + /** + * Required - API name: {@code modified_date_millis} + */ + public final Builder modifiedDateMillis(long value) { + this.modifiedDateMillis = value; + return this; + } + + /** + * Required - API name: {@code database} + */ + public final Builder database(DatabaseConfiguration value) { + this.database = value; + return this; + } + + /** + * Required - API name: {@code database} + */ + public final Builder database( + Function> fn) { + return this.database(fn.apply(new DatabaseConfiguration.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DatabaseConfigurationMetadata}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DatabaseConfigurationMetadata build() { + _checkSingleUse(); + + return new DatabaseConfigurationMetadata(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DatabaseConfigurationMetadata} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DatabaseConfigurationMetadata::setupDatabaseConfigurationMetadataDeserializer); + + protected static void setupDatabaseConfigurationMetadataDeserializer( + ObjectDeserializer op) { + + op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); + op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); + op.add(Builder::modifiedDateMillis, JsonpDeserializer.longDeserializer(), "modified_date_millis"); + op.add(Builder::database, DatabaseConfiguration._DESERIALIZER, "database"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/get_geoip_database/Maxmind.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/get_geoip_database/Maxmind.java new file mode 100644 index 000000000..f32f95263 --- /dev/null +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ingest/get_geoip_database/Maxmind.java @@ -0,0 +1,154 @@ +/* + * 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. + */ + +package co.elastic.clients.elasticsearch.ingest.get_geoip_database; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +//---------------------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------------------- +// +// This code is generated from the Elasticsearch API specification +// at https://github.com/elastic/elasticsearch-specification +// +// Manual updates to this file will be lost when the code is +// re-generated. +// +// If you find a property that is missing or wrongly typed, please +// open an issue or a PR on the API specification repository. +// +//---------------------------------------------------------------- + +// typedef: ingest.get_geoip_database.Maxmind + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Maxmind implements JsonpSerializable { + private final String accountId; + + // --------------------------------------------------------------------------------------------- + + private Maxmind(Builder builder) { + + this.accountId = ApiTypeHelper.requireNonNull(builder.accountId, this, "accountId"); + + } + + public static Maxmind of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code account_id} + */ + public final String accountId() { + return this.accountId; + } + + /** + * 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.writeKey("account_id"); + generator.write(this.accountId); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Maxmind}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String accountId; + + /** + * Required - API name: {@code account_id} + */ + public final Builder accountId(String value) { + this.accountId = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link Maxmind}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public Maxmind build() { + _checkSingleUse(); + + return new Maxmind(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Maxmind} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Maxmind::setupMaxmindDeserializer); + + protected static void setupMaxmindDeserializer(ObjectDeserializer op) { + + op.add(Builder::accountId, JsonpDeserializer.stringDeserializer(), "account_id"); + + } + +} diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceResponseResult.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceResponseResult.java index 42e6eebe7..1b229c7a3 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceResponseResult.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceResponseResult.java @@ -19,7 +19,7 @@ package co.elastic.clients.elasticsearch.ml; -import co.elastic.clients.json.JsonData; +import co.elastic.clients.elasticsearch._types.FieldValue; import co.elastic.clients.json.JsonpDeserializable; import co.elastic.clients.json.JsonpDeserializer; import co.elastic.clients.json.JsonpMapper; @@ -69,7 +69,7 @@ public class InferenceResponseResult implements JsonpSerializable { @Nullable private final Boolean isTruncated; - private final List predictedValue; + private final List> predictedValue; @Nullable private final String predictedValueSequence; @@ -139,7 +139,7 @@ public final Boolean isTruncated() { *

* API name: {@code predicted_value} */ - public final List predictedValue() { + public final List> predictedValue() { return this.predictedValue; } @@ -233,8 +233,15 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { if (ApiTypeHelper.isDefined(this.predictedValue)) { generator.writeKey("predicted_value"); generator.writeStartArray(); - for (JsonData item0 : this.predictedValue) { - item0.serialize(generator, mapper); + for (List item0 : this.predictedValue) { + generator.writeStartArray(); + if (item0 != null) { + for (FieldValue item1 : item0) { + item1.serialize(generator, mapper); + + } + } + generator.writeEnd(); } generator.writeEnd(); @@ -304,7 +311,7 @@ public static class Builder extends WithJsonObjectBuilderBase private Boolean isTruncated; @Nullable - private List predictedValue; + private List> predictedValue; @Nullable private String predictedValueSequence; @@ -386,7 +393,7 @@ public final Builder isTruncated(@Nullable Boolean value) { *

* Adds all elements of list to predictedValue. */ - public final Builder predictedValue(List list) { + public final Builder predictedValue(List> list) { this.predictedValue = _listAddAll(this.predictedValue, list); return this; } @@ -404,7 +411,7 @@ public final Builder predictedValue(List list) { *

* Adds one or more values to predictedValue. */ - public final Builder predictedValue(JsonData value, JsonData... values) { + public final Builder predictedValue(List value, List... values) { this.predictedValue = _listAdd(this.predictedValue, value, values); return this; } @@ -559,7 +566,9 @@ protected static void setupInferenceResponseResultDeserializer( op.add(Builder::entities, JsonpDeserializer.arrayDeserializer(TrainedModelEntities._DESERIALIZER), "entities"); op.add(Builder::isTruncated, JsonpDeserializer.booleanDeserializer(), "is_truncated"); - op.add(Builder::predictedValue, JsonpDeserializer.arrayDeserializer(JsonData._DESERIALIZER), "predicted_value"); + op.add(Builder::predictedValue, + JsonpDeserializer.arrayDeserializer(JsonpDeserializer.arrayDeserializer(FieldValue._DESERIALIZER)), + "predicted_value"); op.add(Builder::predictedValueSequence, JsonpDeserializer.stringDeserializer(), "predicted_value_sequence"); op.add(Builder::predictionProbability, JsonpDeserializer.doubleDeserializer(), "prediction_probability"); op.add(Builder::predictionScore, JsonpDeserializer.doubleDeserializer(), "prediction_score"); diff --git a/java-client/src/main/java/co/elastic/clients/elasticsearch/query_rules/QueryRuleType.java b/java-client/src/main/java/co/elastic/clients/elasticsearch/query_rules/QueryRuleType.java index 3ee3d4434..c96ecda28 100644 --- a/java-client/src/main/java/co/elastic/clients/elasticsearch/query_rules/QueryRuleType.java +++ b/java-client/src/main/java/co/elastic/clients/elasticsearch/query_rules/QueryRuleType.java @@ -48,6 +48,8 @@ public enum QueryRuleType implements JsonEnum { Pinned("pinned"), + Exclude("exclude"), + ; private final String jsonValue;