From cfb67aecb3064b6b4bf1628130b85c2211317252 Mon Sep 17 00:00:00 2001 From: Sylvain Wallez Date: Fri, 1 Sep 2023 18:16:45 +0200 Subject: [PATCH 1/3] Add initial version of Serverless client --- config/version-serverless.txt | 1 + java-client-serverless/build.gradle.kts | 315 ++ .../clients/transport/VersionInfo.java | 26 + .../java/co/elastic/clients/ApiClient.java | 1 + .../ElasticsearchAsyncClient.java | 1753 ++++++ .../elasticsearch/ElasticsearchClient.java | 1791 ++++++ .../co/elastic/clients/elasticsearch/_helpers | 1 + .../_types/AcknowledgedResponse.java | 27 + .../_types/AcknowledgedResponseBase.java | 118 + .../_types/BulkIndexByScrollFailure.java | 249 + .../clients/elasticsearch/_types/Bytes.java | 61 + .../elasticsearch/_types/ClusterDetails.java | 311 ++ .../_types/ClusterInfoTarget.java | 61 + .../_types/ClusterSearchStatusEnum.java | 61 + .../_types/ClusterStatistics.java | 247 + .../elasticsearch/_types/CompletionStats.java | 240 + .../elasticsearch/_types/Conflicts.java | 61 + .../elasticsearch/_types/CoordsGeoBounds.java | 213 + .../_types/DFIIndependenceMeasure.java | 57 + .../elasticsearch/_types/DFRAfterEffect.java | 57 + .../elasticsearch/_types/DFRBasicModel.java | 65 + .../elasticsearch/_types/DistanceUnit.java | 69 + .../elasticsearch/_types/DocStats.java | 190 + .../_types/ElasticsearchException.java | 69 + .../_types/ElasticsearchVersionInfo.java | 342 ++ .../elasticsearch/_types/EmptyObject.java | 65 + .../elasticsearch/_types/ErrorCause.java | 414 ++ .../elasticsearch/_types/ErrorResponse.java | 175 + .../elasticsearch/_types/ExpandWildcard.java | 78 + .../_types/FieldMemoryUsage.java | 172 + .../elasticsearch/_types/FieldSizeUsage.java | 172 + .../elasticsearch/_types/FieldSort.java | 393 ++ .../_types/FieldSortNumericType.java | 59 + .../elasticsearch/_types/FieldValue.java | 316 ++ .../elasticsearch/_types/FielddataStats.java | 258 + .../elasticsearch/_types/GeoBounds.java | 239 + .../_types/GeoBoundsBuilders.java | 67 + .../elasticsearch/_types/GeoDistanceSort.java | 339 ++ .../elasticsearch/_types/GeoDistanceType.java | 61 + .../elasticsearch/_types/GeoHashLocation.java | 142 + .../_types/GeoHashPrecision.java | 193 + .../_types/GeoHashPrecisionBuilders.java | 41 + .../clients/elasticsearch/_types/GeoLine.java | 207 + .../elasticsearch/_types/GeoLocation.java | 252 + .../_types/GeoLocationBuilders.java | 58 + .../_types/GeoShapeRelation.java | 75 + .../elasticsearch/_types/HealthStatus.java | 75 + .../elasticsearch/_types/IBDistribution.java | 55 + .../elasticsearch/_types/IBLambda.java | 54 + .../elasticsearch/_types/IndicesOptions.java | 290 + .../_types/IndicesResponseBase.java | 109 + .../elasticsearch/_types/InlineGet.java | 381 ++ .../elasticsearch/_types/InlineScript.java | 223 + .../elasticsearch/_types/KnnQuery.java | 398 ++ .../_types/LatLonGeoLocation.java | 173 + .../elasticsearch/_types/NestedSortValue.java | 245 + .../elasticsearch/_types/NodeStatistics.java | 261 + .../elasticsearch/_types/Normalization.java | 61 + .../clients/elasticsearch/_types/OpType.java | 59 + .../elasticsearch/_types/PluginStats.java | 358 ++ .../elasticsearch/_types/QueryCacheStats.java | 365 ++ .../_types/QueryVectorBuilder.java | 183 + .../_types/QueryVectorBuilderBuilders.java | 54 + .../_types/QueryVectorBuilderVariant.java | 37 + .../clients/elasticsearch/_types/Rank.java | 180 + .../elasticsearch/_types/RankBase.java | 54 + .../elasticsearch/_types/RankBuilders.java | 52 + .../elasticsearch/_types/RankVariant.java | 37 + .../clients/elasticsearch/_types/Refresh.java | 70 + .../elasticsearch/_types/RequestBase.java | 94 + .../clients/elasticsearch/_types/Result.java | 59 + .../clients/elasticsearch/_types/Retries.java | 165 + .../clients/elasticsearch/_types/RrfRank.java | 193 + .../elasticsearch/_types/ScoreSort.java | 153 + .../clients/elasticsearch/_types/Script.java | 173 + .../elasticsearch/_types/ScriptBase.java | 146 + .../elasticsearch/_types/ScriptBuilders.java | 51 + .../elasticsearch/_types/ScriptField.java | 179 + .../elasticsearch/_types/ScriptLanguage.java | 71 + .../elasticsearch/_types/ScriptSort.java | 277 + .../elasticsearch/_types/ScriptSortType.java | 57 + .../elasticsearch/_types/SearchType.java | 63 + .../elasticsearch/_types/SegmentsStats.java | 935 ++++ .../elasticsearch/_types/ShardFailure.java | 262 + .../elasticsearch/_types/ShardStatistics.java | 282 + .../elasticsearch/_types/SlicedScroll.java | 196 + .../clients/elasticsearch/_types/Slices.java | 186 + .../elasticsearch/_types/SlicesBuilders.java | 40 + .../_types/SlicesCalculation.java | 57 + .../elasticsearch/_types/SortMode.java | 60 + .../elasticsearch/_types/SortOptions.java | 338 ++ .../_types/SortOptionsBuilders.java | 125 + .../_types/SortOptionsVariant.java | 37 + .../elasticsearch/_types/SortOrder.java | 61 + .../elasticsearch/_types/StoreStats.java | 322 ++ .../elasticsearch/_types/StoredScript.java | 231 + .../elasticsearch/_types/StoredScriptId.java | 131 + .../elasticsearch/_types/SuggestMode.java | 67 + .../elasticsearch/_types/TextEmbedding.java | 174 + .../clients/elasticsearch/_types/Time.java | 195 + .../elasticsearch/_types/TimeBuilders.java | 40 + .../elasticsearch/_types/TimeUnit.java | 64 + .../_types/TopLeftBottomRightGeoBounds.java | 183 + .../_types/TopRightBottomLeftGeoBounds.java | 183 + .../elasticsearch/_types/VersionType.java | 73 + .../_types/WaitForActiveShardOptions.java | 56 + .../_types/WaitForActiveShards.java | 186 + .../_types/WaitForActiveShardsBuilders.java | 41 + .../elasticsearch/_types/WktGeoBounds.java | 142 + .../_types/WriteResponseBase.java | 296 + .../AdjacencyMatrixAggregate.java | 108 + .../AdjacencyMatrixAggregation.java | 180 + .../aggregations/AdjacencyMatrixBucket.java | 130 + .../_types/aggregations/Aggregate.java | 2347 ++++++++ .../_types/aggregations/AggregateBase.java | 138 + .../aggregations/AggregateBuilders.java | 1309 +++++ .../_types/aggregations/AggregateVariant.java | 37 + .../_types/aggregations/Aggregation.java | 2711 +++++++++ .../_types/aggregations/AggregationBase.java | 167 + .../aggregations/AggregationBuilders.java | 1439 +++++ .../_types/aggregations/AggregationRange.java | 218 + .../aggregations/AggregationVariant.java | 37 + .../aggregations/ArrayPercentilesItem.java | 203 + .../AutoDateHistogramAggregate.java | 149 + .../AutoDateHistogramAggregation.java | 441 ++ .../aggregations/AverageAggregation.java | 104 + .../AverageBucketAggregation.java | 105 + .../_types/aggregations/AvgAggregate.java | 104 + .../_types/aggregations/BoxPlotAggregate.java | 487 ++ .../aggregations/BoxplotAggregation.java | 151 + .../aggregations/BucketAggregationBase.java | 66 + .../BucketCorrelationAggregation.java | 154 + .../BucketCorrelationFunction.java | 165 + ...etCorrelationFunctionCountCorrelation.java | 164 + ...tionFunctionCountCorrelationIndicator.java | 275 + .../aggregations/BucketKsAggregation.java | 303 ++ .../BucketMetricValueAggregate.java | 160 + .../aggregations/BucketPathAggregation.java | 116 + .../aggregations/BucketScriptAggregation.java | 157 + .../BucketSelectorAggregation.java | 157 + .../aggregations/BucketSortAggregation.java | 278 + .../_types/aggregations/Buckets.java | 196 + .../_types/aggregations/BucketsBuilders.java | 41 + .../_types/aggregations/BucketsPath.java | 223 + .../aggregations/BucketsPathBuilders.java | 42 + .../_types/aggregations/CalendarInterval.java | 74 + .../aggregations/CardinalityAggregate.java | 137 + .../aggregations/CardinalityAggregation.java | 212 + .../CardinalityExecutionMode.java | 79 + .../CategorizeTextAggregation.java | 541 ++ .../aggregations/CategorizeTextAnalyzer.java | 180 + .../CategorizeTextAnalyzerBuilders.java | 48 + .../aggregations/ChiSquareHeuristic.java | 183 + .../aggregations/ChildrenAggregate.java | 104 + .../aggregations/ChildrenAggregation.java | 147 + .../aggregations/CompositeAggregate.java | 172 + .../aggregations/CompositeAggregation.java | 281 + .../CompositeAggregationBase.java | 282 + .../CompositeAggregationSource.java | 293 + .../_types/aggregations/CompositeBucket.java | 162 + .../CompositeDateHistogramAggregation.java | 293 + .../CompositeGeoTileGridAggregation.java | 174 + .../CompositeHistogramAggregation.java | 130 + .../CompositeTermsAggregation.java | 97 + .../CumulativeCardinalityAggregate.java | 172 + .../CumulativeCardinalityAggregation.java | 106 + .../CumulativeSumAggregation.java | 105 + .../CustomCategorizeTextAnalyzer.java | 242 + .../aggregations/DateHistogramAggregate.java | 106 + .../DateHistogramAggregation.java | 742 +++ .../aggregations/DateHistogramBucket.java | 160 + .../aggregations/DateRangeAggregate.java | 108 + .../aggregations/DateRangeAggregation.java | 404 ++ .../aggregations/DateRangeExpression.java | 238 + .../aggregations/DerivativeAggregate.java | 173 + .../aggregations/DerivativeAggregation.java | 104 + .../DiversifiedSamplerAggregation.java | 286 + .../aggregations/DoubleTermsAggregate.java | 107 + .../aggregations/DoubleTermsBucket.java | 161 + .../aggregations/EwmaModelSettings.java | 148 + .../EwmaMovingAverageAggregation.java | 149 + .../_types/aggregations/ExtendedBounds.java | 207 + .../aggregations/ExtendedStatsAggregate.java | 543 ++ .../ExtendedStatsAggregation.java | 148 + .../ExtendedStatsBucketAggregate.java | 105 + .../ExtendedStatsBucketAggregation.java | 149 + .../_types/aggregations/FieldDateMath.java | 194 + .../aggregations/FieldDateMathBuilders.java | 40 + .../_types/aggregations/FilterAggregate.java | 104 + .../_types/aggregations/FiltersAggregate.java | 105 + .../aggregations/FiltersAggregation.java | 261 + .../_types/aggregations/FiltersBucket.java | 96 + .../FormatMetricAggregationBase.java | 103 + .../FormattableMetricAggregation.java | 103 + .../FrequentItemSetsAggregate.java | 108 + .../FrequentItemSetsAggregation.java | 335 ++ .../aggregations/FrequentItemSetsBucket.java | 186 + .../aggregations/FrequentItemSetsField.java | 255 + .../_types/aggregations/GapPolicy.java | 70 + .../aggregations/GeoBoundsAggregate.java | 150 + .../aggregations/GeoBoundsAggregation.java | 149 + .../aggregations/GeoCentroidAggregate.java | 176 + .../aggregations/GeoCentroidAggregation.java | 181 + .../aggregations/GeoDistanceAggregate.java | 106 + .../aggregations/GeoDistanceAggregation.java | 320 ++ .../aggregations/GeoHashGridAggregate.java | 105 + .../aggregations/GeoHashGridAggregation.java | 312 ++ .../aggregations/GeoHashGridBucket.java | 130 + .../aggregations/GeoHexGridAggregate.java | 105 + .../_types/aggregations/GeoHexGridBucket.java | 130 + .../_types/aggregations/GeoLineAggregate.java | 195 + .../aggregations/GeoLineAggregation.java | 317 ++ .../_types/aggregations/GeoLinePoint.java | 147 + .../_types/aggregations/GeoLineSort.java | 149 + .../aggregations/GeoTileGridAggregate.java | 105 + .../aggregations/GeoTileGridAggregation.java | 312 ++ .../aggregations/GeoTileGridBucket.java | 130 + .../aggregations/GeohexGridAggregation.java | 292 + .../_types/aggregations/GlobalAggregate.java | 104 + .../aggregations/GlobalAggregation.java | 104 + .../GoogleNormalizedDistanceHeuristic.java | 158 + .../_types/aggregations/HdrMethod.java | 155 + .../HdrPercentileRanksAggregate.java | 105 + .../aggregations/HdrPercentilesAggregate.java | 105 + .../aggregations/HistogramAggregate.java | 105 + .../aggregations/HistogramAggregation.java | 559 ++ .../_types/aggregations/HistogramBucket.java | 160 + .../aggregations/HoltLinearModelSettings.java | 180 + .../HoltMovingAverageAggregation.java | 150 + .../HoltWintersModelSettings.java | 297 + .../HoltWintersMovingAverageAggregation.java | 152 + .../_types/aggregations/HoltWintersType.java | 56 + .../aggregations/InferenceAggregate.java | 370 ++ .../aggregations/InferenceAggregation.java | 185 + .../InferenceClassImportance.java | 171 + .../_types/aggregations/InferenceConfig.java | 216 + .../aggregations/InferenceConfigBuilders.java | 76 + .../aggregations/InferenceConfigVariant.java | 37 + .../InferenceFeatureImportance.java | 233 + .../aggregations/InferenceTopClassEntry.java | 234 + .../aggregations/IpPrefixAggregate.java | 105 + .../aggregations/IpPrefixAggregation.java | 316 ++ .../_types/aggregations/IpPrefixBucket.java | 210 + .../_types/aggregations/IpRangeAggregate.java | 105 + .../aggregations/IpRangeAggregation.java | 211 + .../aggregations/IpRangeAggregationRange.java | 221 + .../_types/aggregations/IpRangeBucket.java | 193 + .../LinearMovingAverageAggregation.java | 151 + .../aggregations/LongRareTermsAggregate.java | 108 + .../aggregations/LongRareTermsBucket.java | 161 + .../aggregations/LongTermsAggregate.java | 107 + .../_types/aggregations/LongTermsBucket.java | 161 + .../aggregations/MatrixAggregation.java | 184 + .../aggregations/MatrixStatsAggregate.java | 193 + .../aggregations/MatrixStatsAggregation.java | 147 + .../aggregations/MatrixStatsFields.java | 357 ++ .../_types/aggregations/MaxAggregate.java | 104 + .../_types/aggregations/MaxAggregation.java | 104 + .../aggregations/MaxBucketAggregation.java | 104 + .../MedianAbsoluteDeviationAggregate.java | 106 + .../MedianAbsoluteDeviationAggregation.java | 154 + .../aggregations/MetricAggregationBase.java | 251 + .../_types/aggregations/MinAggregate.java | 104 + .../_types/aggregations/MinAggregation.java | 104 + .../aggregations/MinBucketAggregation.java | 104 + .../_types/aggregations/MinimumInterval.java | 64 + .../_types/aggregations/MissingAggregate.java | 104 + .../aggregations/MissingAggregation.java | 216 + .../_types/aggregations/MissingOrder.java | 58 + .../MovingAverageAggregation.java | 305 ++ .../MovingAverageAggregationBase.java | 162 + .../MovingAverageAggregationBuilders.java | 134 + .../MovingAverageAggregationVariant.java | 39 + .../MovingFunctionAggregation.java | 219 + .../MovingPercentilesAggregation.java | 215 + .../MultiBucketAggregateBase.java | 122 + .../_types/aggregations/MultiBucketBase.java | 172 + .../_types/aggregations/MultiTermLookup.java | 238 + .../aggregations/MultiTermsAggregate.java | 105 + .../aggregations/MultiTermsAggregation.java | 440 ++ .../_types/aggregations/MultiTermsBucket.java | 220 + .../MutualInformationHeuristic.java | 192 + .../_types/aggregations/NestedAggregate.java | 104 + .../aggregations/NestedAggregation.java | 147 + .../aggregations/NormalizeAggregation.java | 145 + .../_types/aggregations/NormalizeMethod.java | 88 + .../_types/aggregations/ParentAggregate.java | 104 + .../aggregations/ParentAggregation.java | 147 + .../PercentageScoreHeuristic.java | 65 + .../PercentileRanksAggregation.java | 295 + .../_types/aggregations/Percentiles.java | 193 + .../PercentilesAggregateBase.java | 105 + .../aggregations/PercentilesAggregation.java | 296 + .../PercentilesBucketAggregate.java | 105 + .../PercentilesBucketAggregation.java | 168 + .../aggregations/PercentilesBuilders.java | 42 + .../aggregations/PipelineAggregationBase.java | 143 + .../_types/aggregations/RangeAggregate.java | 112 + .../_types/aggregations/RangeAggregation.java | 348 ++ .../_types/aggregations/RangeBucket.java | 254 + .../aggregations/RareTermsAggregation.java | 420 ++ .../_types/aggregations/RateAggregate.java | 167 + .../_types/aggregations/RateAggregation.java | 179 + .../_types/aggregations/RateMode.java | 60 + .../aggregations/ReverseNestedAggregate.java | 105 + .../ReverseNestedAggregation.java | 150 + .../_types/aggregations/SamplerAggregate.java | 104 + .../aggregations/SamplerAggregation.java | 149 + .../SamplerAggregationExecutionHint.java | 67 + .../aggregations/ScriptedHeuristic.java | 150 + .../aggregations/ScriptedMetricAggregate.java | 139 + .../ScriptedMetricAggregation.java | 365 ++ .../SerialDifferencingAggregation.java | 150 + .../SignificantLongTermsAggregate.java | 111 + .../SignificantLongTermsBucket.java | 162 + .../SignificantStringTermsAggregate.java | 112 + .../SignificantStringTermsBucket.java | 131 + .../SignificantTermsAggregateBase.java | 149 + .../SignificantTermsAggregation.java | 726 +++ .../SignificantTermsBucketBase.java | 122 + .../SignificantTextAggregation.java | 825 +++ .../SimpleMovingAverageAggregation.java | 151 + .../aggregations/SimpleValueAggregate.java | 104 + .../SingleBucketAggregateBase.java | 155 + .../SingleMetricAggregateBase.java | 139 + .../aggregations/StandardDeviationBounds.java | 284 + .../StandardDeviationBoundsAsString.java | 267 + .../_types/aggregations/StatsAggregate.java | 377 ++ .../_types/aggregations/StatsAggregation.java | 104 + .../aggregations/StatsBucketAggregate.java | 104 + .../aggregations/StatsBucketAggregation.java | 105 + .../StringRareTermsAggregate.java | 109 + .../aggregations/StringRareTermsBucket.java | 130 + .../aggregations/StringStatsAggregate.java | 385 ++ .../aggregations/StringStatsAggregation.java | 148 + .../aggregations/StringTermsAggregate.java | 106 + .../aggregations/StringTermsBucket.java | 169 + .../_types/aggregations/SumAggregate.java | 106 + .../_types/aggregations/SumAggregation.java | 104 + .../aggregations/SumBucketAggregation.java | 104 + .../_types/aggregations/TDigest.java | 155 + .../TDigestPercentileRanksAggregate.java | 106 + .../TDigestPercentilesAggregate.java | 105 + .../_types/aggregations/TTestAggregate.java | 173 + .../_types/aggregations/TTestAggregation.java | 229 + .../_types/aggregations/TTestType.java | 67 + .../aggregations/TermsAggregateBase.java | 133 + .../_types/aggregations/TermsAggregation.java | 760 +++ .../TermsAggregationCollectMode.java | 64 + .../TermsAggregationExecutionHint.java | 60 + .../_types/aggregations/TermsBucketBase.java | 103 + .../_types/aggregations/TermsExclude.java | 198 + .../aggregations/TermsExcludeBuilders.java | 42 + .../_types/aggregations/TermsInclude.java | 214 + .../aggregations/TermsIncludeBuilders.java | 50 + .../_types/aggregations/TermsPartition.java | 174 + .../_types/aggregations/TestPopulation.java | 228 + .../_types/aggregations/TopHitsAggregate.java | 146 + .../aggregations/TopHitsAggregation.java | 647 +++ .../_types/aggregations/TopMetrics.java | 228 + .../aggregations/TopMetricsAggregate.java | 167 + .../aggregations/TopMetricsAggregation.java | 272 + .../_types/aggregations/TopMetricsValue.java | 147 + .../UnmappedRareTermsAggregate.java | 109 + .../UnmappedSamplerAggregate.java | 105 + .../UnmappedSignificantTermsAggregate.java | 111 + .../aggregations/UnmappedTermsAggregate.java | 109 + .../aggregations/ValueCountAggregate.java | 105 + .../aggregations/ValueCountAggregation.java | 104 + .../_types/aggregations/ValueType.java | 72 + .../VariableWidthHistogramAggregate.java | 110 + .../VariableWidthHistogramAggregation.java | 270 + .../VariableWidthHistogramBucket.java | 268 + .../WeightedAverageAggregation.java | 260 + .../aggregations/WeightedAverageValue.java | 225 + .../aggregations/WeightedAvgAggregate.java | 106 + .../_types/analysis/Analyzer.java | 637 +++ .../_types/analysis/AnalyzerBuilders.java | 284 + .../_types/analysis/AnalyzerVariant.java | 39 + .../analysis/AsciiFoldingTokenFilter.java | 146 + .../_types/analysis/CharFilter.java | 179 + .../_types/analysis/CharFilterBase.java | 119 + .../_types/analysis/CharFilterBuilders.java | 48 + .../_types/analysis/CharFilterDefinition.java | 373 ++ .../CharFilterDefinitionBuilders.java | 131 + .../analysis/CharFilterDefinitionVariant.java | 39 + .../_types/analysis/CharGroupTokenizer.java | 192 + .../analysis/CommonGramsTokenFilter.java | 252 + .../analysis/CompoundWordTokenFilterBase.java | 298 + .../_types/analysis/ConditionTokenFilter.java | 192 + .../_types/analysis/CustomAnalyzer.java | 303 ++ .../_types/analysis/CustomNormalizer.java | 221 + .../analysis/DelimitedPayloadEncoding.java | 58 + .../analysis/DelimitedPayloadTokenFilter.java | 174 + .../DictionaryDecompounderTokenFilter.java | 117 + .../_types/analysis/DutchAnalyzer.java | 177 + .../_types/analysis/EdgeNGramSide.java | 56 + .../_types/analysis/EdgeNGramTokenFilter.java | 232 + .../_types/analysis/EdgeNGramTokenizer.java | 238 + .../_types/analysis/ElisionTokenFilter.java | 222 + .../_types/analysis/FingerprintAnalyzer.java | 311 ++ .../analysis/FingerprintTokenFilter.java | 176 + .../_types/analysis/HtmlStripCharFilter.java | 113 + .../_types/analysis/HunspellTokenFilter.java | 229 + .../HyphenationDecompounderTokenFilter.java | 118 + .../_types/analysis/IcuAnalyzer.java | 175 + .../analysis/IcuCollationAlternate.java | 56 + .../analysis/IcuCollationCaseFirst.java | 56 + .../analysis/IcuCollationDecomposition.java | 56 + .../_types/analysis/IcuCollationStrength.java | 62 + .../analysis/IcuCollationTokenFilter.java | 462 ++ .../analysis/IcuFoldingTokenFilter.java | 140 + .../analysis/IcuNormalizationCharFilter.java | 172 + .../_types/analysis/IcuNormalizationMode.java | 56 + .../analysis/IcuNormalizationTokenFilter.java | 140 + .../_types/analysis/IcuNormalizationType.java | 58 + .../_types/analysis/IcuTokenizer.java | 145 + .../analysis/IcuTransformDirection.java | 56 + .../analysis/IcuTransformTokenFilter.java | 169 + .../_types/analysis/KStemTokenFilter.java | 113 + .../_types/analysis/KeepTypesMode.java | 56 + .../_types/analysis/KeepTypesTokenFilter.java | 190 + .../_types/analysis/KeepWordsTokenFilter.java | 222 + .../_types/analysis/KeywordAnalyzer.java | 159 + .../analysis/KeywordMarkerTokenFilter.java | 252 + .../_types/analysis/KeywordTokenizer.java | 139 + .../_types/analysis/KuromojiAnalyzer.java | 183 + .../KuromojiIterationMarkCharFilter.java | 165 + .../KuromojiPartOfSpeechTokenFilter.java | 164 + .../KuromojiReadingFormTokenFilter.java | 141 + .../analysis/KuromojiStemmerTokenFilter.java | 140 + .../analysis/KuromojiTokenizationMode.java | 58 + .../_types/analysis/KuromojiTokenizer.java | 333 ++ .../_types/analysis/Language.java | 118 + .../_types/analysis/LanguageAnalyzer.java | 302 ++ .../_types/analysis/LengthTokenFilter.java | 174 + .../_types/analysis/LetterTokenizer.java | 113 + .../analysis/LimitTokenCountTokenFilter.java | 176 + .../_types/analysis/LowercaseNormalizer.java | 127 + .../_types/analysis/LowercaseTokenFilter.java | 145 + .../_types/analysis/LowercaseTokenizer.java | 113 + .../_types/analysis/MappingCharFilter.java | 192 + .../analysis/MultiplexerTokenFilter.java | 193 + .../_types/analysis/NGramTokenFilter.java | 204 + .../_types/analysis/NGramTokenizer.java | 238 + .../_types/analysis/NoriAnalyzer.java | 262 + .../_types/analysis/NoriDecompoundMode.java | 58 + .../analysis/NoriPartOfSpeechTokenFilter.java | 164 + .../_types/analysis/NoriTokenizer.java | 248 + .../_types/analysis/Normalizer.java | 208 + .../_types/analysis/NormalizerBuilders.java | 72 + .../_types/analysis/NormalizerVariant.java | 39 + .../analysis/PathHierarchyTokenizer.java | 239 + .../_types/analysis/PatternAnalyzer.java | 289 + .../analysis/PatternCaptureTokenFilter.java | 193 + .../analysis/PatternReplaceCharFilter.java | 200 + .../analysis/PatternReplaceTokenFilter.java | 230 + .../_types/analysis/PatternTokenizer.java | 204 + .../_types/analysis/PhoneticEncoder.java | 76 + .../_types/analysis/PhoneticLanguage.java | 76 + .../_types/analysis/PhoneticNameType.java | 58 + .../_types/analysis/PhoneticRuleType.java | 56 + .../_types/analysis/PhoneticTokenFilter.java | 289 + .../analysis/PorterStemTokenFilter.java | 113 + .../_types/analysis/PredicateTokenFilter.java | 147 + .../analysis/RemoveDuplicatesTokenFilter.java | 114 + .../_types/analysis/ReverseTokenFilter.java | 113 + .../_types/analysis/ShingleTokenFilter.java | 292 + .../_types/analysis/SimpleAnalyzer.java | 159 + .../_types/analysis/SnowballAnalyzer.java | 229 + .../_types/analysis/SnowballLanguage.java | 96 + .../_types/analysis/SnowballTokenFilter.java | 139 + .../_types/analysis/StandardAnalyzer.java | 207 + .../_types/analysis/StandardTokenizer.java | 145 + .../analysis/StemmerOverrideTokenFilter.java | 192 + .../_types/analysis/StemmerTokenFilter.java | 145 + .../_types/analysis/StopAnalyzer.java | 234 + .../_types/analysis/StopTokenFilter.java | 251 + .../_types/analysis/SynonymFormat.java | 56 + .../analysis/SynonymGraphTokenFilter.java | 338 ++ .../_types/analysis/SynonymTokenFilter.java | 337 ++ .../_types/analysis/TokenChar.java | 63 + .../_types/analysis/TokenFilter.java | 179 + .../_types/analysis/TokenFilterBase.java | 119 + .../_types/analysis/TokenFilterBuilders.java | 48 + .../analysis/TokenFilterDefinition.java | 1718 ++++++ .../TokenFilterDefinitionBuilders.java | 945 ++++ .../TokenFilterDefinitionVariant.java | 39 + .../_types/analysis/Tokenizer.java | 179 + .../_types/analysis/TokenizerBase.java | 119 + .../_types/analysis/TokenizerBuilders.java | 48 + .../_types/analysis/TokenizerDefinition.java | 650 +++ .../analysis/TokenizerDefinitionBuilders.java | 296 + .../analysis/TokenizerDefinitionVariant.java | 39 + .../_types/analysis/TrimTokenFilter.java | 113 + .../_types/analysis/TruncateTokenFilter.java | 145 + .../_types/analysis/UaxEmailUrlTokenizer.java | 145 + .../_types/analysis/UniqueTokenFilter.java | 145 + .../_types/analysis/UppercaseTokenFilter.java | 113 + .../_types/analysis/WhitespaceAnalyzer.java | 161 + .../_types/analysis/WhitespaceTokenizer.java | 145 + .../WordDelimiterGraphTokenFilter.java | 587 ++ .../analysis/WordDelimiterTokenFilter.java | 529 ++ .../AggregateMetricDoubleProperty.java | 215 + .../_types/mapping/AllField.java | 363 ++ .../_types/mapping/BinaryProperty.java | 113 + .../_types/mapping/BooleanProperty.java | 241 + .../_types/mapping/ByteNumberProperty.java | 145 + .../_types/mapping/CompletionProperty.java | 319 ++ .../mapping/ConstantKeywordProperty.java | 146 + .../_types/mapping/CorePropertyBase.java | 180 + .../_types/mapping/DataStreamTimestamp.java | 144 + .../_types/mapping/DateNanosProperty.java | 293 + .../_types/mapping/DateProperty.java | 358 ++ .../_types/mapping/DateRangeProperty.java | 145 + .../mapping/DenseVectorIndexOptions.java | 195 + .../_types/mapping/DenseVectorProperty.java | 238 + .../_types/mapping/DocValuesPropertyBase.java | 103 + .../_types/mapping/DoubleNumberProperty.java | 145 + .../_types/mapping/DoubleRangeProperty.java | 113 + .../_types/mapping/DynamicMapping.java | 73 + .../_types/mapping/DynamicProperty.java | 808 +++ .../_types/mapping/DynamicTemplate.java | 328 ++ .../_types/mapping/FieldAliasProperty.java | 145 + .../_types/mapping/FieldNamesField.java | 142 + .../_types/mapping/FieldType.java | 135 + .../_types/mapping/FlattenedProperty.java | 380 ++ .../_types/mapping/FloatNumberProperty.java | 145 + .../_types/mapping/FloatRangeProperty.java | 113 + .../_types/mapping/GeoOrientation.java | 62 + .../_types/mapping/GeoPointProperty.java | 211 + .../_types/mapping/GeoShapeProperty.java | 264 + .../_types/mapping/GeoStrategy.java | 55 + .../mapping/HalfFloatNumberProperty.java | 146 + .../_types/mapping/HistogramProperty.java | 145 + .../_types/mapping/IndexField.java | 141 + .../_types/mapping/IndexOptions.java | 59 + .../_types/mapping/IntegerNumberProperty.java | 145 + .../_types/mapping/IntegerRangeProperty.java | 113 + .../_types/mapping/IpProperty.java | 333 ++ .../_types/mapping/IpRangeProperty.java | 113 + .../_types/mapping/JoinProperty.java | 199 + .../_types/mapping/KeywordProperty.java | 385 ++ .../_types/mapping/LongNumberProperty.java | 145 + .../_types/mapping/LongRangeProperty.java | 113 + .../_types/mapping/MatchOnlyTextProperty.java | 320 ++ .../_types/mapping/MatchType.java | 55 + .../_types/mapping/Murmur3HashProperty.java | 113 + .../_types/mapping/NestedProperty.java | 203 + .../_types/mapping/NumberPropertyBase.java | 326 ++ .../_types/mapping/ObjectProperty.java | 145 + .../_types/mapping/OnScriptError.java | 55 + .../_types/mapping/PercolatorProperty.java | 113 + .../_types/mapping/PointProperty.java | 203 + .../_types/mapping/Property.java | 1629 ++++++ .../_types/mapping/PropertyBase.java | 311 ++ .../_types/mapping/PropertyBuilders.java | 865 +++ .../_types/mapping/PropertyVariant.java | 39 + .../_types/mapping/RangePropertyBase.java | 162 + .../_types/mapping/RankFeatureProperty.java | 145 + .../_types/mapping/RankFeaturesProperty.java | 113 + .../_types/mapping/RoutingField.java | 141 + .../_types/mapping/RuntimeField.java | 391 ++ .../mapping/RuntimeFieldFetchFields.java | 178 + .../_types/mapping/RuntimeFieldType.java | 68 + .../mapping/ScaledFloatNumberProperty.java | 175 + .../mapping/SearchAsYouTypeProperty.java | 349 ++ .../_types/mapping/ShapeProperty.java | 236 + .../_types/mapping/ShortNumberProperty.java | 145 + .../_types/mapping/SizeField.java | 141 + .../_types/mapping/SourceField.java | 326 ++ .../_types/mapping/SourceFieldMode.java | 62 + .../_types/mapping/SuggestContext.java | 226 + .../_types/mapping/TermVectorOption.java | 66 + .../_types/mapping/TextIndexPrefixes.java | 166 + .../_types/mapping/TextProperty.java | 538 ++ .../_types/mapping/TimeSeriesMetricType.java | 62 + .../_types/mapping/TokenCountProperty.java | 264 + .../_types/mapping/TypeMapping.java | 743 +++ .../mapping/UnsignedLongNumberProperty.java | 146 + .../_types/mapping/VersionProperty.java | 113 + .../_types/mapping/WildcardProperty.java | 145 + .../_types/query_dsl/BoolQuery.java | 422 ++ .../_types/query_dsl/BoostingQuery.java | 216 + .../_types/query_dsl/ChildScoreMode.java | 62 + .../query_dsl/CombinedFieldsOperator.java | 56 + .../_types/query_dsl/CombinedFieldsQuery.java | 339 ++ .../query_dsl/CombinedFieldsZeroTerms.java | 62 + .../_types/query_dsl/CommonTermsQuery.java | 307 ++ .../_types/query_dsl/ConstantScoreQuery.java | 159 + .../_types/query_dsl/DecayFunction.java | 168 + .../_types/query_dsl/DecayFunctionBase.java | 123 + .../_types/query_dsl/DecayPlacement.java | 258 + .../_types/query_dsl/DisMaxQuery.java | 216 + .../query_dsl/DistanceFeatureQuery.java | 231 + .../_types/query_dsl/ExistsQuery.java | 139 + .../_types/query_dsl/FieldAndFormat.java | 217 + .../_types/query_dsl/FieldLookup.java | 246 + .../query_dsl/FieldValueFactorModifier.java | 107 + .../FieldValueFactorScoreFunction.java | 260 + .../_types/query_dsl/FunctionBoostMode.java | 82 + .../_types/query_dsl/FunctionScore.java | 455 ++ .../query_dsl/FunctionScoreBuilders.java | 147 + .../_types/query_dsl/FunctionScoreMode.java | 82 + .../_types/query_dsl/FunctionScoreQuery.java | 353 ++ .../query_dsl/FunctionScoreVariant.java | 37 + .../_types/query_dsl/FuzzyQuery.java | 385 ++ .../_types/query_dsl/GeoBoundingBoxQuery.java | 278 + .../_types/query_dsl/GeoDistanceQuery.java | 269 + .../_types/query_dsl/GeoExecution.java | 56 + .../_types/query_dsl/GeoPolygonPoints.java | 173 + .../_types/query_dsl/GeoPolygonQuery.java | 227 + .../_types/query_dsl/GeoShapeFieldQuery.java | 228 + .../_types/query_dsl/GeoShapeQuery.java | 205 + .../_types/query_dsl/GeoValidationMethod.java | 65 + .../_types/query_dsl/HasChildQuery.java | 373 ++ .../_types/query_dsl/HasParentQuery.java | 302 ++ .../_types/query_dsl/IdsQuery.java | 163 + .../_types/query_dsl/Intervals.java | 341 ++ .../_types/query_dsl/IntervalsAllOf.java | 314 ++ .../_types/query_dsl/IntervalsAnyOf.java | 238 + .../_types/query_dsl/IntervalsBuilders.java | 144 + .../_types/query_dsl/IntervalsFilter.java | 425 ++ .../query_dsl/IntervalsFilterBuilders.java | 199 + .../query_dsl/IntervalsFilterVariant.java | 37 + .../_types/query_dsl/IntervalsFuzzy.java | 337 ++ .../_types/query_dsl/IntervalsMatch.java | 346 ++ .../_types/query_dsl/IntervalsPrefix.java | 236 + .../_types/query_dsl/IntervalsQuery.java | 368 ++ .../query_dsl/IntervalsQueryBuilders.java | 144 + .../query_dsl/IntervalsQueryVariant.java | 33 + .../_types/query_dsl/IntervalsVariant.java | 37 + .../_types/query_dsl/IntervalsWildcard.java | 236 + .../elasticsearch/_types/query_dsl/Like.java | 182 + .../_types/query_dsl/LikeBuilders.java | 47 + .../_types/query_dsl/LikeDocument.java | 400 ++ .../_types/query_dsl/MatchAllQuery.java | 102 + .../query_dsl/MatchBoolPrefixQuery.java | 452 ++ .../_types/query_dsl/MatchNoneQuery.java | 102 + .../query_dsl/MatchPhrasePrefixQuery.java | 307 ++ .../_types/query_dsl/MatchPhraseQuery.java | 269 + .../_types/query_dsl/MatchQuery.java | 632 +++ .../_types/query_dsl/MoreLikeThisQuery.java | 879 +++ .../_types/query_dsl/MultiMatchQuery.java | 710 +++ .../_types/query_dsl/MultiValueMode.java | 72 + .../_types/query_dsl/NestedQuery.java | 290 + .../_types/query_dsl/Operator.java | 60 + .../_types/query_dsl/ParentIdQuery.java | 214 + .../_types/query_dsl/PercolateQuery.java | 429 ++ .../_types/query_dsl/PinnedDoc.java | 174 + .../_types/query_dsl/PinnedQuery.java | 299 + .../_types/query_dsl/PinnedQueryBuilders.java | 41 + .../_types/query_dsl/PinnedQueryVariant.java | 33 + .../_types/query_dsl/PrefixQuery.java | 242 + .../elasticsearch/_types/query_dsl/Query.java | 1928 +++++++ .../_types/query_dsl/QueryBase.java | 158 + .../_types/query_dsl/QueryBuilders.java | 1000 ++++ .../_types/query_dsl/QueryStringQuery.java | 980 ++++ .../_types/query_dsl/QueryVariant.java | 37 + .../_types/query_dsl/RandomScoreFunction.java | 187 + .../_types/query_dsl/RangeQuery.java | 397 ++ .../_types/query_dsl/RangeQueryBase.java | 105 + .../_types/query_dsl/RangeRelation.java | 68 + .../_types/query_dsl/RankFeatureFunction.java | 55 + .../query_dsl/RankFeatureFunctionLinear.java | 65 + .../RankFeatureFunctionLogarithm.java | 148 + .../RankFeatureFunctionSaturation.java | 154 + .../query_dsl/RankFeatureFunctionSigmoid.java | 176 + .../_types/query_dsl/RankFeatureQuery.java | 327 ++ .../_types/query_dsl/RegexpQuery.java | 306 ++ .../_types/query_dsl/RuleQuery.java | 191 + .../_types/query_dsl/ScriptQuery.java | 151 + .../_types/query_dsl/ScriptScoreFunction.java | 166 + .../_types/query_dsl/ScriptScoreQuery.java | 228 + .../_types/query_dsl/ShapeFieldQuery.java | 229 + .../_types/query_dsl/ShapeQuery.java | 202 + .../query_dsl/SimpleQueryStringFlag.java | 123 + .../query_dsl/SimpleQueryStringQuery.java | 597 ++ .../_types/query_dsl/SpanContainingQuery.java | 201 + .../query_dsl/SpanFieldMaskingQuery.java | 177 + .../_types/query_dsl/SpanFirstQuery.java | 185 + .../_types/query_dsl/SpanGapQuery.java | 117 + .../_types/query_dsl/SpanMultiTermQuery.java | 164 + .../_types/query_dsl/SpanNearQuery.java | 249 + .../_types/query_dsl/SpanNotQuery.java | 302 ++ .../_types/query_dsl/SpanOrQuery.java | 180 + .../_types/query_dsl/SpanQuery.java | 456 ++ .../_types/query_dsl/SpanQueryBuilders.java | 218 + .../_types/query_dsl/SpanQueryVariant.java | 37 + .../_types/query_dsl/SpanTermQuery.java | 171 + .../_types/query_dsl/SpanWithinQuery.java | 199 + .../_types/query_dsl/TermQuery.java | 255 + .../_types/query_dsl/TermsLookup.java | 220 + .../_types/query_dsl/TermsQuery.java | 165 + .../_types/query_dsl/TermsQueryField.java | 185 + .../query_dsl/TermsQueryFieldBuilders.java | 49 + .../_types/query_dsl/TermsSetQuery.java | 270 + .../_types/query_dsl/TextExpansionQuery.java | 196 + .../_types/query_dsl/TextQueryType.java | 88 + .../_types/query_dsl/TypeQuery.java | 135 + .../_types/query_dsl/WildcardQuery.java | 281 + .../_types/query_dsl/WrapperQuery.java | 142 + .../_types/query_dsl/ZeroTermsQuery.java | 62 + .../async_search/AsyncSearch.java | 662 +++ .../AsyncSearchDocumentResponseBase.java | 123 + .../async_search/AsyncSearchResponseBase.java | 365 ++ .../AsyncSearchStatusRequest.java | 174 + .../AsyncSearchStatusResponse.java | 97 + .../DeleteAsyncSearchRequest.java | 175 + .../DeleteAsyncSearchResponse.java | 97 + .../ElasticsearchAsyncSearchAsyncClient.java | 275 + .../ElasticsearchAsyncSearchClient.java | 282 + .../async_search/GetAsyncSearchRequest.java | 288 + .../async_search/GetAsyncSearchResponse.java | 113 + .../async_search/SubmitRequest.java | 2546 +++++++++ .../async_search/SubmitResponse.java | 113 + .../status/StatusResponseBase.java | 198 + .../elasticsearch/cat/AliasesRequest.java | 255 + .../elasticsearch/cat/AliasesResponse.java | 167 + .../cat/CatAnomalyDetectorColumn.java | 436 ++ .../elasticsearch/cat/CatDatafeedColumn.java | 128 + .../elasticsearch/cat/CatDfaColumn.java | 142 + .../elasticsearch/cat/CatRequestBase.java | 55 + .../cat/CatTrainedModelsColumn.java | 131 + .../elasticsearch/cat/CatTransformColumn.java | 268 + .../cat/ComponentTemplatesRequest.java | 190 + .../cat/ComponentTemplatesResponse.java | 170 + .../elasticsearch/cat/CountRequest.java | 207 + .../elasticsearch/cat/CountResponse.java | 167 + .../cat/ElasticsearchCatAsyncClient.java | 492 ++ .../cat/ElasticsearchCatClient.java | 500 ++ .../elasticsearch/cat/HelpRequest.java | 90 + .../elasticsearch/cat/HelpResponse.java | 167 + .../elasticsearch/cat/IndicesRequest.java | 416 ++ .../elasticsearch/cat/IndicesResponse.java | 167 + .../cat/MlDataFrameAnalyticsRequest.java | 387 ++ .../cat/MlDataFrameAnalyticsResponse.java | 171 + .../elasticsearch/cat/MlDatafeedsRequest.java | 367 ++ .../cat/MlDatafeedsResponse.java | 169 + .../elasticsearch/cat/MlJobsRequest.java | 398 ++ .../elasticsearch/cat/MlJobsResponse.java | 167 + .../cat/MlTrainedModelsRequest.java | 411 ++ .../cat/MlTrainedModelsResponse.java | 169 + .../elasticsearch/cat/TransformsRequest.java | 414 ++ .../elasticsearch/cat/TransformsResponse.java | 169 + .../cat/aliases/AliasesRecord.java | 316 ++ .../ComponentTemplate.java | 287 + .../elasticsearch/cat/count/CountRecord.java | 218 + .../elasticsearch/cat/help/HelpRecord.java | 142 + .../cat/indices/IndicesRecord.java | 4830 +++++++++++++++++ .../DataFrameAnalyticsRecord.java | 655 +++ .../cat/ml_datafeeds/DatafeedsRecord.java | 528 ++ .../elasticsearch/cat/ml_jobs/JobsRecord.java | 2260 ++++++++ .../TrainedModelsRecord.java | 721 +++ .../cat/transforms/TransformsRecord.java | 1251 +++++ .../cluster/ClusterInfoRequest.java | 191 + .../cluster/ClusterInfoResponse.java | 312 ++ .../cluster/ClusterStatsRequest.java | 286 + .../cluster/ClusterStatsResponse.java | 96 + .../cluster/ComponentTemplate.java | 175 + .../cluster/ComponentTemplateNode.java | 231 + .../cluster/ComponentTemplateSummary.java | 385 ++ .../DeleteComponentTemplateRequest.java | 278 + .../DeleteComponentTemplateResponse.java | 99 + .../ElasticsearchClusterAsyncClient.java | 426 ++ .../cluster/ElasticsearchClusterClient.java | 437 ++ .../ExistsComponentTemplateRequest.java | 269 + .../cluster/GetClusterSettingsRequest.java | 269 + .../cluster/GetClusterSettingsResponse.java | 257 + .../cluster/GetComponentTemplateRequest.java | 320 ++ .../cluster/GetComponentTemplateResponse.java | 178 + .../cluster/PendingTasksRequest.java | 205 + .../cluster/PendingTasksResponse.java | 174 + .../cluster/PutClusterSettingsRequest.java | 355 ++ .../cluster/PutClusterSettingsResponse.java | 238 + .../cluster/PutComponentTemplateRequest.java | 486 ++ .../cluster/PutComponentTemplateResponse.java | 98 + .../cluster/pending_tasks/PendingTask.java | 319 ++ .../cluster/stats/CharFilterTypes.java | 632 +++ .../cluster/stats/ClusterFileSystem.java | 212 + .../cluster/stats/ClusterIndices.java | 564 ++ .../cluster/stats/ClusterIndicesShards.java | 264 + .../stats/ClusterIndicesShardsIndex.java | 241 + .../cluster/stats/ClusterIngest.java | 200 + .../cluster/stats/ClusterJvm.java | 273 + .../cluster/stats/ClusterJvmMemory.java | 178 + .../cluster/stats/ClusterJvmVersion.java | 321 ++ .../cluster/stats/ClusterNetworkTypes.java | 232 + .../cluster/stats/ClusterNodeCount.java | 461 ++ .../cluster/stats/ClusterNodes.java | 650 +++ .../cluster/stats/ClusterOperatingSystem.java | 426 ++ .../ClusterOperatingSystemArchitecture.java | 181 + .../stats/ClusterOperatingSystemName.java | 179 + .../ClusterOperatingSystemPrettyName.java | 182 + .../cluster/stats/ClusterProcess.java | 193 + .../cluster/stats/ClusterProcessCpu.java | 148 + .../ClusterProcessOpenFileDescriptors.java | 212 + .../cluster/stats/ClusterProcessor.java | 252 + .../cluster/stats/ClusterShardMetrics.java | 210 + .../cluster/stats/FieldTypes.java | 343 ++ .../cluster/stats/FieldTypesMappings.java | 385 ++ .../cluster/stats/IndexingPressure.java | 150 + .../cluster/stats/IndexingPressureMemory.java | 210 + .../stats/IndexingPressureMemorySummary.java | 333 ++ .../cluster/stats/IndicesVersions.java | 217 + .../cluster/stats/NodePackagingType.java | 210 + .../stats/OperatingSystemMemoryInfo.java | 308 ++ .../cluster/stats/RuntimeFieldTypes.java | 550 ++ .../cluster/stats/StatsResponseBase.java | 273 + .../elasticsearch/core/BulkRequest.java | 601 ++ .../elasticsearch/core/BulkResponse.java | 251 + .../core/ClearScrollRequest.java | 196 + .../core/ClearScrollResponse.java | 168 + .../core/ClosePointInTimeRequest.java | 175 + .../core/ClosePointInTimeResponse.java | 170 + .../elasticsearch/core/CountRequest.java | 721 +++ .../elasticsearch/core/CountResponse.java | 174 + .../elasticsearch/core/CreateRequest.java | 534 ++ .../elasticsearch/core/CreateResponse.java | 96 + .../core/DeleteByQueryRequest.java | 1298 +++++ .../core/DeleteByQueryResponse.java | 641 +++ .../elasticsearch/core/DeleteRequest.java | 485 ++ .../elasticsearch/core/DeleteResponse.java | 96 + .../core/DeleteScriptRequest.java | 249 + .../core/DeleteScriptResponse.java | 96 + .../elasticsearch/core/ExistsRequest.java | 560 ++ .../core/ExistsSourceRequest.java | 519 ++ .../elasticsearch/core/FieldCapsRequest.java | 635 +++ .../elasticsearch/core/FieldCapsResponse.java | 219 + .../elasticsearch/core/GetRequest.java | 569 ++ .../elasticsearch/core/GetResponse.java | 111 + .../elasticsearch/core/GetScriptRequest.java | 210 + .../elasticsearch/core/GetScriptResponse.java | 205 + .../elasticsearch/core/GetSourceRequest.java | 566 ++ .../elasticsearch/core/GetSourceResponse.java | 168 + .../elasticsearch/core/IndexRequest.java | 689 +++ .../elasticsearch/core/IndexResponse.java | 96 + .../elasticsearch/core/InfoRequest.java | 86 + .../elasticsearch/core/InfoResponse.java | 247 + .../elasticsearch/core/MgetRequest.java | 659 +++ .../elasticsearch/core/MgetResponse.java | 210 + .../elasticsearch/core/MsearchRequest.java | 613 +++ .../elasticsearch/core/MsearchResponse.java | 112 + .../core/MsearchTemplateRequest.java | 369 ++ .../core/MsearchTemplateResponse.java | 113 + .../core/MtermvectorsRequest.java | 688 +++ .../core/MtermvectorsResponse.java | 174 + .../core/OpenPointInTimeRequest.java | 374 ++ .../core/OpenPointInTimeResponse.java | 146 + .../elasticsearch/core/PingRequest.java | 89 + .../elasticsearch/core/PutScriptRequest.java | 355 ++ .../elasticsearch/core/PutScriptResponse.java | 96 + .../elasticsearch/core/RankEvalRequest.java | 491 ++ .../elasticsearch/core/RankEvalResponse.java | 262 + .../core/RenderSearchTemplateRequest.java | 319 ++ .../core/RenderSearchTemplateResponse.java | 170 + .../core/ScriptsPainlessExecuteRequest.java | 264 + .../core/ScriptsPainlessExecuteResponse.java | 178 + .../elasticsearch/core/ScrollRequest.java | 226 + .../elasticsearch/core/ScrollResponse.java | 112 + .../elasticsearch/core/SearchMvtRequest.java | 1028 ++++ .../elasticsearch/core/SearchRequest.java | 2672 +++++++++ .../elasticsearch/core/SearchResponse.java | 112 + .../core/SearchTemplateRequest.java | 729 +++ .../core/SearchTemplateResponse.java | 631 +++ .../elasticsearch/core/TermsEnumRequest.java | 461 ++ .../elasticsearch/core/TermsEnumResponse.java | 219 + .../core/TermvectorsRequest.java | 745 +++ .../core/TermvectorsResponse.java | 298 + .../core/UpdateByQueryRequest.java | 1368 +++++ .../core/UpdateByQueryResponse.java | 640 +++ .../elasticsearch/core/UpdateRequest.java | 871 +++ .../elasticsearch/core/UpdateResponse.java | 114 + .../core/bulk/BulkOperation.java | 272 + .../core/bulk/BulkOperationBase.java | 293 + .../core/bulk/BulkOperationBuilders.java | 108 + .../core/bulk/BulkOperationVariant.java | 37 + .../core/bulk/BulkResponseItem.java | 487 ++ .../core/bulk/CreateOperation.java | 139 + .../core/bulk/DeleteOperation.java | 103 + .../core/bulk/IndexOperation.java | 139 + .../core/bulk/OperationType.java | 59 + .../elasticsearch/core/bulk/UpdateAction.java | 436 ++ .../core/bulk/UpdateOperation.java | 276 + .../core/bulk/WriteOperation.java | 180 + .../core/explain/Explanation.java | 220 + .../core/explain/ExplanationDetail.java | 222 + .../core/field_caps/FieldCapability.java | 639 +++ .../elasticsearch/core/get/GetResult.java | 426 ++ .../core/mget/MultiGetError.java | 198 + .../core/mget/MultiGetOperation.java | 369 ++ .../core/mget/MultiGetResponseItem.java | 186 + .../mget/MultiGetResponseItemBuilders.java | 53 + .../core/msearch/MultiSearchItem.java | 152 + .../core/msearch/MultiSearchResponseItem.java | 187 + .../MultiSearchResponseItemBuilders.java | 53 + .../core/msearch/MultiSearchResult.java | 191 + .../core/msearch/MultisearchBody.java | 1586 ++++++ .../core/msearch/MultisearchHeader.java | 475 ++ .../core/msearch/RequestItem.java | 167 + .../core/msearch_template/RequestItem.java | 169 + .../core/msearch_template/TemplateConfig.java | 298 + .../MultiTermVectorsOperation.java | 522 ++ .../mtermvectors/MultiTermVectorsResult.java | 353 ++ .../core/rank_eval/DocumentRating.java | 206 + .../core/rank_eval/RankEvalHit.java | 192 + .../core/rank_eval/RankEvalHitItem.java | 185 + .../core/rank_eval/RankEvalMetric.java | 303 ++ .../core/rank_eval/RankEvalMetricBase.java | 125 + .../core/rank_eval/RankEvalMetricDetail.java | 357 ++ ...ankEvalMetricDiscountedCumulativeGain.java | 146 + .../RankEvalMetricExpectedReciprocalRank.java | 142 + .../RankEvalMetricMeanReciprocalRank.java | 102 + .../rank_eval/RankEvalMetricPrecision.java | 148 + .../RankEvalMetricRatingTreshold.java | 110 + .../core/rank_eval/RankEvalMetricRecall.java | 100 + .../core/rank_eval/RankEvalQuery.java | 181 + .../core/rank_eval/RankEvalRequestItem.java | 339 ++ .../core/rank_eval/UnratedDocument.java | 167 + .../core/reindex/Destination.java | 289 + .../core/reindex/RemoteSource.java | 353 ++ .../elasticsearch/core/reindex/Source.java | 507 ++ .../PainlessContextSetup.java | 202 + .../core/search/AggregationBreakdown.java | 421 ++ .../core/search/AggregationProfile.java | 317 ++ .../core/search/AggregationProfileDebug.java | 994 ++++ ...AggregationProfileDelegateDebugFilter.java | 242 + .../core/search/BoundaryScanner.java | 78 + .../elasticsearch/core/search/Collector.java | 247 + .../core/search/CompletionContext.java | 358 ++ .../core/search/CompletionSuggest.java | 205 + .../core/search/CompletionSuggestOption.java | 456 ++ .../core/search/CompletionSuggester.java | 300 + .../elasticsearch/core/search/Context.java | 186 + .../core/search/ContextBuilders.java | 49 + .../core/search/DirectGenerator.java | 518 ++ .../core/search/FetchProfile.java | 315 ++ .../core/search/FetchProfileBreakdown.java | 353 ++ .../core/search/FetchProfileDebug.java | 196 + .../core/search/FieldCollapse.java | 283 + .../core/search/FieldSuggester.java | 445 ++ .../core/search/FieldSuggesterBuilders.java | 91 + .../core/search/FieldSuggesterVariant.java | 37 + .../elasticsearch/core/search/Highlight.java | 187 + .../core/search/HighlightBase.java | 917 ++++ .../core/search/HighlightField.java | 220 + .../core/search/HighlighterEncoder.java | 56 + .../core/search/HighlighterFragmenter.java | 56 + .../core/search/HighlighterOrder.java | 54 + .../core/search/HighlighterTagsSchema.java | 54 + .../core/search/HighlighterType.java | 67 + .../elasticsearch/core/search/Hit.java | 866 +++ .../core/search/HitsMetadata.java | 283 + .../elasticsearch/core/search/InnerHits.java | 744 +++ .../core/search/InnerHitsResult.java | 150 + .../core/search/LaplaceSmoothingModel.java | 156 + .../LinearInterpolationSmoothingModel.java | 202 + .../core/search/NestedIdentity.java | 205 + .../core/search/PhraseSuggest.java | 165 + .../core/search/PhraseSuggestCollate.java | 248 + .../search/PhraseSuggestCollateQuery.java | 188 + .../core/search/PhraseSuggestHighlight.java | 182 + .../core/search/PhraseSuggestOption.java | 230 + .../core/search/PhraseSuggester.java | 635 +++ .../core/search/PointInTimeReference.java | 183 + .../elasticsearch/core/search/Profile.java | 172 + .../core/search/QueryBreakdown.java | 555 ++ .../core/search/QueryProfile.java | 278 + .../core/search/RegexOptions.java | 186 + .../elasticsearch/core/search/Rescore.java | 180 + .../core/search/RescoreQuery.java | 262 + .../core/search/ResponseBody.java | 579 ++ .../elasticsearch/core/search/ScoreMode.java | 78 + .../core/search/SearchProfile.java | 248 + .../core/search/ShardProfile.java | 286 + .../core/search/SmoothingModel.java | 246 + .../core/search/SmoothingModelBuilders.java | 93 + .../core/search/SmoothingModelVariant.java | 37 + .../core/search/SourceConfig.java | 181 + .../core/search/SourceConfigBuilders.java | 48 + .../core/search/SourceConfigParam.java | 202 + .../search/SourceConfigParamBuilders.java | 42 + .../core/search/SourceFilter.java | 213 + .../core/search/StringDistance.java | 78 + .../search/StupidBackoffSmoothingModel.java | 159 + .../core/search/SuggestBase.java | 163 + .../core/search/SuggestFuzziness.java | 292 + .../core/search/SuggestSort.java | 63 + .../elasticsearch/core/search/Suggester.java | 211 + .../core/search/SuggesterBase.java | 190 + .../elasticsearch/core/search/Suggestion.java | 241 + .../core/search/SuggestionBuilders.java | 60 + .../core/search/SuggestionVariant.java | 37 + .../core/search/TermSuggest.java | 165 + .../core/search/TermSuggestOption.java | 253 + .../core/search/TermSuggester.java | 537 ++ .../elasticsearch/core/search/TotalHits.java | 196 + .../core/search/TotalHitsRelation.java | 62 + .../elasticsearch/core/search/TrackHits.java | 196 + .../core/search/TrackHitsBuilders.java | 40 + .../core/search_mvt/GridAggregationType.java | 56 + .../core/search_mvt/GridType.java | 57 + .../core/termvectors/FieldStatistics.java | 191 + .../core/termvectors/Filter.java | 321 ++ .../elasticsearch/core/termvectors/Term.java | 285 + .../core/termvectors/TermVector.java | 205 + .../elasticsearch/core/termvectors/Token.java | 231 + .../core/update/UpdateWriteResponseBase.java | 129 + .../elasticsearch/doc-files/api-spec.html | 1611 ++++++ .../enrich/DeletePolicyRequest.java | 171 + .../enrich/DeletePolicyResponse.java | 96 + .../ElasticsearchEnrichAsyncClient.java | 217 + .../enrich/ElasticsearchEnrichClient.java | 220 + .../elasticsearch/enrich/EnrichPolicy.java | 319 ++ .../enrich/EnrichPolicyType.java | 57 + .../enrich/EnrichStatsRequest.java | 88 + .../enrich/EnrichStatsResponse.java | 320 ++ .../elasticsearch/enrich/EnrichSummary.java | 163 + .../enrich/ExecutePolicyRequest.java | 205 + .../enrich/ExecutePolicyResponse.java | 183 + .../enrich/GetPolicyRequest.java | 201 + .../enrich/GetPolicyResponse.java | 171 + .../enrich/PutPolicyRequest.java | 332 ++ .../enrich/PutPolicyResponse.java | 96 + .../execute_policy/EnrichPolicyPhase.java | 60 + .../ExecuteEnrichPolicyStatus.java | 145 + .../enrich/stats/CacheStats.java | 239 + .../enrich/stats/CoordinatorStats.java | 244 + .../enrich/stats/ExecutingPolicy.java | 174 + .../elasticsearch/graph/Connection.java | 214 + .../graph/ElasticsearchGraphAsyncClient.java | 92 + .../graph/ElasticsearchGraphClient.java | 92 + .../elasticsearch/graph/ExploreControls.java | 295 + .../elasticsearch/graph/ExploreRequest.java | 489 ++ .../elasticsearch/graph/ExploreResponse.java | 326 ++ .../clients/elasticsearch/graph/Hop.java | 265 + .../elasticsearch/graph/SampleDiversity.java | 167 + .../clients/elasticsearch/graph/Vertex.java | 216 + .../elasticsearch/graph/VertexDefinition.java | 371 ++ .../elasticsearch/graph/VertexInclude.java | 167 + .../clients/elasticsearch/indices/Alias.java | 333 ++ .../indices/AliasDefinition.java | 333 ++ .../elasticsearch/indices/AnalyzeRequest.java | 635 +++ .../indices/AnalyzeResponse.java | 210 + .../elasticsearch/indices/CacheQueries.java | 141 + .../indices/CreateDataStreamRequest.java | 186 + .../indices/CreateDataStreamResponse.java | 98 + .../indices/CreateIndexRequest.java | 492 ++ .../indices/CreateIndexResponse.java | 194 + .../elasticsearch/indices/DataStream.java | 633 +++ .../indices/DataStreamIndex.java | 174 + .../indices/DataStreamLifecycle.java | 159 + ...DataStreamLifecycleRolloverConditions.java | 423 ++ .../DataStreamLifecycleWithRollover.java | 234 + .../indices/DataStreamTimestampField.java | 154 + .../indices/DataStreamVisibility.java | 150 + .../indices/DataStreamsStatsRequest.java | 238 + .../indices/DataStreamsStatsResponse.java | 348 ++ .../indices/DeleteAliasRequest.java | 338 ++ .../indices/DeleteAliasResponse.java | 96 + .../indices/DeleteDataLifecycleRequest.java | 318 ++ .../indices/DeleteDataLifecycleResponse.java | 98 + .../indices/DeleteDataStreamRequest.java | 237 + .../indices/DeleteDataStreamResponse.java | 98 + .../indices/DeleteIndexRequest.java | 410 ++ .../indices/DeleteIndexResponse.java | 96 + .../indices/DeleteIndexTemplateRequest.java | 278 + .../indices/DeleteIndexTemplateResponse.java | 98 + .../indices/DeleteTemplateRequest.java | 257 + .../indices/DeleteTemplateResponse.java | 98 + .../indices/DiskUsageRequest.java | 383 ++ .../indices/DiskUsageResponse.java | 138 + .../ElasticsearchIndicesAsyncClient.java | 1480 +++++ .../indices/ElasticsearchIndicesClient.java | 1524 ++++++ .../indices/ExistsAliasRequest.java | 415 ++ .../indices/ExistsIndexTemplateRequest.java | 218 + .../elasticsearch/indices/ExistsRequest.java | 408 ++ .../indices/ExistsTemplateRequest.java | 291 + .../indices/ExplainDataLifecycleRequest.java | 262 + .../indices/ExplainDataLifecycleResponse.java | 180 + .../indices/FielddataFrequencyFilter.java | 194 + .../indices/GetAliasRequest.java | 434 ++ .../indices/GetAliasResponse.java | 177 + .../indices/GetDataLifecycleRequest.java | 279 + .../indices/GetDataLifecycleResponse.java | 178 + .../indices/GetDataStreamRequest.java | 280 + .../indices/GetDataStreamResponse.java | 174 + .../indices/GetIndexRequest.java | 485 ++ .../indices/GetIndexResponse.java | 176 + .../indices/GetIndexTemplateRequest.java | 320 ++ .../indices/GetIndexTemplateResponse.java | 177 + .../indices/GetIndicesSettingsRequest.java | 530 ++ .../indices/GetIndicesSettingsResponse.java | 178 + .../indices/GetMappingRequest.java | 406 ++ .../indices/GetMappingResponse.java | 180 + .../indices/GetTemplateRequest.java | 311 ++ .../indices/GetTemplateResponse.java | 178 + .../indices/IndexCheckOnStartup.java | 58 + .../elasticsearch/indices/IndexRouting.java | 191 + .../indices/IndexRoutingAllocation.java | 260 + .../indices/IndexRoutingAllocationDisk.java | 151 + .../IndexRoutingAllocationInclude.java | 180 + ...IndexRoutingAllocationInitialRecovery.java | 153 + .../IndexRoutingAllocationOptions.java | 60 + .../indices/IndexRoutingRebalance.java | 144 + .../indices/IndexRoutingRebalanceOptions.java | 60 + .../indices/IndexSegmentSort.java | 293 + .../indices/IndexSettingBlocks.java | 266 + .../elasticsearch/indices/IndexSettings.java | 2063 +++++++ .../indices/IndexSettingsAnalysis.java | 398 ++ .../indices/IndexSettingsLifecycle.java | 352 ++ .../indices/IndexSettingsLifecycleStep.java | 170 + .../indices/IndexSettingsTimeSeries.java | 178 + .../elasticsearch/indices/IndexState.java | 363 ++ .../elasticsearch/indices/IndexTemplate.java | 483 ++ .../IndexTemplateDataStreamConfiguration.java | 190 + .../indices/IndexTemplateSummary.java | 322 ++ .../indices/IndexVersioning.java | 176 + .../indices/IndexingPressure.java | 149 + .../indices/IndexingPressureMemory.java | 161 + .../indices/IndexingSlowlogSettings.java | 248 + .../indices/IndexingSlowlogTresholds.java | 169 + .../indices/MappingLimitSettings.java | 405 ++ .../indices/MappingLimitSettingsDepth.java | 161 + .../MappingLimitSettingsDimensionFields.java | 163 + .../MappingLimitSettingsFieldNameLength.java | 167 + .../MappingLimitSettingsNestedFields.java | 162 + .../MappingLimitSettingsNestedObjects.java | 160 + .../MappingLimitSettingsTotalFields.java | 164 + .../clients/elasticsearch/indices/Merge.java | 153 + .../elasticsearch/indices/MergeScheduler.java | 176 + .../indices/MigrateToDataStreamRequest.java | 180 + .../indices/MigrateToDataStreamResponse.java | 98 + .../indices/ModifyDataStreamRequest.java | 214 + .../indices/ModifyDataStreamResponse.java | 98 + .../indices/NumericFielddata.java | 141 + .../indices/NumericFielddataFormat.java | 56 + .../indices/PutAliasRequest.java | 548 ++ .../indices/PutAliasResponse.java | 96 + .../indices/PutDataLifecycleRequest.java | 413 ++ .../indices/PutDataLifecycleResponse.java | 98 + .../indices/PutIndexTemplateRequest.java | 572 ++ .../indices/PutIndexTemplateResponse.java | 98 + .../indices/PutIndicesSettingsRequest.java | 527 ++ .../indices/PutIndicesSettingsResponse.java | 97 + .../indices/PutMappingRequest.java | 1018 ++++ .../indices/PutMappingResponse.java | 96 + .../indices/PutTemplateRequest.java | 636 +++ .../indices/PutTemplateResponse.java | 96 + .../elasticsearch/indices/Queries.java | 153 + .../indices/ResolveIndexRequest.java | 256 + .../indices/ResolveIndexResponse.java | 282 + .../elasticsearch/indices/RetentionLease.java | 149 + .../indices/RolloverRequest.java | 631 +++ .../indices/RolloverResponse.java | 310 ++ .../elasticsearch/indices/SearchIdle.java | 154 + .../indices/SegmentSortMissing.java | 56 + .../indices/SegmentSortMode.java | 61 + .../indices/SegmentSortOrder.java | 61 + .../indices/SettingsAnalyze.java | 147 + .../indices/SettingsHighlight.java | 148 + .../indices/SettingsQueryString.java | 144 + .../elasticsearch/indices/SettingsSearch.java | 189 + .../indices/SettingsSimilarity.java | 373 ++ .../indices/SettingsSimilarityBm25.java | 194 + .../indices/SettingsSimilarityDfi.java | 146 + .../indices/SettingsSimilarityDfr.java | 193 + .../indices/SettingsSimilarityIb.java | 193 + .../indices/SettingsSimilarityLmd.java | 144 + .../indices/SettingsSimilarityLmj.java | 144 + .../SettingsSimilarityScriptedTfidf.java | 154 + .../indices/SimulateIndexTemplateRequest.java | 696 +++ .../SimulateIndexTemplateResponse.java | 55 + .../indices/SimulateTemplateRequest.java | 355 ++ .../indices/SimulateTemplateResponse.java | 208 + .../indices/SlowlogSettings.java | 243 + .../indices/SlowlogTresholdLevels.java | 265 + .../indices/SlowlogTresholds.java | 189 + .../elasticsearch/indices/SoftDeletes.java | 205 + .../elasticsearch/indices/Storage.java | 195 + .../elasticsearch/indices/StorageType.java | 91 + .../indices/TemplateMapping.java | 350 ++ .../elasticsearch/indices/Translog.java | 279 + .../indices/TranslogDurability.java | 71 + .../indices/TranslogRetention.java | 225 + .../indices/UpdateAliasesRequest.java | 300 + .../indices/UpdateAliasesResponse.java | 96 + .../indices/ValidateQueryRequest.java | 691 +++ .../indices/ValidateQueryResponse.java | 269 + .../indices/analyze/AnalyzeDetail.java | 324 ++ .../indices/analyze/AnalyzeToken.java | 268 + .../indices/analyze/AnalyzerDetail.java | 197 + .../indices/analyze/CharFilterDetail.java | 188 + .../indices/analyze/ExplainAnalyzeToken.java | 391 ++ .../indices/analyze/TokenDetail.java | 196 + .../DataStreamsStatsItem.java | 284 + .../DataStreamLifecycleExplain.java | 407 ++ .../elasticsearch/indices/get/Feature.java | 56 + .../indices/get_alias/IndexAliases.java | 175 + .../DataStreamWithLifecycle.java | 184 + .../get_index_template/IndexTemplateItem.java | 175 + .../get_mapping/IndexMappingRecord.java | 188 + .../indices/modify_data_stream/Action.java | 216 + .../modify_data_stream/ActionBuilders.java | 74 + .../modify_data_stream/ActionVariant.java | 37 + .../IndexAndDataStreamAction.java | 186 + .../IndexTemplateMapping.java | 324 ++ .../ReloadDetails.java | 234 + .../reload_search_analyzers/ReloadResult.java | 212 + .../resolve_index/ResolveIndexAliasItem.java | 191 + .../ResolveIndexDataStreamsItem.java | 216 + .../resolve_index/ResolveIndexItem.java | 263 + .../indices/rollover/RolloverConditions.java | 572 ++ .../simulate_template/Overlapping.java | 189 + .../indices/simulate_template/Template.java | 238 + .../indices/stats/ShardFileSizeInfo.java | 285 + .../indices/update_aliases/Action.java | 243 + .../update_aliases/ActionBuilders.java | 86 + .../indices/update_aliases/ActionVariant.java | 37 + .../indices/update_aliases/AddAction.java | 549 ++ .../indices/update_aliases/RemoveAction.java | 331 ++ .../update_aliases/RemoveIndexAction.java | 247 + .../IndicesValidationExplanation.java | 229 + .../elasticsearch/ingest/AppendProcessor.java | 229 + .../ingest/AttachmentProcessor.java | 381 ++ .../elasticsearch/ingest/BytesProcessor.java | 215 + .../elasticsearch/ingest/CircleProcessor.java | 277 + .../ingest/ConvertProcessor.java | 242 + .../elasticsearch/ingest/ConvertType.java | 65 + .../elasticsearch/ingest/CsvProcessor.java | 364 ++ .../ingest/DateIndexNameProcessor.java | 377 ++ .../elasticsearch/ingest/DateProcessor.java | 295 + .../ingest/DeletePipelineRequest.java | 260 + .../ingest/DeletePipelineResponse.java | 97 + .../ingest/DissectProcessor.java | 240 + .../ingest/DotExpanderProcessor.java | 182 + .../elasticsearch/ingest/DropProcessor.java | 101 + .../ElasticsearchIngestAsyncClient.java | 229 + .../ingest/ElasticsearchIngestClient.java | 233 + .../elasticsearch/ingest/EnrichProcessor.java | 355 ++ .../elasticsearch/ingest/FailProcessor.java | 141 + .../ingest/ForeachProcessor.java | 214 + .../elasticsearch/ingest/GeoIpProcessor.java | 340 ++ .../ingest/GetPipelineRequest.java | 262 + .../ingest/GetPipelineResponse.java | 178 + .../elasticsearch/ingest/GrokProcessor.java | 328 ++ .../elasticsearch/ingest/GsubProcessor.java | 269 + .../elasticsearch/ingest/InferenceConfig.java | 212 + .../ingest/InferenceConfigBuilders.java | 74 + .../ingest/InferenceConfigClassification.java | 301 + .../ingest/InferenceConfigRegression.java | 200 + .../ingest/InferenceConfigVariant.java | 37 + .../ingest/InferenceProcessor.java | 279 + .../elasticsearch/ingest/JoinProcessor.java | 203 + .../elasticsearch/ingest/JsonProcessor.java | 289 + .../ingest/JsonProcessorConflictStrategy.java | 63 + .../ingest/KeyValueProcessor.java | 514 ++ .../ingest/LowercaseProcessor.java | 216 + .../elasticsearch/ingest/Pipeline.java | 313 ++ .../ingest/PipelineProcessor.java | 176 + .../elasticsearch/ingest/Processor.java | 1245 +++++ .../elasticsearch/ingest/ProcessorBase.java | 288 + .../ingest/ProcessorBuilders.java | 648 +++ .../ingest/ProcessorGrokRequest.java | 90 + .../ingest/ProcessorGrokResponse.java | 167 + .../ingest/ProcessorVariant.java | 37 + .../ingest/PutPipelineRequest.java | 589 ++ .../ingest/PutPipelineResponse.java | 96 + .../elasticsearch/ingest/RemoveProcessor.java | 202 + .../elasticsearch/ingest/RenameProcessor.java | 205 + .../elasticsearch/ingest/SetProcessor.java | 329 ++ .../ingest/SetSecurityUserProcessor.java | 196 + .../elasticsearch/ingest/ShapeType.java | 55 + .../elasticsearch/ingest/SimulateRequest.java | 359 ++ .../ingest/SimulateResponse.java | 172 + .../elasticsearch/ingest/SortProcessor.java | 210 + .../elasticsearch/ingest/SplitProcessor.java | 276 + .../elasticsearch/ingest/TrimProcessor.java | 211 + .../ingest/UppercaseProcessor.java | 216 + .../ingest/UrlDecodeProcessor.java | 216 + .../ingest/UserAgentProcessor.java | 297 + .../ingest/UserAgentProperty.java | 71 + .../ingest/simulate/Document.java | 215 + .../ingest/simulate/DocumentSimulation.java | 401 ++ .../elasticsearch/ingest/simulate/Ingest.java | 172 + .../ingest/simulate/PipelineSimulation.java | 301 + .../logstash/DeletePipelineRequest.java | 174 + .../ElasticsearchLogstashAsyncClient.java | 159 + .../logstash/ElasticsearchLogstashClient.java | 159 + .../logstash/GetPipelineRequest.java | 195 + .../logstash/GetPipelineResponse.java | 178 + .../elasticsearch/logstash/Pipeline.java | 314 ++ .../logstash/PipelineMetadata.java | 167 + .../logstash/PipelineSettings.java | 332 ++ .../logstash/PutPipelineRequest.java | 228 + .../elasticsearch/ml/AnalysisConfig.java | 753 +++ .../elasticsearch/ml/AnalysisConfigRead.java | 686 +++ .../elasticsearch/ml/AnalysisLimits.java | 228 + .../elasticsearch/ml/AnalysisMemoryLimit.java | 154 + .../elasticsearch/ml/ApiKeyAuthorization.java | 176 + .../clients/elasticsearch/ml/AppliesTo.java | 59 + .../elasticsearch/ml/CalendarEvent.java | 268 + .../ml/CategorizationAnalyzer.java | 180 + .../ml/CategorizationAnalyzerBuilders.java | 48 + .../ml/CategorizationAnalyzerDefinition.java | 362 ++ .../ml/CategorizationStatus.java | 55 + .../elasticsearch/ml/ChunkingConfig.java | 201 + .../elasticsearch/ml/ChunkingMode.java | 57 + .../ml/ClassificationInferenceOptions.java | 329 ++ .../elasticsearch/ml/CloseJobRequest.java | 332 ++ .../elasticsearch/ml/CloseJobResponse.java | 141 + .../elasticsearch/ml/ConditionOperator.java | 59 + .../clients/elasticsearch/ml/DataCounts.java | 615 +++ .../elasticsearch/ml/DataDescription.java | 264 + .../clients/elasticsearch/ml/Datafeed.java | 746 +++ .../ml/DatafeedAuthorization.java | 255 + .../elasticsearch/ml/DatafeedConfig.java | 865 +++ .../ml/DatafeedRunningState.java | 228 + .../elasticsearch/ml/DatafeedState.java | 59 + .../elasticsearch/ml/DatafeedStats.java | 305 ++ .../elasticsearch/ml/DatafeedTimingStats.java | 299 + .../elasticsearch/ml/DataframeAnalysis.java | 246 + .../ml/DataframeAnalysisAnalyzedFields.java | 236 + .../ml/DataframeAnalysisBase.java | 897 +++ .../ml/DataframeAnalysisBuilders.java | 93 + .../ml/DataframeAnalysisClassification.java | 191 + .../ml/DataframeAnalysisFeatureProcessor.java | 329 ++ ...frameAnalysisFeatureProcessorBuilders.java | 141 + ...ysisFeatureProcessorFrequencyEncoding.java | 245 + ...AnalysisFeatureProcessorMultiEncoding.java | 190 + ...AnalysisFeatureProcessorNGramEncoding.java | 352 ++ ...nalysisFeatureProcessorOneHotEncoding.java | 191 + ...sisFeatureProcessorTargetMeanEncoding.java | 274 + ...aframeAnalysisFeatureProcessorVariant.java | 37 + .../ml/DataframeAnalysisOutlierDetection.java | 359 ++ .../ml/DataframeAnalysisRegression.java | 188 + .../ml/DataframeAnalysisVariant.java | 37 + .../elasticsearch/ml/DataframeAnalytics.java | 402 ++ .../ml/DataframeAnalyticsAuthorization.java | 258 + .../ml/DataframeAnalyticsDestination.java | 188 + .../ml/DataframeAnalyticsSource.java | 356 ++ .../ml/DataframeAnalyticsStats.java | 252 + .../ml/DataframeAnalyticsStatsBuilders.java | 96 + .../ml/DataframeAnalyticsStatsDataCounts.java | 216 + ...ataframeAnalyticsStatsHyperparameters.java | 308 ++ .../DataframeAnalyticsStatsMemoryUsage.java | 250 + ...taframeAnalyticsStatsOutlierDetection.java | 243 + .../ml/DataframeAnalyticsStatsProgress.java | 182 + .../ml/DataframeAnalyticsStatsVariant.java | 37 + .../ml/DataframeAnalyticsSummary.java | 505 ++ .../elasticsearch/ml/DataframeEvaluation.java | 248 + .../ml/DataframeEvaluationBuilders.java | 94 + .../ml/DataframeEvaluationClassification.java | 279 + ...aframeEvaluationClassificationMetrics.java | 216 + ...EvaluationClassificationMetricsAucRoc.java | 199 + .../ml/DataframeEvaluationMetrics.java | 246 + .../DataframeEvaluationOutlierDetection.java | 242 + ...rameEvaluationOutlierDetectionMetrics.java | 164 + .../ml/DataframeEvaluationRegression.java | 240 + .../DataframeEvaluationRegressionMetrics.java | 324 ++ ...frameEvaluationRegressionMetricsHuber.java | 161 + ...aframeEvaluationRegressionMetricsMsle.java | 159 + .../ml/DataframeEvaluationVariant.java | 37 + .../elasticsearch/ml/DataframeState.java | 61 + .../ml/DelayedDataCheckConfig.java | 210 + .../ml/DeleteCalendarEventRequest.java | 206 + .../ml/DeleteCalendarEventResponse.java | 98 + .../ml/DeleteCalendarJobRequest.java | 222 + .../ml/DeleteCalendarJobResponse.java | 233 + .../ml/DeleteCalendarRequest.java | 171 + .../ml/DeleteCalendarResponse.java | 97 + .../ml/DeleteDataFrameAnalyticsRequest.java | 247 + .../ml/DeleteDataFrameAnalyticsResponse.java | 99 + .../ml/DeleteDatafeedRequest.java | 210 + .../ml/DeleteDatafeedResponse.java | 97 + .../elasticsearch/ml/DeleteFilterRequest.java | 173 + .../ml/DeleteFilterResponse.java | 96 + .../elasticsearch/ml/DeleteJobRequest.java | 275 + .../elasticsearch/ml/DeleteJobResponse.java | 96 + .../ml/DeleteTrainedModelAliasRequest.java | 208 + .../ml/DeleteTrainedModelAliasResponse.java | 99 + .../ml/DeleteTrainedModelRequest.java | 205 + .../ml/DeleteTrainedModelResponse.java | 98 + .../ml/DeploymentAllocationState.java | 67 + .../ml/DeploymentAssignmentState.java | 60 + .../elasticsearch/ml/DeploymentState.java | 68 + .../elasticsearch/ml/DetectionRule.java | 320 ++ .../clients/elasticsearch/ml/Detector.java | 519 ++ .../elasticsearch/ml/DetectorRead.java | 518 ++ .../ml/ElasticsearchMlAsyncClient.java | 1957 +++++++ .../ml/ElasticsearchMlClient.java | 2017 +++++++ .../ml/EstimateModelMemoryRequest.java | 339 ++ .../ml/EstimateModelMemoryResponse.java | 147 + .../ml/EvaluateDataFrameRequest.java | 265 + .../ml/EvaluateDataFrameResponse.java | 234 + .../elasticsearch/ml/ExcludeFrequent.java | 59 + .../ml/FillMaskInferenceOptions.java | 287 + .../ml/FillMaskInferenceUpdateOptions.java | 243 + .../clients/elasticsearch/ml/Filter.java | 230 + .../clients/elasticsearch/ml/FilterRef.java | 181 + .../clients/elasticsearch/ml/FilterType.java | 55 + .../elasticsearch/ml/FlushJobRequest.java | 369 ++ .../elasticsearch/ml/FlushJobResponse.java | 179 + .../ml/GetCalendarEventsRequest.java | 334 ++ .../ml/GetCalendarEventsResponse.java | 199 + .../elasticsearch/ml/GetCalendarsRequest.java | 325 ++ .../ml/GetCalendarsResponse.java | 198 + .../ml/GetDataFrameAnalyticsRequest.java | 343 ++ .../ml/GetDataFrameAnalyticsResponse.java | 215 + .../ml/GetDataFrameAnalyticsStatsRequest.java | 339 ++ .../GetDataFrameAnalyticsStatsResponse.java | 217 + .../ml/GetDatafeedStatsRequest.java | 269 + .../ml/GetDatafeedStatsResponse.java | 199 + .../elasticsearch/ml/GetDatafeedsRequest.java | 299 + .../ml/GetDatafeedsResponse.java | 198 + .../elasticsearch/ml/GetFiltersRequest.java | 260 + .../elasticsearch/ml/GetFiltersResponse.java | 198 + .../elasticsearch/ml/GetJobStatsRequest.java | 242 + .../elasticsearch/ml/GetJobStatsResponse.java | 198 + .../elasticsearch/ml/GetJobsRequest.java | 294 + .../elasticsearch/ml/GetJobsResponse.java | 196 + .../ml/GetOverallBucketsRequest.java | 475 ++ .../ml/GetOverallBucketsResponse.java | 208 + .../ml/GetTrainedModelsRequest.java | 421 ++ .../ml/GetTrainedModelsResponse.java | 214 + .../ml/GetTrainedModelsStatsRequest.java | 315 ++ .../ml/GetTrainedModelsStatsResponse.java | 225 + .../elasticsearch/ml/Hyperparameter.java | 284 + .../elasticsearch/ml/Hyperparameters.java | 690 +++ .../clients/elasticsearch/ml/Include.java | 80 + .../ml/InferTrainedModelRequest.java | 368 ++ .../ml/InferTrainedModelResponse.java | 176 + .../ml/InferenceConfigCreate.java | 469 ++ .../ml/InferenceConfigCreateBuilders.java | 229 + .../ml/InferenceConfigCreateVariant.java | 37 + .../ml/InferenceConfigUpdate.java | 471 ++ .../ml/InferenceConfigUpdateBuilders.java | 232 + .../ml/InferenceConfigUpdateVariant.java | 37 + .../ml/InferenceResponseResult.java | 581 ++ .../elastic/clients/elasticsearch/ml/Job.java | 1019 ++++ .../clients/elasticsearch/ml/JobBlocked.java | 171 + .../elasticsearch/ml/JobBlockedReason.java | 57 + .../clients/elasticsearch/ml/JobConfig.java | 833 +++ .../ml/JobForecastStatistics.java | 325 ++ .../clients/elasticsearch/ml/JobState.java | 82 + .../elasticsearch/ml/JobStatistics.java | 213 + .../clients/elasticsearch/ml/JobStats.java | 452 ++ .../elasticsearch/ml/JobTimingStats.java | 344 ++ .../elasticsearch/ml/MemoryStatus.java | 57 + .../elasticsearch/ml/ModelPlotConfig.java | 228 + .../elasticsearch/ml/ModelSizeStats.java | 656 +++ .../elasticsearch/ml/NerInferenceOptions.java | 295 + .../ml/NerInferenceUpdateOptions.java | 208 + .../ml/NlpBertTokenizationConfig.java | 300 + .../ml/NlpRobertaTokenizationConfig.java | 300 + .../ml/NlpTokenizationUpdateOptions.java | 187 + .../elasticsearch/ml/OpenJobRequest.java | 247 + .../elasticsearch/ml/OpenJobResponse.java | 175 + .../ml/OutlierDetectionParameters.java | 350 ++ .../elasticsearch/ml/OverallBucket.java | 359 ++ .../elasticsearch/ml/OverallBucketJob.java | 167 + .../clients/elasticsearch/ml/Page.java | 184 + .../ml/PassThroughInferenceOptions.java | 244 + .../ml/PassThroughInferenceUpdateOptions.java | 209 + .../ml/PerPartitionCategorization.java | 204 + .../ml/PostCalendarEventsRequest.java | 271 + .../ml/PostCalendarEventsResponse.java | 175 + .../ml/PreviewDataFrameAnalyticsRequest.java | 269 + .../ml/PreviewDataFrameAnalyticsResponse.java | 192 + .../ml/PreviewDatafeedRequest.java | 404 ++ .../ml/PreviewDatafeedResponse.java | 188 + .../ml/PutCalendarJobRequest.java | 205 + .../ml/PutCalendarJobResponse.java | 233 + .../elasticsearch/ml/PutCalendarRequest.java | 284 + .../elasticsearch/ml/PutCalendarResponse.java | 232 + .../ml/PutDataFrameAnalyticsRequest.java | 703 +++ .../ml/PutDataFrameAnalyticsResponse.java | 467 ++ .../elasticsearch/ml/PutDatafeedRequest.java | 1124 ++++ .../elasticsearch/ml/PutDatafeedResponse.java | 679 +++ .../elasticsearch/ml/PutFilterRequest.java | 292 + .../elasticsearch/ml/PutFilterResponse.java | 211 + .../elasticsearch/ml/PutJobRequest.java | 897 +++ .../elasticsearch/ml/PutJobResponse.java | 711 +++ .../ml/PutTrainedModelAliasRequest.java | 251 + .../ml/PutTrainedModelAliasResponse.java | 98 + .../PutTrainedModelDefinitionPartRequest.java | 334 ++ ...PutTrainedModelDefinitionPartResponse.java | 100 + .../ml/PutTrainedModelRequest.java | 603 ++ .../ml/PutTrainedModelResponse.java | 96 + .../ml/PutTrainedModelVocabularyRequest.java | 308 ++ .../ml/PutTrainedModelVocabularyResponse.java | 99 + .../ml/QuestionAnsweringInferenceOptions.java | 276 + ...estionAnsweringInferenceUpdateOptions.java | 306 ++ .../ml/RegressionInferenceOptions.java | 223 + .../elasticsearch/ml/ResetJobRequest.java | 236 + .../elasticsearch/ml/ResetJobResponse.java | 96 + .../elasticsearch/ml/RoutingState.java | 77 + .../clients/elasticsearch/ml/RuleAction.java | 67 + .../elasticsearch/ml/RuleCondition.java | 210 + .../ml/RunningStateSearchInterval.java | 263 + .../ml/StartDataFrameAnalyticsRequest.java | 232 + .../ml/StartDataFrameAnalyticsResponse.java | 185 + .../ml/StartDatafeedRequest.java | 331 ++ .../ml/StartDatafeedResponse.java | 207 + .../StartTrainedModelDeploymentRequest.java | 429 ++ .../StartTrainedModelDeploymentResponse.java | 155 + .../ml/StopDataFrameAnalyticsRequest.java | 305 ++ .../ml/StopDataFrameAnalyticsResponse.java | 146 + .../elasticsearch/ml/StopDatafeedRequest.java | 319 ++ .../ml/StopDatafeedResponse.java | 143 + .../ml/StopTrainedModelDeploymentRequest.java | 250 + .../StopTrainedModelDeploymentResponse.java | 147 + .../TextClassificationInferenceOptions.java | 300 + ...tClassificationInferenceUpdateOptions.java | 300 + .../ml/TextEmbeddingInferenceOptions.java | 242 + .../TextEmbeddingInferenceUpdateOptions.java | 204 + .../ml/TextExpansionInferenceOptions.java | 208 + .../TextExpansionInferenceUpdateOptions.java | 204 + .../clients/elasticsearch/ml/TimingStats.java | 180 + .../elasticsearch/ml/TokenizationConfig.java | 248 + .../ml/TokenizationConfigBuilders.java | 93 + .../ml/TokenizationConfigVariant.java | 37 + .../ml/TokenizationTruncate.java | 57 + .../elasticsearch/ml/TopClassEntry.java | 191 + .../ml/TotalFeatureImportance.java | 285 + .../ml/TotalFeatureImportanceClass.java | 219 + .../ml/TotalFeatureImportanceStatistics.java | 215 + .../ml/TrainedModelAssignment.java | 304 ++ .../TrainedModelAssignmentRoutingTable.java | 238 + .../TrainedModelAssignmentTaskParameters.java | 348 ++ .../elasticsearch/ml/TrainedModelConfig.java | 793 +++ .../ml/TrainedModelConfigInput.java | 174 + .../ml/TrainedModelConfigMetadata.java | 372 ++ ...rainedModelDeploymentAllocationStatus.java | 208 + .../ml/TrainedModelDeploymentNodesStats.java | 459 ++ .../ml/TrainedModelDeploymentStats.java | 591 ++ .../ml/TrainedModelEntities.java | 242 + .../TrainedModelInferenceClassImportance.java | 173 + ...rainedModelInferenceFeatureImportance.java | 236 + .../ml/TrainedModelInferenceStats.java | 276 + .../ml/TrainedModelLocation.java | 151 + .../ml/TrainedModelLocationIndex.java | 146 + .../ml/TrainedModelSizeStats.java | 179 + .../elasticsearch/ml/TrainedModelStats.java | 361 ++ .../elasticsearch/ml/TrainedModelType.java | 67 + .../elasticsearch/ml/TrainingPriority.java | 55 + .../ml/TransformAuthorization.java | 257 + .../ml/UpdateDataFrameAnalyticsRequest.java | 359 ++ .../ml/UpdateDataFrameAnalyticsResponse.java | 468 ++ .../ml/UpdateDatafeedRequest.java | 1113 ++++ .../ml/UpdateDatafeedResponse.java | 680 +++ .../elasticsearch/ml/UpdateFilterRequest.java | 338 ++ .../ml/UpdateFilterResponse.java | 213 + .../elasticsearch/ml/UpdateJobRequest.java | 879 +++ .../elasticsearch/ml/UpdateJobResponse.java | 757 +++ .../elasticsearch/ml/ValidationLoss.java | 200 + .../clients/elasticsearch/ml/Vocabulary.java | 142 + ...eroShotClassificationInferenceOptions.java | 386 ++ ...tClassificationInferenceUpdateOptions.java | 297 + .../ConfusionMatrixItem.java | 252 + .../ConfusionMatrixPrediction.java | 171 + .../ConfusionMatrixThreshold.java | 233 + .../DataframeClassificationSummary.java | 346 ++ ...ataframeClassificationSummaryAccuracy.java | 203 + ...ationSummaryMulticlassConfusionMatrix.java | 205 + ...taframeClassificationSummaryPrecision.java | 203 + .../DataframeClassificationSummaryRecall.java | 203 + .../DataframeEvaluationClass.java | 131 + .../DataframeEvaluationSummaryAucRoc.java | 165 + ...frameEvaluationSummaryAucRocCurveItem.java | 195 + .../DataframeEvaluationValue.java | 153 + .../DataframeOutlierDetectionSummary.java | 358 ++ .../DataframeRegressionSummary.java | 302 ++ .../ml/get_calendars/Calendar.java | 230 + .../DataframePreviewConfig.java | 285 + .../ml/put_trained_model/AggregateOutput.java | 262 + .../ml/put_trained_model/Definition.java | 218 + .../ml/put_trained_model/Ensemble.java | 329 ++ .../FrequencyEncodingPreprocessor.java | 226 + .../ml/put_trained_model/Input.java | 164 + .../OneHotEncodingPreprocessor.java | 201 + .../ml/put_trained_model/Preprocessor.java | 248 + .../PreprocessorBuilders.java | 93 + .../PreprocessorVariant.java | 37 + .../TargetMeanEncodingPreprocessor.java | 250 + .../ml/put_trained_model/TrainedModel.java | 262 + .../put_trained_model/TrainedModelTree.java | 293 + .../TrainedModelTreeNode.java | 381 ++ .../ml/put_trained_model/Weights.java | 141 + .../clients/elasticsearch/nodes/Client.java | 486 ++ .../clients/elasticsearch/nodes/Context.java | 235 + .../clients/elasticsearch/nodes/Http.java | 260 + .../clients/elasticsearch/nodes/Ingest.java | 224 + .../elasticsearch/nodes/IngestTotal.java | 315 ++ .../elasticsearch/nodes/KeyedProcessor.java | 183 + .../nodes/NodesResponseBase.java | 135 + .../elasticsearch/nodes/Processor.java | 250 + .../elasticsearch/nodes/Scripting.java | 328 ++ .../elasticsearch/nodes/ThreadCount.java | 316 ++ .../DeleteQueryRulesetRequest.java | 170 + .../DeleteQueryRulesetResponse.java | 97 + .../ElasticsearchQueryRulesetAsyncClient.java | 202 + .../ElasticsearchQueryRulesetClient.java | 208 + .../query_ruleset/GetQueryRulesetRequest.java | 170 + .../GetQueryRulesetResponse.java | 96 + .../query_ruleset/ListRequest.java | 181 + .../query_ruleset/ListResponse.java | 197 + .../query_ruleset/PutRequest.java | 225 + .../query_ruleset/PutResponse.java | 142 + .../query_ruleset/QueryRule.java | 249 + .../query_ruleset/QueryRuleActions.java | 219 + .../query_ruleset/QueryRuleCriteria.java | 213 + .../query_ruleset/QueryRuleCriteriaType.java | 72 + .../query_ruleset/QueryRuleType.java | 54 + .../query_ruleset/QueryRuleset.java | 217 + .../list/QueryRulesetListItem.java | 178 + .../AnalyticsCollection.java | 157 + .../DeleteBehavioralAnalyticsRequest.java | 173 + .../DeleteBehavioralAnalyticsResponse.java | 99 + .../DeleteSearchApplicationRequest.java | 173 + .../DeleteSearchApplicationResponse.java | 99 + ...ticsearchSearchApplicationAsyncClient.java | 391 ++ .../ElasticsearchSearchApplicationClient.java | 401 ++ .../search_application/EventDataStream.java | 143 + .../GetBehavioralAnalyticsRequest.java | 199 + .../GetBehavioralAnalyticsResponse.java | 181 + .../GetSearchApplicationRequest.java | 171 + .../GetSearchApplicationResponse.java | 96 + .../search_application/ListRequest.java | 212 + .../search_application/ListResponse.java | 200 + .../PutBehavioralAnalyticsRequest.java | 172 + .../PutBehavioralAnalyticsResponse.java | 99 + .../search_application/PutRequest.java | 258 + .../search_application/PutResponse.java | 142 + .../search_application/SearchApplication.java | 315 ++ .../SearchApplicationSearchRequest.java | 259 + .../SearchApplicationSearchResponse.java | 114 + .../SearchApplicationTemplate.java | 153 + .../list/SearchApplicationListItem.java | 264 + .../AnalyticsAcknowledgeResponseBase.java | 103 + .../elasticsearch/security/ApiKey.java | 592 ++ .../ApplicationGlobalUserPrivileges.java | 153 + .../security/ApplicationPrivileges.java | 254 + .../security/AuthenticateRequest.java | 92 + .../security/AuthenticateResponse.java | 478 ++ .../security/ClearApiKeyCacheRequest.java | 196 + .../security/ClearApiKeyCacheResponse.java | 233 + .../elasticsearch/security/ClusterNode.java | 142 + .../security/CreateApiKeyRequest.java | 420 ++ .../security/CreateApiKeyResponse.java | 271 + .../ElasticsearchSecurityAsyncClient.java | 324 ++ .../security/ElasticsearchSecurityClient.java | 329 ++ .../elasticsearch/security/FieldSecurity.java | 208 + .../security/GetApiKeyRequest.java | 333 ++ .../security/GetApiKeyResponse.java | 171 + .../security/GlobalPrivilege.java | 149 + .../security/IndexPrivilege.java | 89 + .../security/IndicesPrivileges.java | 367 ++ .../security/InvalidateApiKeyRequest.java | 395 ++ .../security/InvalidateApiKeyResponse.java | 295 + .../security/ManageUserPrivileges.java | 167 + .../security/QueryApiKeysRequest.java | 451 ++ .../security/QueryApiKeysResponse.java | 239 + .../elasticsearch/security/RealmInfo.java | 166 + .../security/RoleDescriptor.java | 511 ++ .../security/RoleTemplateInlineQuery.java | 180 + .../RoleTemplateInlineQueryBuilders.java | 49 + .../security/RoleTemplateInlineScript.java | 227 + .../security/RoleTemplateScript.java | 178 + .../security/RoleTemplateScriptBuilders.java | 53 + .../security/TransientMetadataConfig.java | 145 + .../security/UpdateApiKeyRequest.java | 367 ++ .../security/UpdateApiKeyResponse.java | 150 + .../security/authenticate/ServiceToken.java | 172 + .../synonyms/DeleteSynonymRequest.java | 170 + .../synonyms/DeleteSynonymResponse.java | 97 + .../synonyms/DeleteSynonymRuleRequest.java | 202 + .../synonyms/DeleteSynonymRuleResponse.java | 97 + .../ElasticsearchSynonymsAsyncClient.java | 303 ++ .../synonyms/ElasticsearchSynonymsClient.java | 311 ++ .../synonyms/GetSynonymRequest.java | 231 + .../synonyms/GetSynonymResponse.java | 199 + .../synonyms/GetSynonymRuleRequest.java | 202 + .../synonyms/GetSynonymRuleResponse.java | 97 + .../synonyms/GetSynonymsSetsRequest.java | 184 + .../synonyms/GetSynonymsSetsResponse.java | 201 + .../synonyms/PutSynonymRequest.java | 260 + .../synonyms/PutSynonymResponse.java | 176 + .../synonyms/PutSynonymRuleRequest.java | 276 + .../synonyms/PutSynonymRuleResponse.java | 97 + .../elasticsearch/synonyms/SynonymRule.java | 183 + .../synonyms/SynonymRuleRead.java | 188 + .../synonyms/SynonymsUpdateResult.java | 160 + .../get_synonyms_sets/SynonymsSetItem.java | 176 + .../clients/elasticsearch/tasks/TaskInfo.java | 501 ++ .../transform/DeleteTransformRequest.java | 247 + .../transform/DeleteTransformResponse.java | 98 + .../elasticsearch/transform/Destination.java | 190 + .../ElasticsearchTransformAsyncClient.java | 444 ++ .../ElasticsearchTransformClient.java | 459 ++ .../transform/GetTransformRequest.java | 354 ++ .../transform/GetTransformResponse.java | 200 + .../transform/GetTransformStatsRequest.java | 352 ++ .../transform/GetTransformStatsResponse.java | 201 + .../elasticsearch/transform/Latest.java | 203 + .../elasticsearch/transform/Pivot.java | 270 + .../elasticsearch/transform/PivotGroupBy.java | 280 + .../transform/PivotGroupByBuilders.java | 115 + .../transform/PivotGroupByVariant.java | 37 + .../transform/PreviewTransformRequest.java | 660 +++ .../transform/PreviewTransformResponse.java | 231 + .../transform/PutTransformRequest.java | 747 +++ .../transform/PutTransformResponse.java | 97 + .../transform/ResetTransformRequest.java | 213 + .../transform/ResetTransformResponse.java | 98 + .../transform/RetentionPolicy.java | 183 + .../transform/RetentionPolicyBuilders.java | 54 + .../transform/RetentionPolicyVariant.java | 37 + .../ScheduleNowTransformRequest.java | 217 + .../ScheduleNowTransformResponse.java | 98 + .../elasticsearch/transform/Settings.java | 351 ++ .../elasticsearch/transform/Source.java | 313 ++ .../transform/StartTransformRequest.java | 271 + .../transform/StartTransformResponse.java | 98 + .../transform/StopTransformRequest.java | 374 ++ .../transform/StopTransformResponse.java | 97 + .../clients/elasticsearch/transform/Sync.java | 180 + .../elasticsearch/transform/SyncBuilders.java | 52 + .../elasticsearch/transform/SyncVariant.java | 37 + .../transform/TimeRetentionPolicy.java | 201 + .../elasticsearch/transform/TimeSync.java | 203 + .../transform/UpdateTransformRequest.java | 636 +++ .../transform/UpdateTransformResponse.java | 581 ++ .../get_transform/TransformSummary.java | 659 +++ .../get_transform_stats/CheckpointStats.java | 296 + .../get_transform_stats/Checkpointing.java | 303 ++ .../TransformIndexerStats.java | 546 ++ .../TransformProgress.java | 239 + .../get_transform_stats/TransformStats.java | 294 + .../TransformStatsHealth.java | 145 + .../watcher/ActionStatusOptions.java | 60 + .../src/main/java/co/elastic/clients/json | 1 + .../main/java/co/elastic/clients/transport | 1 + .../src/main/java/co/elastic/clients/util | 1 + .../ElasticsearchServerTest.java | 523 ++ .../src/test/java/co/elastic/clients/testkit | 1 + .../clients/transport/VersionInfoTest.java | 38 + java-client/build.gradle.kts | 40 +- .../clients/transport/VersionInfo.java | 26 + .../transport/ElasticsearchTransportBase.java | 37 +- .../co/elastic/clients/transport/Version.java | 69 +- .../transport/endpoints/EndpointBase.java | 38 +- .../transport/endpoints/SimpleEndpoint.java | 5 - .../api_conventions/LoadingJsonTest.java | 2 +- .../documentation/usage/AggregationsTest.java | 2 +- .../documentation/usage/IndexingBulkTest.java | 2 +- .../documentation/usage/IndexingTest.java | 2 +- .../documentation/usage/ReadingTest.java | 2 +- .../elasticsearch/end_to_end/RequestTest.java | 2 +- .../experiments/containers/SomeUnionTest.java | 2 +- .../elasticsearch/model/BehaviorsTest.java | 1 + .../elasticsearch/model/BuiltinTypesTest.java | 1 + .../model/ClassStructureTest.java | 1 + .../clients/elasticsearch/model/EnumTest.java | 1 + .../model/RequestEncodingTest.java | 1 + .../model/SerializationTest.java | 1 + .../elasticsearch/model/TypedKeysTest.java | 1 + .../elasticsearch/model/UnionTests.java | 1 + .../elasticsearch/model/VariantsTest.java | 1 + .../spec_issues/SpecIssuesTest.java | 2 +- .../co/elastic/clients/json/JsonDataTest.java | 2 +- .../json/JsonpDeserializerBaseTest.java | 2 +- .../clients/json/JsonpDeserializerTest.java | 3 +- .../json/JsonpMappingExceptionTest.java | 2 +- .../elastic/clients/json/JsonpUtilsTest.java | 2 +- .../json/ObjectBuilderDeserializerTest.java | 2 +- .../co/elastic/clients/json/WithJsonTest.java | 2 +- .../json/jackson/JacksonJsonpParserTest.java | 2 +- .../json/jackson/JacksonMapperTest.java | 3 +- .../clients/json/jackson/JsonEnumTest.java | 2 +- .../model => testkit}/ModelTestCase.java | 2 +- .../clients/transport/VersionInfoTest.java | 36 + .../transport/endpoints/EndpointBaseTest.java | 30 +- .../co/elastic/clients/util/DateTimeTest.java | 2 +- .../elastic/clients/util/NamedValueTest.java | 2 +- .../co/elastic/clients/util/PairTest.java | 2 +- 1786 files changed, 439121 insertions(+), 92 deletions(-) create mode 100644 config/version-serverless.txt create mode 100644 java-client-serverless/build.gradle.kts create mode 100644 java-client-serverless/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java create mode 120000 java-client-serverless/src/main/java/co/elastic/clients/ApiClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java create mode 120000 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_helpers create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/AcknowledgedResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/AcknowledgedResponseBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/BulkIndexByScrollFailure.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Bytes.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterDetails.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterInfoTarget.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterSearchStatusEnum.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterStatistics.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/CompletionStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Conflicts.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/CoordsGeoBounds.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFIIndependenceMeasure.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFRAfterEffect.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFRBasicModel.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DistanceUnit.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DocStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchVersionInfo.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/EmptyObject.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorCause.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ExpandWildcard.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldMemoryUsage.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSizeUsage.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSort.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSortNumericType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldValue.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FielddataStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoBounds.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoBoundsBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceSort.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashLocation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashPrecision.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashPrecisionBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLine.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLocation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLocationBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoShapeRelation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/HealthStatus.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IBDistribution.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IBLambda.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IndicesOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IndicesResponseBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineGet.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineScript.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/LatLonGeoLocation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/NestedSortValue.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/NodeStatistics.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Normalization.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/OpType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/PluginStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryCacheStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilder.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilderBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilderVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Rank.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RankBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RankBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RankVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Refresh.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RequestBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Result.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Retries.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RrfRank.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ScoreSort.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Script.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ScriptBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ScriptBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ScriptField.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ScriptLanguage.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ScriptSort.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ScriptSortType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SearchType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SegmentsStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ShardFailure.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ShardStatistics.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SlicedScroll.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Slices.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SlicesBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SlicesCalculation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SortMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SortOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SortOptionsBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SortOptionsVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SortOrder.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/StoreStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/StoredScript.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/StoredScriptId.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/SuggestMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/TextEmbedding.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Time.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/TimeBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/TimeUnit.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/TopLeftBottomRightGeoBounds.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/TopRightBottomLeftGeoBounds.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/VersionType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/WaitForActiveShardOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/WaitForActiveShards.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/WaitForActiveShardsBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/WktGeoBounds.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/WriteResponseBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AdjacencyMatrixAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AdjacencyMatrixAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AdjacencyMatrixBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/Aggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregateBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregateBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregateVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/Aggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregationBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregationBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregationRange.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AggregationVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ArrayPercentilesItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AutoDateHistogramAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AutoDateHistogramAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AverageAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AverageBucketAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/AvgAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BoxPlotAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BoxplotAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketAggregationBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketCorrelationAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketCorrelationFunction.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketCorrelationFunctionCountCorrelation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketCorrelationFunctionCountCorrelationIndicator.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketKsAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketMetricValueAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketPathAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketScriptAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketSelectorAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketSortAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/Buckets.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketsBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketsPath.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/BucketsPathBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CalendarInterval.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CardinalityAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CardinalityAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CardinalityExecutionMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CategorizeTextAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CategorizeTextAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CategorizeTextAnalyzerBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ChiSquareHeuristic.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ChildrenAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ChildrenAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregationBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeAggregationSource.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeDateHistogramAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeGeoTileGridAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeHistogramAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CompositeTermsAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CumulativeCardinalityAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CumulativeCardinalityAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CumulativeSumAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/CustomCategorizeTextAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateHistogramAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateHistogramAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateHistogramBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateRangeAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateRangeAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DateRangeExpression.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DerivativeAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DerivativeAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DiversifiedSamplerAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DoubleTermsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/DoubleTermsBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/EwmaModelSettings.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/EwmaMovingAverageAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ExtendedBounds.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ExtendedStatsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ExtendedStatsAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ExtendedStatsBucketAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ExtendedStatsBucketAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FieldDateMath.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FieldDateMathBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FilterAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FiltersAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FiltersAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FiltersBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FormatMetricAggregationBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FormattableMetricAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FrequentItemSetsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FrequentItemSetsAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FrequentItemSetsBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/FrequentItemSetsField.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GapPolicy.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoBoundsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoBoundsAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoCentroidAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoCentroidAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoDistanceAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoDistanceAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoHashGridAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoHashGridAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoHashGridBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoHexGridAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoHexGridBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoLineAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoLineAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoLinePoint.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoLineSort.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoTileGridAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoTileGridAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeoTileGridBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GeohexGridAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GlobalAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GlobalAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/GoogleNormalizedDistanceHeuristic.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HdrMethod.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HdrPercentileRanksAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HdrPercentilesAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HistogramAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HistogramAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HistogramBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HoltLinearModelSettings.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HoltMovingAverageAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HoltWintersModelSettings.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HoltWintersMovingAverageAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/HoltWintersType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/InferenceAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/InferenceAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/InferenceClassImportance.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/InferenceConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/InferenceConfigBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/InferenceConfigVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/InferenceFeatureImportance.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/InferenceTopClassEntry.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpPrefixAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpPrefixAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpPrefixBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpRangeAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpRangeAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpRangeAggregationRange.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/IpRangeBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/LinearMovingAverageAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/LongRareTermsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/LongRareTermsBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/LongTermsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/LongTermsBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MatrixAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MatrixStatsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MatrixStatsAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MatrixStatsFields.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MaxAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MaxAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MaxBucketAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MedianAbsoluteDeviationAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MedianAbsoluteDeviationAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MetricAggregationBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MinAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MinAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MinBucketAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MinimumInterval.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MissingAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MissingAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MissingOrder.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MovingAverageAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MovingAverageAggregationBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MovingAverageAggregationBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MovingAverageAggregationVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MovingFunctionAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MovingPercentilesAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiBucketAggregateBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiBucketBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermLookup.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MultiTermsBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/MutualInformationHeuristic.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/NestedAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/NestedAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/NormalizeAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/NormalizeMethod.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ParentAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ParentAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/PercentageScoreHeuristic.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/PercentileRanksAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/Percentiles.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/PercentilesAggregateBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/PercentilesAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/PercentilesBucketAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/PercentilesBucketAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/PercentilesBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/PipelineAggregationBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RangeAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RangeAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RangeBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RareTermsAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RateAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RateAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/RateMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ReverseNestedAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ReverseNestedAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SamplerAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SamplerAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SamplerAggregationExecutionHint.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ScriptedHeuristic.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ScriptedMetricAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ScriptedMetricAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SerialDifferencingAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantLongTermsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantLongTermsBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantStringTermsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantStringTermsBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantTermsAggregateBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantTermsAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantTermsBucketBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SignificantTextAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SimpleMovingAverageAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SimpleValueAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SingleBucketAggregateBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SingleMetricAggregateBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StandardDeviationBounds.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StandardDeviationBoundsAsString.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StatsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StatsAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StatsBucketAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StatsBucketAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StringRareTermsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StringRareTermsBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StringStatsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StringStatsAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StringTermsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/StringTermsBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SumAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SumAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/SumBucketAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TDigest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TDigestPercentileRanksAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TDigestPercentilesAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TTestAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TTestAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TTestType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsAggregateBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsAggregationCollectMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsAggregationExecutionHint.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsBucketBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsExclude.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsExcludeBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsInclude.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsIncludeBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TermsPartition.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TestPopulation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TopHitsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TopHitsAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TopMetrics.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TopMetricsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TopMetricsAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/TopMetricsValue.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/UnmappedRareTermsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/UnmappedSamplerAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/UnmappedSignificantTermsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/UnmappedTermsAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ValueCountAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ValueCountAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/ValueType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/VariableWidthHistogramAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/VariableWidthHistogramAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/VariableWidthHistogramBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/WeightedAverageAggregation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/WeightedAverageValue.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/aggregations/WeightedAvgAggregate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/Analyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/AnalyzerBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/AnalyzerVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/AsciiFoldingTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CharFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CharFilterBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CharFilterBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CharFilterDefinition.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CharFilterDefinitionBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CharFilterDefinitionVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CharGroupTokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CommonGramsTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CompoundWordTokenFilterBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ConditionTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CustomAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/CustomNormalizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/DelimitedPayloadEncoding.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/DelimitedPayloadTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/DictionaryDecompounderTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/DutchAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/EdgeNGramSide.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/EdgeNGramTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/EdgeNGramTokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ElisionTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/FingerprintAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/FingerprintTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/HtmlStripCharFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/HunspellTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/HyphenationDecompounderTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuCollationAlternate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuCollationCaseFirst.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuCollationDecomposition.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuCollationStrength.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuCollationTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuFoldingTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuNormalizationCharFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuNormalizationMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuNormalizationTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuNormalizationType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuTokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuTransformDirection.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/IcuTransformTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/KStemTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/KeepTypesMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/KeepTypesTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/KeepWordsTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/KeywordAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/KeywordMarkerTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/KeywordTokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/KuromojiAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/KuromojiIterationMarkCharFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/KuromojiPartOfSpeechTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/KuromojiReadingFormTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/KuromojiStemmerTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/KuromojiTokenizationMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/KuromojiTokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/Language.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/LanguageAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/LengthTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/LetterTokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/LimitTokenCountTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/LowercaseNormalizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/LowercaseTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/LowercaseTokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/MappingCharFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/MultiplexerTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NGramTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NGramTokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NoriAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NoriDecompoundMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NoriPartOfSpeechTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NoriTokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/Normalizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NormalizerBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/NormalizerVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PathHierarchyTokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PatternAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PatternCaptureTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PatternReplaceCharFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PatternReplaceTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PatternTokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PhoneticEncoder.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PhoneticLanguage.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PhoneticNameType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PhoneticRuleType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PhoneticTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PorterStemTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/PredicateTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/RemoveDuplicatesTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ReverseTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/ShingleTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SimpleAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SnowballAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SnowballLanguage.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SnowballTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/StandardAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/StandardTokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/StemmerOverrideTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/StemmerTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/StopAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/StopTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SynonymFormat.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SynonymGraphTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/SynonymTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TokenChar.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TokenFilterBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TokenFilterBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TokenFilterDefinition.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TokenFilterDefinitionBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TokenFilterDefinitionVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/Tokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TokenizerBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TokenizerBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TokenizerDefinition.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TokenizerDefinitionBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TokenizerDefinitionVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TrimTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/TruncateTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/UaxEmailUrlTokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/UniqueTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/UppercaseTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/WhitespaceAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/WhitespaceTokenizer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/WordDelimiterGraphTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/analysis/WordDelimiterTokenFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/AggregateMetricDoubleProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/AllField.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/BinaryProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/BooleanProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ByteNumberProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/CompletionProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ConstantKeywordProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/CorePropertyBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DataStreamTimestamp.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DateNanosProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DateProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DateRangeProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DenseVectorIndexOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DenseVectorProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DocValuesPropertyBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DoubleNumberProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DoubleRangeProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicMapping.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/DynamicTemplate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/FieldAliasProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/FieldNamesField.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/FieldType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/FlattenedProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/FloatNumberProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/FloatRangeProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/GeoOrientation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/GeoPointProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/GeoShapeProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/GeoStrategy.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/HalfFloatNumberProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/HistogramProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/IndexField.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/IndexOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/IntegerNumberProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/IntegerRangeProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/IpProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/IpRangeProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/JoinProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/KeywordProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/LongNumberProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/LongRangeProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/MatchOnlyTextProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/MatchType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/Murmur3HashProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/NestedProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/NumberPropertyBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ObjectProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/OnScriptError.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PercolatorProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PointProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/Property.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/PropertyVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RangePropertyBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RankFeatureProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RankFeaturesProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RoutingField.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RuntimeField.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RuntimeFieldFetchFields.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/RuntimeFieldType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ScaledFloatNumberProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SearchAsYouTypeProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ShapeProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/ShortNumberProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SizeField.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SourceField.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SourceFieldMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/SuggestContext.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TermVectorOption.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TextIndexPrefixes.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TextProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TimeSeriesMetricType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TokenCountProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/TypeMapping.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/UnsignedLongNumberProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/VersionProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/mapping/WildcardProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/BoolQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/BoostingQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/ChildScoreMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/CombinedFieldsOperator.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/CombinedFieldsQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/CombinedFieldsZeroTerms.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/CommonTermsQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/ConstantScoreQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/DecayFunction.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/DecayFunctionBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/DecayPlacement.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/DisMaxQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/DistanceFeatureQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/ExistsQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/FieldAndFormat.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/FieldLookup.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/FieldValueFactorModifier.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/FieldValueFactorScoreFunction.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/FunctionBoostMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/FunctionScore.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/FunctionScoreBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/FunctionScoreMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/FunctionScoreQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/FunctionScoreVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/FuzzyQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoBoundingBoxQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoDistanceQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoExecution.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoPolygonPoints.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoPolygonQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoShapeFieldQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoShapeQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/GeoValidationMethod.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/HasChildQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/HasParentQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IdsQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Intervals.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IntervalsAllOf.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IntervalsAnyOf.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IntervalsBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IntervalsFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IntervalsFilterBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IntervalsFilterVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IntervalsFuzzy.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IntervalsMatch.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IntervalsPrefix.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IntervalsQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IntervalsQueryBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IntervalsQueryVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IntervalsVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/IntervalsWildcard.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Like.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/LikeBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/LikeDocument.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchAllQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchBoolPrefixQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchNoneQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchPhrasePrefixQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchPhraseQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MatchQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MoreLikeThisQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MultiMatchQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/MultiValueMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/NestedQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Operator.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/ParentIdQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/PercolateQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/PinnedDoc.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/PinnedQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/PinnedQueryBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/PinnedQueryVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/PrefixQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/Query.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryStringQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/QueryVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RandomScoreFunction.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RangeQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RangeQueryBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RangeRelation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RankFeatureFunction.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RankFeatureFunctionLinear.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RankFeatureFunctionLogarithm.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RankFeatureFunctionSaturation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RankFeatureFunctionSigmoid.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RankFeatureQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RegexpQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/RuleQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/ScriptQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/ScriptScoreFunction.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/ScriptScoreQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/ShapeFieldQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/ShapeQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SimpleQueryStringFlag.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SimpleQueryStringQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanContainingQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanFieldMaskingQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanFirstQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanGapQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanMultiTermQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanNearQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanNotQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanOrQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanQueryBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanQueryVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanTermQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/SpanWithinQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermsLookup.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermsQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermsQueryField.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermsQueryFieldBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TermsSetQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TextExpansionQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TextQueryType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/TypeQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/WildcardQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/WrapperQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/query_dsl/ZeroTermsQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearch.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearchDocumentResponseBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearchResponseBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearchStatusRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/AsyncSearchStatusResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/DeleteAsyncSearchRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/DeleteAsyncSearchResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/ElasticsearchAsyncSearchAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/ElasticsearchAsyncSearchClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/GetAsyncSearchRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/GetAsyncSearchResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/SubmitResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/async_search/status/StatusResponseBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/AliasesRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/AliasesResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/CatAnomalyDetectorColumn.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/CatDatafeedColumn.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/CatDfaColumn.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/CatRequestBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/CatTrainedModelsColumn.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/CatTransformColumn.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ComponentTemplatesRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ComponentTemplatesResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/CountRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/CountResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ElasticsearchCatClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/HelpRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/HelpResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/IndicesRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/IndicesResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/MlDataFrameAnalyticsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/MlDataFrameAnalyticsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/MlDatafeedsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/MlDatafeedsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/MlJobsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/MlJobsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/MlTrainedModelsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/MlTrainedModelsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/TransformsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/TransformsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/aliases/AliasesRecord.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/component_templates/ComponentTemplate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/count/CountRecord.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/help/HelpRecord.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/indices/IndicesRecord.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ml_data_frame_analytics/DataFrameAnalyticsRecord.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ml_datafeeds/DatafeedsRecord.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ml_jobs/JobsRecord.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/ml_trained_models/TrainedModelsRecord.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cat/transforms/TransformsRecord.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ClusterInfoRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ClusterInfoResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ClusterStatsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ClusterStatsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ComponentTemplate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ComponentTemplateNode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ComponentTemplateSummary.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/DeleteComponentTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/DeleteComponentTemplateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ElasticsearchClusterAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ElasticsearchClusterClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/ExistsComponentTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/GetClusterSettingsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/GetClusterSettingsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/GetComponentTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/GetComponentTemplateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PendingTasksRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PendingTasksResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PutClusterSettingsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PutClusterSettingsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PutComponentTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/PutComponentTemplateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/pending_tasks/PendingTask.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/CharFilterTypes.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterFileSystem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIndices.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIndicesShards.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIndicesShardsIndex.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterIngest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterJvm.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterJvmMemory.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterJvmVersion.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterNetworkTypes.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterNodeCount.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterNodes.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystemArchitecture.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystemName.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterOperatingSystemPrettyName.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcess.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcessCpu.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcessOpenFileDescriptors.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/ClusterShardMetrics.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/FieldTypes.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/FieldTypesMappings.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndexingPressure.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndexingPressureMemory.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndexingPressureMemorySummary.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/IndicesVersions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/NodePackagingType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/OperatingSystemMemoryInfo.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/RuntimeFieldTypes.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/cluster/stats/StatsResponseBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/BulkRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/BulkResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ClearScrollRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ClearScrollResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ClosePointInTimeRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ClosePointInTimeResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/CountRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/CountResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/CreateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/CreateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/DeleteByQueryRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/DeleteByQueryResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/DeleteRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/DeleteResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/DeleteScriptRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/DeleteScriptResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ExistsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ExistsSourceRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/FieldCapsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/FieldCapsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/GetRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/GetResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/GetScriptRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/GetScriptResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/GetSourceRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/GetSourceResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/IndexRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/IndexResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/InfoRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/InfoResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MgetRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MgetResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MsearchRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MsearchResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MsearchTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MsearchTemplateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MtermvectorsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/MtermvectorsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/OpenPointInTimeRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/OpenPointInTimeResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/PingRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/PutScriptRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/PutScriptResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/RankEvalRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/RankEvalResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/RenderSearchTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/RenderSearchTemplateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ScriptsPainlessExecuteRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ScriptsPainlessExecuteResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ScrollRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/ScrollResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/SearchMvtRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/SearchRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/SearchResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/SearchTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/SearchTemplateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/TermsEnumRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/TermsEnumResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/TermvectorsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/TermvectorsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/UpdateByQueryRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/UpdateByQueryResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/UpdateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/UpdateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/BulkOperation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/BulkOperationBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/BulkOperationBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/BulkOperationVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/BulkResponseItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/CreateOperation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/DeleteOperation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/IndexOperation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/OperationType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/UpdateAction.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/UpdateOperation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/bulk/WriteOperation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/explain/Explanation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/explain/ExplanationDetail.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/field_caps/FieldCapability.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/get/GetResult.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/mget/MultiGetError.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/mget/MultiGetOperation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/mget/MultiGetResponseItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/mget/MultiGetResponseItemBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultiSearchItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultiSearchResponseItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultiSearchResponseItemBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultiSearchResult.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultisearchBody.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/MultisearchHeader.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch/RequestItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch_template/RequestItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/msearch_template/TemplateConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/mtermvectors/MultiTermVectorsOperation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/mtermvectors/MultiTermVectorsResult.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/DocumentRating.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalHit.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalHitItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetric.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricDetail.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricDiscountedCumulativeGain.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricExpectedReciprocalRank.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricMeanReciprocalRank.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricPrecision.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricRatingTreshold.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalMetricRecall.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/RankEvalRequestItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/rank_eval/UnratedDocument.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/reindex/Destination.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/reindex/RemoteSource.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/reindex/Source.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/scripts_painless_execute/PainlessContextSetup.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/AggregationBreakdown.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/AggregationProfile.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/AggregationProfileDebug.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/AggregationProfileDelegateDebugFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/BoundaryScanner.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Collector.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/CompletionContext.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/CompletionSuggest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/CompletionSuggestOption.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/CompletionSuggester.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Context.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/ContextBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/DirectGenerator.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/FetchProfile.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/FetchProfileBreakdown.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/FetchProfileDebug.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/FieldCollapse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/FieldSuggester.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/FieldSuggesterBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/FieldSuggesterVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Highlight.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlightBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlightField.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlighterEncoder.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlighterFragmenter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlighterOrder.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlighterTagsSchema.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/HighlighterType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Hit.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/HitsMetadata.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/InnerHits.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/InnerHitsResult.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/LaplaceSmoothingModel.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/LinearInterpolationSmoothingModel.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/NestedIdentity.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/PhraseSuggest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/PhraseSuggestCollate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/PhraseSuggestCollateQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/PhraseSuggestHighlight.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/PhraseSuggestOption.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/PhraseSuggester.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/PointInTimeReference.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Profile.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/QueryBreakdown.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/QueryProfile.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/RegexOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Rescore.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/RescoreQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/ResponseBody.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/ScoreMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SearchProfile.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/ShardProfile.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SmoothingModel.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SmoothingModelBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SmoothingModelVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SourceConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SourceConfigBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SourceConfigParam.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SourceConfigParamBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SourceFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/StringDistance.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/StupidBackoffSmoothingModel.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SuggestBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SuggestFuzziness.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SuggestSort.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Suggester.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SuggesterBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/Suggestion.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SuggestionBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/SuggestionVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/TermSuggest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/TermSuggestOption.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/TermSuggester.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/TotalHits.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/TotalHitsRelation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/TrackHits.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search/TrackHitsBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search_mvt/GridAggregationType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/search_mvt/GridType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/termvectors/FieldStatistics.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/termvectors/Filter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/termvectors/Term.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/termvectors/TermVector.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/termvectors/Token.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/core/update/UpdateWriteResponseBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/doc-files/api-spec.html create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/DeletePolicyRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/DeletePolicyResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichPolicy.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichPolicyType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichStatsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichStatsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichSummary.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ExecutePolicyRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ExecutePolicyResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/GetPolicyRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/GetPolicyResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/PutPolicyRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/PutPolicyResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/execute_policy/EnrichPolicyPhase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/execute_policy/ExecuteEnrichPolicyStatus.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/CacheStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/CoordinatorStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/ExecutingPolicy.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Connection.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreControls.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Hop.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/SampleDiversity.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Vertex.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/VertexDefinition.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/VertexInclude.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Alias.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AliasDefinition.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AnalyzeRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AnalyzeResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CacheQueries.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateDataStreamRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateDataStreamResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateIndexRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateIndexResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStream.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamIndex.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycle.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleRolloverConditions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleWithRollover.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamTimestampField.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamVisibility.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteAliasRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteAliasResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataLifecycleRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataLifecycleResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataStreamRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataStreamResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexTemplateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteTemplateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DiskUsageRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DiskUsageResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsAliasRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsIndexTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExplainDataLifecycleRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExplainDataLifecycleResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/FielddataFrequencyFilter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetAliasRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetAliasResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataLifecycleRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataLifecycleResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataStreamRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataStreamResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexTemplateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndicesSettingsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndicesSettingsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetMappingRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetMappingResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetTemplateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexCheckOnStartup.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRouting.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationDisk.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationInclude.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationInitialRecovery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingRebalance.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingRebalanceOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSegmentSort.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingBlocks.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsAnalysis.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsLifecycle.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsLifecycleStep.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsTimeSeries.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexState.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplateDataStreamConfiguration.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplateSummary.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexVersioning.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingPressure.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingPressureMemory.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingSlowlogSettings.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingSlowlogTresholds.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettings.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDepth.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDimensionFields.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsFieldNameLength.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedFields.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedObjects.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Merge.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MergeScheduler.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MigrateToDataStreamRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MigrateToDataStreamResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ModifyDataStreamRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ModifyDataStreamResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/NumericFielddata.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/NumericFielddataFormat.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutAliasRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutAliasResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataLifecycleRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataLifecycleResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndicesSettingsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndicesSettingsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutMappingRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutMappingResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Queries.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ResolveIndexRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ResolveIndexResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RetentionLease.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SearchIdle.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortMissing.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortOrder.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsAnalyze.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsHighlight.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsQueryString.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSearch.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarity.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBm25.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfi.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfr.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityIb.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmd.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmj.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityScriptedTfidf.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogSettings.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogTresholdLevels.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogTresholds.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SoftDeletes.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Storage.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/StorageType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TemplateMapping.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Translog.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TranslogDurability.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TranslogRetention.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/UpdateAliasesRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/UpdateAliasesResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ValidateQueryRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ValidateQueryResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzeDetail.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzeToken.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzerDetail.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/CharFilterDetail.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/ExplainAnalyzeToken.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/TokenDetail.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/data_streams_stats/DataStreamsStatsItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/explain_data_lifecycle/DataStreamLifecycleExplain.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get/Feature.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_alias/IndexAliases.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_data_lifecycle/DataStreamWithLifecycle.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_index_template/IndexTemplateItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_mapping/IndexMappingRecord.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/Action.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/ActionBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/ActionVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/IndexAndDataStreamAction.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/put_index_template/IndexTemplateMapping.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/reload_search_analyzers/ReloadDetails.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/reload_search_analyzers/ReloadResult.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexAliasItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexDataStreamsItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/rollover/RolloverConditions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/simulate_template/Overlapping.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/simulate_template/Template.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/stats/ShardFileSizeInfo.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/update_aliases/Action.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/update_aliases/ActionBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/update_aliases/ActionVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/update_aliases/AddAction.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/update_aliases/RemoveAction.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/update_aliases/RemoveIndexAction.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/validate_query/IndicesValidationExplanation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/AppendProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/AttachmentProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/BytesProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/CircleProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ConvertProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ConvertType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/CsvProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/DateIndexNameProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/DateProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/DeletePipelineRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/DeletePipelineResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/DissectProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/DotExpanderProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/DropProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ElasticsearchIngestClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/EnrichProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/FailProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ForeachProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/GeoIpProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/GetPipelineRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/GetPipelineResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/GrokProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/GsubProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/InferenceConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/InferenceConfigBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/InferenceConfigClassification.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/InferenceConfigRegression.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/InferenceConfigVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/InferenceProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/JoinProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/JsonProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/JsonProcessorConflictStrategy.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/KeyValueProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/LowercaseProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/Pipeline.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/PipelineProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/Processor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ProcessorBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ProcessorBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ProcessorGrokRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ProcessorGrokResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ProcessorVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/PutPipelineRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/PutPipelineResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/RemoveProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/RenameProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/SetProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/SetSecurityUserProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/ShapeType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/SimulateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/SimulateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/SortProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/SplitProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/TrimProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/UppercaseProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/UrlDecodeProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/UserAgentProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/UserAgentProperty.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/simulate/Document.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/simulate/DocumentSimulation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/simulate/Ingest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ingest/simulate/PipelineSimulation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/DeletePipelineRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/ElasticsearchLogstashAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/ElasticsearchLogstashClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/GetPipelineRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/GetPipelineResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/Pipeline.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/PipelineMetadata.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/PipelineSettings.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/logstash/PutPipelineRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/AnalysisConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/AnalysisConfigRead.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/AnalysisLimits.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/AnalysisMemoryLimit.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ApiKeyAuthorization.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/AppliesTo.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/CalendarEvent.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/CategorizationAnalyzer.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/CategorizationAnalyzerBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/CategorizationAnalyzerDefinition.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/CategorizationStatus.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ChunkingConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ChunkingMode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ClassificationInferenceOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/CloseJobRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/CloseJobResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ConditionOperator.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataCounts.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataDescription.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/Datafeed.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DatafeedAuthorization.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DatafeedConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DatafeedRunningState.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DatafeedState.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DatafeedStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DatafeedTimingStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysis.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisAnalyzedFields.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisClassification.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisFeatureProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisFeatureProcessorBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisFeatureProcessorFrequencyEncoding.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisFeatureProcessorMultiEncoding.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisFeatureProcessorNGramEncoding.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisFeatureProcessorOneHotEncoding.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisFeatureProcessorTargetMeanEncoding.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisFeatureProcessorVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisOutlierDetection.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisRegression.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalysisVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalytics.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalyticsAuthorization.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalyticsDestination.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalyticsSource.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalyticsStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalyticsStatsBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalyticsStatsDataCounts.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalyticsStatsHyperparameters.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalyticsStatsMemoryUsage.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalyticsStatsOutlierDetection.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalyticsStatsProgress.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalyticsStatsVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeAnalyticsSummary.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeEvaluation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeEvaluationBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeEvaluationClassification.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeEvaluationClassificationMetrics.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeEvaluationClassificationMetricsAucRoc.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeEvaluationMetrics.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeEvaluationOutlierDetection.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeEvaluationOutlierDetectionMetrics.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeEvaluationRegression.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeEvaluationRegressionMetrics.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeEvaluationRegressionMetricsHuber.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeEvaluationRegressionMetricsMsle.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeEvaluationVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DataframeState.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DelayedDataCheckConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteCalendarEventRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteCalendarEventResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteCalendarJobRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteCalendarJobResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteCalendarRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteCalendarResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteDataFrameAnalyticsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteDataFrameAnalyticsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteDatafeedRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteDatafeedResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteFilterRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteFilterResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteJobRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteJobResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteTrainedModelAliasRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteTrainedModelAliasResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteTrainedModelRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeleteTrainedModelResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeploymentAllocationState.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeploymentAssignmentState.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DeploymentState.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DetectionRule.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/Detector.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/DetectorRead.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ElasticsearchMlClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/EstimateModelMemoryRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/EstimateModelMemoryResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/EvaluateDataFrameRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/EvaluateDataFrameResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ExcludeFrequent.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/FillMaskInferenceOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/FillMaskInferenceUpdateOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/Filter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/FilterRef.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/FilterType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/FlushJobRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/FlushJobResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetCalendarEventsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetCalendarEventsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetCalendarsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetCalendarsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetDataFrameAnalyticsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetDataFrameAnalyticsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetDataFrameAnalyticsStatsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetDataFrameAnalyticsStatsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetDatafeedStatsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetDatafeedStatsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetDatafeedsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetDatafeedsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetFiltersRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetFiltersResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetJobStatsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetJobStatsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetJobsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetJobsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetOverallBucketsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetOverallBucketsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetTrainedModelsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetTrainedModelsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetTrainedModelsStatsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/GetTrainedModelsStatsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/Hyperparameter.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/Hyperparameters.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/Include.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/InferTrainedModelRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/InferTrainedModelResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceConfigCreate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceConfigCreateBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceConfigCreateVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceConfigUpdate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceConfigUpdateBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceConfigUpdateVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/InferenceResponseResult.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/Job.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/JobBlocked.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/JobBlockedReason.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/JobConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/JobForecastStatistics.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/JobState.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/JobStatistics.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/JobStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/JobTimingStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/MemoryStatus.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ModelPlotConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ModelSizeStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/NerInferenceOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/NerInferenceUpdateOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/NlpBertTokenizationConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/NlpRobertaTokenizationConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/NlpTokenizationUpdateOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/OpenJobRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/OpenJobResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/OutlierDetectionParameters.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/OverallBucket.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/OverallBucketJob.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/Page.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PassThroughInferenceOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PassThroughInferenceUpdateOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PerPartitionCategorization.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PostCalendarEventsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PostCalendarEventsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PreviewDataFrameAnalyticsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PreviewDataFrameAnalyticsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PreviewDatafeedRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PreviewDatafeedResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutCalendarJobRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutCalendarJobResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutCalendarRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutCalendarResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutDataFrameAnalyticsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutDataFrameAnalyticsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutDatafeedRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutDatafeedResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutFilterRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutFilterResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutJobRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutJobResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutTrainedModelAliasRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutTrainedModelAliasResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutTrainedModelDefinitionPartRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutTrainedModelDefinitionPartResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutTrainedModelRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutTrainedModelResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutTrainedModelVocabularyRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/PutTrainedModelVocabularyResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/QuestionAnsweringInferenceOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/QuestionAnsweringInferenceUpdateOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/RegressionInferenceOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ResetJobRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ResetJobResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/RoutingState.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/RuleAction.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/RuleCondition.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/RunningStateSearchInterval.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/StartDataFrameAnalyticsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/StartDataFrameAnalyticsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/StartDatafeedRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/StartDatafeedResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/StartTrainedModelDeploymentRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/StartTrainedModelDeploymentResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/StopDataFrameAnalyticsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/StopDataFrameAnalyticsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/StopDatafeedRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/StopDatafeedResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/StopTrainedModelDeploymentRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/StopTrainedModelDeploymentResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TextClassificationInferenceOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TextClassificationInferenceUpdateOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TextEmbeddingInferenceOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TextEmbeddingInferenceUpdateOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TextExpansionInferenceOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TextExpansionInferenceUpdateOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TimingStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TokenizationConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TokenizationConfigBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TokenizationConfigVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TokenizationTruncate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TopClassEntry.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TotalFeatureImportance.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TotalFeatureImportanceClass.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TotalFeatureImportanceStatistics.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelAssignment.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelAssignmentRoutingTable.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelAssignmentTaskParameters.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelConfigInput.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelConfigMetadata.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelDeploymentAllocationStatus.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelDeploymentNodesStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelDeploymentStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelEntities.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelInferenceClassImportance.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelInferenceFeatureImportance.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelInferenceStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelLocation.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelLocationIndex.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelSizeStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainedModelType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TrainingPriority.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/TransformAuthorization.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateDataFrameAnalyticsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateDataFrameAnalyticsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateDatafeedRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateDatafeedResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateFilterRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateFilterResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateJobRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/UpdateJobResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ValidationLoss.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/Vocabulary.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ZeroShotClassificationInferenceOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/ZeroShotClassificationInferenceUpdateOptions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/evaluate_data_frame/ConfusionMatrixItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/evaluate_data_frame/ConfusionMatrixPrediction.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/evaluate_data_frame/ConfusionMatrixThreshold.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/evaluate_data_frame/DataframeClassificationSummary.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/evaluate_data_frame/DataframeClassificationSummaryAccuracy.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/evaluate_data_frame/DataframeClassificationSummaryMulticlassConfusionMatrix.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/evaluate_data_frame/DataframeClassificationSummaryPrecision.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/evaluate_data_frame/DataframeClassificationSummaryRecall.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/evaluate_data_frame/DataframeEvaluationClass.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/evaluate_data_frame/DataframeEvaluationSummaryAucRoc.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/evaluate_data_frame/DataframeEvaluationSummaryAucRocCurveItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/evaluate_data_frame/DataframeEvaluationValue.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/evaluate_data_frame/DataframeOutlierDetectionSummary.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/evaluate_data_frame/DataframeRegressionSummary.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/get_calendars/Calendar.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/preview_data_frame_analytics/DataframePreviewConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/put_trained_model/AggregateOutput.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/put_trained_model/Definition.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/put_trained_model/Ensemble.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/put_trained_model/FrequencyEncodingPreprocessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/put_trained_model/Input.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/put_trained_model/OneHotEncodingPreprocessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/put_trained_model/Preprocessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/put_trained_model/PreprocessorBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/put_trained_model/PreprocessorVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/put_trained_model/TargetMeanEncodingPreprocessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/put_trained_model/TrainedModel.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/put_trained_model/TrainedModelTree.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/put_trained_model/TrainedModelTreeNode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ml/put_trained_model/Weights.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/nodes/Client.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/nodes/Context.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/nodes/Http.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/nodes/Ingest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/nodes/IngestTotal.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/nodes/KeyedProcessor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/nodes/NodesResponseBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/nodes/Processor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/nodes/Scripting.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/nodes/ThreadCount.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/DeleteQueryRulesetRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/DeleteQueryRulesetResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/ElasticsearchQueryRulesetAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/ElasticsearchQueryRulesetClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/GetQueryRulesetRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/GetQueryRulesetResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/ListRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/ListResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/PutRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/PutResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRule.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRuleActions.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRuleCriteria.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRuleCriteriaType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRuleType.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/QueryRuleset.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/query_ruleset/list/QueryRulesetListItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/AnalyticsCollection.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/DeleteBehavioralAnalyticsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/DeleteBehavioralAnalyticsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/DeleteSearchApplicationRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/DeleteSearchApplicationResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/ElasticsearchSearchApplicationAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/ElasticsearchSearchApplicationClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/EventDataStream.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/GetBehavioralAnalyticsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/GetBehavioralAnalyticsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/GetSearchApplicationRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/GetSearchApplicationResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/ListRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/ListResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/PutBehavioralAnalyticsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/PutBehavioralAnalyticsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/PutRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/PutResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/SearchApplication.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/SearchApplicationSearchRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/SearchApplicationSearchResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/SearchApplicationTemplate.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/list/SearchApplicationListItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/search_application/put_behavioral_analytics/AnalyticsAcknowledgeResponseBase.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ApiKey.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ApplicationGlobalUserPrivileges.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ApplicationPrivileges.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/AuthenticateRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/AuthenticateResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClearApiKeyCacheRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClearApiKeyCacheResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ClusterNode.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/CreateApiKeyRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/CreateApiKeyResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ElasticsearchSecurityAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ElasticsearchSecurityClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/FieldSecurity.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/GetApiKeyRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/GetApiKeyResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/GlobalPrivilege.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/IndexPrivilege.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/IndicesPrivileges.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/InvalidateApiKeyRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/InvalidateApiKeyResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/ManageUserPrivileges.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/QueryApiKeysRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/QueryApiKeysResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/RealmInfo.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/RoleDescriptor.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/RoleTemplateInlineQuery.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/RoleTemplateInlineQueryBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/RoleTemplateInlineScript.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/RoleTemplateScript.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/RoleTemplateScriptBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/TransientMetadataConfig.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/UpdateApiKeyRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/UpdateApiKeyResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/security/authenticate/ServiceToken.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/DeleteSynonymRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/DeleteSynonymResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/DeleteSynonymRuleRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/DeleteSynonymRuleResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/ElasticsearchSynonymsClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/GetSynonymRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/GetSynonymResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/GetSynonymRuleRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/GetSynonymRuleResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/GetSynonymsSetsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/GetSynonymsSetsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/PutSynonymRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/PutSynonymResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/PutSynonymRuleRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/PutSynonymRuleResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/SynonymRule.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/SynonymRuleRead.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/SynonymsUpdateResult.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/synonyms/get_synonyms_sets/SynonymsSetItem.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/tasks/TaskInfo.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/DeleteTransformRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/DeleteTransformResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/Destination.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformAsyncClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/ElasticsearchTransformClient.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/GetTransformRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/GetTransformResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/GetTransformStatsRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/GetTransformStatsResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/Latest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/Pivot.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/PivotGroupBy.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/PivotGroupByBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/PivotGroupByVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/PreviewTransformRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/PreviewTransformResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/PutTransformRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/PutTransformResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/ResetTransformRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/ResetTransformResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/RetentionPolicy.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/RetentionPolicyBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/RetentionPolicyVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/ScheduleNowTransformRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/ScheduleNowTransformResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/Settings.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/Source.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/StartTransformRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/StartTransformResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/StopTransformRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/StopTransformResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/Sync.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/SyncBuilders.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/SyncVariant.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/TimeRetentionPolicy.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/TimeSync.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/UpdateTransformRequest.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/UpdateTransformResponse.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/get_transform/TransformSummary.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/get_transform_stats/CheckpointStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/get_transform_stats/Checkpointing.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/get_transform_stats/TransformIndexerStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/get_transform_stats/TransformProgress.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/get_transform_stats/TransformStats.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/transform/get_transform_stats/TransformStatsHealth.java create mode 100644 java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/watcher/ActionStatusOptions.java create mode 120000 java-client-serverless/src/main/java/co/elastic/clients/json create mode 120000 java-client-serverless/src/main/java/co/elastic/clients/transport create mode 120000 java-client-serverless/src/main/java/co/elastic/clients/util create mode 100644 java-client-serverless/src/test/java/co/elastic/clients/elasticsearch/ElasticsearchServerTest.java create mode 120000 java-client-serverless/src/test/java/co/elastic/clients/testkit create mode 100644 java-client-serverless/src/test/java/co/elastic/clients/transport/VersionInfoTest.java create mode 100644 java-client/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java rename java-client/src/test/java/co/elastic/clients/{elasticsearch/model => testkit}/ModelTestCase.java (99%) create mode 100644 java-client/src/test/java/co/elastic/clients/transport/VersionInfoTest.java diff --git a/config/version-serverless.txt b/config/version-serverless.txt new file mode 100644 index 000000000..db3905bf8 --- /dev/null +++ b/config/version-serverless.txt @@ -0,0 +1 @@ +8.11.0 diff --git a/java-client-serverless/build.gradle.kts b/java-client-serverless/build.gradle.kts new file mode 100644 index 000000000..a58f363dc --- /dev/null +++ b/java-client-serverless/build.gradle.kts @@ -0,0 +1,315 @@ +/* + * 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. + */ + +import com.github.jk1.license.ProjectData +import com.github.jk1.license.render.LicenseDataCollector +import com.github.jk1.license.render.ReportRenderer +import java.io.File +import java.io.FileWriter + +plugins { + java + `java-library` + checkstyle + `maven-publish` + id("com.github.jk1.dependency-license-report") version "2.2" + id("de.thetaphi.forbiddenapis") version "3.4" +} + +version = "1.0.0+20231031-SNAPSHOT" + +java { + targetCompatibility = JavaVersion.VERSION_1_8 + sourceCompatibility = JavaVersion.VERSION_1_8 + + withJavadocJar() + withSourcesJar() +} + +sourceSets { + main { + java.srcDir("src/main-flavored/java") + } +} + +forbiddenApis { + signaturesFiles = files(File(rootProject.projectDir, "config/forbidden-apis.txt")) + suppressAnnotations = setOf("co.elastic.clients.util.AllowForbiddenApis") +} + +tasks.forbiddenApisMain { + bundledSignatures = setOf("jdk-system-out") +} + +tasks.getByName("processResources") { + eachFile { + if (name != "apis.json") { + // Only process main source-set resources (test files are large) + expand( + "version" to version, + "git_revision" to (if (rootProject.extra.has("gitHashFull")) rootProject.extra["gitHashFull"] else "unknown") + ) + } + } +} + +tasks.withType { + useJUnitPlatform() +} + +tasks.withType { + doFirst { + if (rootProject.extra.has("gitHashFull")) { + val jar = this as Jar + jar.manifest.attributes["X-Git-Revision"] = rootProject.extra["gitHashFull"] + jar.manifest.attributes["X-Git-Commit-Time"] = rootProject.extra["gitCommitTime"] + } else { + throw GradleException("No git information available") + } + } + + manifest { + attributes["Implementation-Title"] = "Elasticsearch Java client (Serverless edition)" + attributes["Implementation-Vendor"] = "Elastic" + attributes["Implementation-URL"] = "https://github.com/elastic/elasticsearch-java/" + attributes["Build-Date"] = rootProject.extra["buildTime"] + } + + metaInf { + from("../LICENSE.txt") + from("../NOTICE.txt") + } +} + +tasks.withType { + val opt = options as StandardJavadocDocletOptions + // Gradle calls javadoc with a list of file and not a path. This prevents doc-files from being copied. + opt.addStringOption("sourcepath", project.projectDir.path + "/src/main/java") + opt.docFilesSubDirs(true) + opt.addBooleanOption("Xdoclint:-missing", true) + + doLast { + // Javadoc adds its decoration to html doc files, including quite some JS. This slows down the api spec + // redirector that doesn't need it. So overwrite the target file with the original one. + val specFile = "co/elastic/clients/elasticsearch/doc-files/api-spec.html" + val source = File(project.projectDir, "src/main/java/" + specFile) + val target = File(project.projectDir, "build/docs/javadoc/" + specFile) + source.copyTo(target, overwrite = true) + } +} + +publishing { + repositories { + maven { + // See https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry + // and https://docs.gradle.org/current/samples/sample_publishing_credentials.html + name = "ESJavaGithubPackages" + url = uri("https://maven.pkg.github.com/elastic/elasticsearch-java") + credentials(PasswordCredentials::class) + } + + maven { + name = "Build" + url = uri("${rootProject.buildDir}/repository") + } + } + + publications { + create("maven") { + from(components["java"]) + pom { + name.set("Elasticsearch Java API Client (Serverless edition)") + artifactId = "elasticsearch-java-serverless" + description.set("Java API Client for Elasticsearch Serverless") + url.set("https://github.com/elastic/elasticsearch-java/") + licenses { + license { + name.set("The Apache Software License, Version 2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") + } + } + developers { + developer { + name.set("Elastic") + url.set("https://www.elastic.co") + inceptionYear.set("2020") + } + } + scm { + connection.set("scm:git:https://github.com/elastic/elasticsearch-java.git") + developerConnection.set("scm:git:ssh://git@github.com:elastic/elasticsearch-java.git") + url.set("https://github.com/elastic/elasticsearch-java/") + } + +// Fixed version in Serverless. +// withXml { +// // Set the version of dependencies of the org.elasticsearch.client group to the one that we are building. +// // Since the unified release process releases everything at once, this ensures all published artifacts depend +// // on the exact same version. This assumes of course that the binary API and the behavior of these dependencies +// // are the same as the one used in the dependency section below. +// val xPathFactory = javax.xml.xpath.XPathFactory.newInstance() +// val depSelector = xPathFactory.newXPath() +// .compile("/project/dependencies/dependency[groupId/text() = 'org.elasticsearch.client']") +// val versionSelector = xPathFactory.newXPath().compile("version") +// +// var foundVersion = false; +// +// val deps = depSelector.evaluate(asElement().ownerDocument, javax.xml.xpath.XPathConstants.NODESET) +// as org.w3c.dom.NodeList +// +// for (i in 0 until deps.length) { +// val dep = deps.item(i) +// val version = versionSelector.evaluate(dep, javax.xml.xpath.XPathConstants.NODE) as org.w3c.dom.Element +// foundVersion = true; +// version.textContent = project.version.toString() +// } +// +// if (!foundVersion) { +// throw GradleException("Could not find a 'org.elasticsearch.client' to update dependency version in the POM.") +// } +// } + } + } + } +} + +dependencies { + val elasticsearchVersion = "8.9.0" + val jacksonVersion = "2.13.3" + val openTelemetryVersion = "1.29.0" + + // Apache 2.0 + // https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-low.html + api("org.elasticsearch.client", "elasticsearch-rest-client", elasticsearchVersion) + + // Apache 2.0 + // https://search.maven.org/artifact/com.google.code.findbugs/jsr305 + api("com.google.code.findbugs:jsr305:3.0.2") + + // EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + // https://github.com/eclipse-ee4j/jsonp + api("jakarta.json:jakarta.json-api:2.0.1") + + // Needed even if using Jackson to have an implementation of the Jsonp object model + // EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + // https://github.com/eclipse-ee4j/parsson + api("org.eclipse.parsson:parsson:1.0.0") + + // OpenTelemetry API for native instrumentation of the client. + // Apache 2.0 + // https://github.com/open-telemetry/opentelemetry-java + implementation("io.opentelemetry", "opentelemetry-api", openTelemetryVersion) + // Use it once it's stable (see Instrumentation.java). Limited to tests for now. + testImplementation("io.opentelemetry", "opentelemetry-semconv", "$openTelemetryVersion-alpha") + + // EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 + // https://github.com/eclipse-ee4j/jsonb-api + compileOnly("jakarta.json.bind", "jakarta.json.bind-api", "2.0.0") + testImplementation("jakarta.json.bind", "jakarta.json.bind-api", "2.0.0") + + // Apache 2.0 + // https://github.com/FasterXML/jackson + compileOnly("com.fasterxml.jackson.core", "jackson-core", jacksonVersion) + compileOnly("com.fasterxml.jackson.core", "jackson-databind", jacksonVersion) + testImplementation("com.fasterxml.jackson.core", "jackson-core", jacksonVersion) + testImplementation("com.fasterxml.jackson.core", "jackson-databind", jacksonVersion) + + // EPL-2.0 OR BSD-3-Clause + // https://eclipse-ee4j.github.io/yasson/ + testImplementation("org.eclipse", "yasson", "2.0.4") { + // Exclude Glassfish as we use Parsson (basically Glassfish renamed in the Jakarta namespace). + exclude(group = "org.glassfish", module = "jakarta.json") + } + + // Apache-2.0 + testImplementation("commons-io:commons-io:2.11.0") + + // EPL-2.0 + // https://junit.org/junit5/ + testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2") + testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2") + + // MIT + // https://github.com/classgraph/classgraph + testImplementation("io.github.classgraph:classgraph:4.8.147") + + // MIT + // https://www.testcontainers.org/ + testImplementation("org.testcontainers", "testcontainers", "1.17.3") + testImplementation("org.testcontainers", "elasticsearch", "1.17.3") + + + testImplementation("io.opentelemetry", "opentelemetry-sdk", openTelemetryVersion) +} + + +licenseReport { + renderers = arrayOf(SpdxReporter(File(rootProject.buildDir, "release/dependencies.csv"))) + excludeGroups = arrayOf("org.elasticsearch.client") +} + +class SpdxReporter(val dest: File) : ReportRenderer { + // License names to their SPDX identifier + val spdxIds = mapOf( + "The Apache License, Version 2.0" to "Apache-2.0", + "Apache License, Version 2.0" to "Apache-2.0", + "The Apache Software License, Version 2.0" to "Apache-2.0", + "BSD Zero Clause License" to "0BSD", + "Eclipse Public License 2.0" to "EPL-2.0", + "Eclipse Public License v. 2.0" to "EPL-2.0", + "Eclipse Public License - v 2.0" to "EPL-2.0", + "GNU General Public License, version 2 with the GNU Classpath Exception" to "GPL-2.0 WITH Classpath-exception-2.0", + "COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0" to "CDDL-1.0" + ) + + private fun quote(str: String): String { + return if (str.contains(',') || str.contains("\"")) { + "\"" + str.replace("\"", "\"\"") + "\"" + } else { + str + } + } + + override fun render(data: ProjectData?) { + dest.parentFile.mkdirs() + FileWriter(dest).use { out -> + out.append("name,url,version,revision,license\n") + data?.allDependencies?.forEach { dep -> + + val depVersion = dep.version + val depName = dep.group + ":" + dep.name + + val info = LicenseDataCollector.multiModuleLicenseInfo(dep) + val depUrl = info.moduleUrls.first() + + val licenseIds = info.licenses.mapNotNull { license -> + license.name?.let { + checkNotNull(spdxIds[it]) { "No SPDX identifier for $license" } + } + }.toSet() + + // Combine multiple licenses. + // See https://spdx.github.io/spdx-spec/appendix-IV-SPDX-license-expressions/#composite-license-expressions + val licenseId = licenseIds.joinToString(" OR ") + + out.append("${quote(depName)},${quote(depUrl)},${quote(depVersion)},,${quote(licenseId)}\n") + } + } + } +} diff --git a/java-client-serverless/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java b/java-client-serverless/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java new file mode 100644 index 000000000..affd910c4 --- /dev/null +++ b/java-client-serverless/src/main-flavored/java/co/elastic/clients/transport/VersionInfo.java @@ -0,0 +1,26 @@ +/* + * 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.transport; + +// Package private +class VersionInfo { + static final String FLAVOR = "serverless"; + static final String VERSION = "1.0.0+20231031"; +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/ApiClient.java b/java-client-serverless/src/main/java/co/elastic/clients/ApiClient.java new file mode 120000 index 000000000..0e884fbdb --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/ApiClient.java @@ -0,0 +1 @@ +../../../../../../../java-client/src/main/java/co/elastic/clients/ApiClient.java \ No newline at end of file diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java new file mode 100644 index 000000000..e632b612a --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchAsyncClient.java @@ -0,0 +1,1753 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch; + +import co.elastic.clients.ApiClient; +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch.async_search.ElasticsearchAsyncSearchAsyncClient; +import co.elastic.clients.elasticsearch.cat.ElasticsearchCatAsyncClient; +import co.elastic.clients.elasticsearch.cluster.ElasticsearchClusterAsyncClient; +import co.elastic.clients.elasticsearch.core.BulkRequest; +import co.elastic.clients.elasticsearch.core.BulkResponse; +import co.elastic.clients.elasticsearch.core.ClearScrollRequest; +import co.elastic.clients.elasticsearch.core.ClearScrollResponse; +import co.elastic.clients.elasticsearch.core.ClosePointInTimeRequest; +import co.elastic.clients.elasticsearch.core.ClosePointInTimeResponse; +import co.elastic.clients.elasticsearch.core.CountRequest; +import co.elastic.clients.elasticsearch.core.CountResponse; +import co.elastic.clients.elasticsearch.core.CreateRequest; +import co.elastic.clients.elasticsearch.core.CreateResponse; +import co.elastic.clients.elasticsearch.core.DeleteByQueryRequest; +import co.elastic.clients.elasticsearch.core.DeleteByQueryResponse; +import co.elastic.clients.elasticsearch.core.DeleteRequest; +import co.elastic.clients.elasticsearch.core.DeleteResponse; +import co.elastic.clients.elasticsearch.core.DeleteScriptRequest; +import co.elastic.clients.elasticsearch.core.DeleteScriptResponse; +import co.elastic.clients.elasticsearch.core.ExistsRequest; +import co.elastic.clients.elasticsearch.core.ExistsSourceRequest; +import co.elastic.clients.elasticsearch.core.FieldCapsRequest; +import co.elastic.clients.elasticsearch.core.FieldCapsResponse; +import co.elastic.clients.elasticsearch.core.GetRequest; +import co.elastic.clients.elasticsearch.core.GetResponse; +import co.elastic.clients.elasticsearch.core.GetScriptRequest; +import co.elastic.clients.elasticsearch.core.GetScriptResponse; +import co.elastic.clients.elasticsearch.core.GetSourceRequest; +import co.elastic.clients.elasticsearch.core.GetSourceResponse; +import co.elastic.clients.elasticsearch.core.IndexRequest; +import co.elastic.clients.elasticsearch.core.IndexResponse; +import co.elastic.clients.elasticsearch.core.InfoRequest; +import co.elastic.clients.elasticsearch.core.InfoResponse; +import co.elastic.clients.elasticsearch.core.MgetRequest; +import co.elastic.clients.elasticsearch.core.MgetResponse; +import co.elastic.clients.elasticsearch.core.MsearchRequest; +import co.elastic.clients.elasticsearch.core.MsearchResponse; +import co.elastic.clients.elasticsearch.core.MsearchTemplateRequest; +import co.elastic.clients.elasticsearch.core.MsearchTemplateResponse; +import co.elastic.clients.elasticsearch.core.MtermvectorsRequest; +import co.elastic.clients.elasticsearch.core.MtermvectorsResponse; +import co.elastic.clients.elasticsearch.core.OpenPointInTimeRequest; +import co.elastic.clients.elasticsearch.core.OpenPointInTimeResponse; +import co.elastic.clients.elasticsearch.core.PingRequest; +import co.elastic.clients.elasticsearch.core.PutScriptRequest; +import co.elastic.clients.elasticsearch.core.PutScriptResponse; +import co.elastic.clients.elasticsearch.core.RankEvalRequest; +import co.elastic.clients.elasticsearch.core.RankEvalResponse; +import co.elastic.clients.elasticsearch.core.RenderSearchTemplateRequest; +import co.elastic.clients.elasticsearch.core.RenderSearchTemplateResponse; +import co.elastic.clients.elasticsearch.core.ScriptsPainlessExecuteRequest; +import co.elastic.clients.elasticsearch.core.ScriptsPainlessExecuteResponse; +import co.elastic.clients.elasticsearch.core.ScrollRequest; +import co.elastic.clients.elasticsearch.core.ScrollResponse; +import co.elastic.clients.elasticsearch.core.SearchMvtRequest; +import co.elastic.clients.elasticsearch.core.SearchRequest; +import co.elastic.clients.elasticsearch.core.SearchResponse; +import co.elastic.clients.elasticsearch.core.SearchTemplateRequest; +import co.elastic.clients.elasticsearch.core.SearchTemplateResponse; +import co.elastic.clients.elasticsearch.core.TermsEnumRequest; +import co.elastic.clients.elasticsearch.core.TermsEnumResponse; +import co.elastic.clients.elasticsearch.core.TermvectorsRequest; +import co.elastic.clients.elasticsearch.core.TermvectorsResponse; +import co.elastic.clients.elasticsearch.core.UpdateByQueryRequest; +import co.elastic.clients.elasticsearch.core.UpdateByQueryResponse; +import co.elastic.clients.elasticsearch.core.UpdateRequest; +import co.elastic.clients.elasticsearch.core.UpdateResponse; +import co.elastic.clients.elasticsearch.enrich.ElasticsearchEnrichAsyncClient; +import co.elastic.clients.elasticsearch.graph.ElasticsearchGraphAsyncClient; +import co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesAsyncClient; +import co.elastic.clients.elasticsearch.ingest.ElasticsearchIngestAsyncClient; +import co.elastic.clients.elasticsearch.logstash.ElasticsearchLogstashAsyncClient; +import co.elastic.clients.elasticsearch.ml.ElasticsearchMlAsyncClient; +import co.elastic.clients.elasticsearch.query_ruleset.ElasticsearchQueryRulesetAsyncClient; +import co.elastic.clients.elasticsearch.search_application.ElasticsearchSearchApplicationAsyncClient; +import co.elastic.clients.elasticsearch.security.ElasticsearchSecurityAsyncClient; +import co.elastic.clients.elasticsearch.synonyms.ElasticsearchSynonymsAsyncClient; +import co.elastic.clients.elasticsearch.transform.ElasticsearchTransformAsyncClient; +import co.elastic.clients.transport.ElasticsearchTransport; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.JsonEndpoint; +import co.elastic.clients.transport.Transport; +import co.elastic.clients.transport.TransportOptions; +import co.elastic.clients.transport.endpoints.BinaryResponse; +import co.elastic.clients.transport.endpoints.BooleanResponse; +import co.elastic.clients.transport.endpoints.EndpointWithResponseMapperAttr; +import co.elastic.clients.util.ObjectBuilder; +import java.lang.reflect.Type; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import javax.annotation.Nullable; + +/** + * Client for the namespace. + */ +public class ElasticsearchAsyncClient extends ApiClient { + + public ElasticsearchAsyncClient(ElasticsearchTransport transport) { + super(transport, null); + } + + public ElasticsearchAsyncClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + @Override + public ElasticsearchAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) { + return new ElasticsearchAsyncClient(this.transport, transportOptions); + } + + // ----- Child clients + + public ElasticsearchAsyncSearchAsyncClient asyncSearch() { + return new ElasticsearchAsyncSearchAsyncClient(this.transport, this.transportOptions); + } + + public ElasticsearchCatAsyncClient cat() { + return new ElasticsearchCatAsyncClient(this.transport, this.transportOptions); + } + + public ElasticsearchClusterAsyncClient cluster() { + return new ElasticsearchClusterAsyncClient(this.transport, this.transportOptions); + } + + public ElasticsearchEnrichAsyncClient enrich() { + return new ElasticsearchEnrichAsyncClient(this.transport, this.transportOptions); + } + + public ElasticsearchGraphAsyncClient graph() { + return new ElasticsearchGraphAsyncClient(this.transport, this.transportOptions); + } + + public ElasticsearchIndicesAsyncClient indices() { + return new ElasticsearchIndicesAsyncClient(this.transport, this.transportOptions); + } + + public ElasticsearchIngestAsyncClient ingest() { + return new ElasticsearchIngestAsyncClient(this.transport, this.transportOptions); + } + + public ElasticsearchLogstashAsyncClient logstash() { + return new ElasticsearchLogstashAsyncClient(this.transport, this.transportOptions); + } + + public ElasticsearchMlAsyncClient ml() { + return new ElasticsearchMlAsyncClient(this.transport, this.transportOptions); + } + + public ElasticsearchQueryRulesetAsyncClient queryRuleset() { + return new ElasticsearchQueryRulesetAsyncClient(this.transport, this.transportOptions); + } + + public ElasticsearchSearchApplicationAsyncClient searchApplication() { + return new ElasticsearchSearchApplicationAsyncClient(this.transport, this.transportOptions); + } + + public ElasticsearchSecurityAsyncClient security() { + return new ElasticsearchSecurityAsyncClient(this.transport, this.transportOptions); + } + + public ElasticsearchSynonymsAsyncClient synonyms() { + return new ElasticsearchSynonymsAsyncClient(this.transport, this.transportOptions); + } + + public ElasticsearchTransformAsyncClient transform() { + return new ElasticsearchTransformAsyncClient(this.transport, this.transportOptions); + } + + // ----- Endpoint: bulk + + /** + * Allows to perform multiple index/update/delete operations in a single + * request. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture bulk(BulkRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) BulkRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows to perform multiple index/update/delete operations in a single + * request. + * + * @param fn + * a function that initializes a builder to create the + * {@link BulkRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture bulk(Function> fn) { + return bulk(fn.apply(new BulkRequest.Builder()).build()); + } + + /** + * Allows to perform multiple index/update/delete operations in a single + * request. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture bulk() { + return this.transport.performRequestAsync(new BulkRequest.Builder().build(), BulkRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: clear_scroll + + /** + * Explicitly clears the search context for a scroll. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture clearScroll(ClearScrollRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ClearScrollRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Explicitly clears the search context for a scroll. + * + * @param fn + * a function that initializes a builder to create the + * {@link ClearScrollRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture clearScroll( + Function> fn) { + return clearScroll(fn.apply(new ClearScrollRequest.Builder()).build()); + } + + /** + * Explicitly clears the search context for a scroll. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture clearScroll() { + return this.transport.performRequestAsync(new ClearScrollRequest.Builder().build(), + ClearScrollRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: close_point_in_time + + /** + * Close a point in time + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture closePointInTime(ClosePointInTimeRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ClosePointInTimeRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Close a point in time + * + * @param fn + * a function that initializes a builder to create the + * {@link ClosePointInTimeRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture closePointInTime( + Function> fn) { + return closePointInTime(fn.apply(new ClosePointInTimeRequest.Builder()).build()); + } + + // ----- Endpoint: count + + /** + * Returns number of documents matching a query. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture count(CountRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) CountRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns number of documents matching a query. + * + * @param fn + * a function that initializes a builder to create the + * {@link CountRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture count( + Function> fn) { + return count(fn.apply(new CountRequest.Builder()).build()); + } + + /** + * Returns number of documents matching a query. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture count() { + return this.transport.performRequestAsync(new CountRequest.Builder().build(), CountRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: create + + /** + * Creates a new document in the index. + *

+ * Returns a 409 response when a document with a same ID already exists in the + * index. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture create(CreateRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint, CreateResponse, ErrorResponse> endpoint = (JsonEndpoint, CreateResponse, ErrorResponse>) CreateRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Creates a new document in the index. + *

+ * Returns a 409 response when a document with a same ID already exists in the + * index. + * + * @param fn + * a function that initializes a builder to create the + * {@link CreateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture create( + Function, ObjectBuilder>> fn) { + return create(fn.apply(new CreateRequest.Builder()).build()); + } + + // ----- Endpoint: delete + + /** + * Removes a document from the index. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture delete(DeleteRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Removes a document from the index. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture delete( + Function> fn) { + return delete(fn.apply(new DeleteRequest.Builder()).build()); + } + + // ----- Endpoint: delete_by_query + + /** + * Deletes documents matching the provided query. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture deleteByQuery(DeleteByQueryRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteByQueryRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Deletes documents matching the provided query. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteByQueryRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture deleteByQuery( + Function> fn) { + return deleteByQuery(fn.apply(new DeleteByQueryRequest.Builder()).build()); + } + + // ----- Endpoint: delete_script + + /** + * Deletes a script. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture deleteScript(DeleteScriptRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteScriptRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Deletes a script. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteScriptRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture deleteScript( + Function> fn) { + return deleteScript(fn.apply(new DeleteScriptRequest.Builder()).build()); + } + + // ----- Endpoint: exists + + /** + * Returns information about whether a document exists in an index. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture exists(ExistsRequest request) { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) ExistsRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns information about whether a document exists in an index. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExistsRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture exists( + Function> fn) { + return exists(fn.apply(new ExistsRequest.Builder()).build()); + } + + // ----- Endpoint: exists_source + + /** + * Returns information about whether a document source exists in an index. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture existsSource(ExistsSourceRequest request) { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) ExistsSourceRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns information about whether a document source exists in an index. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExistsSourceRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture existsSource( + Function> fn) { + return existsSource(fn.apply(new ExistsSourceRequest.Builder()).build()); + } + + // ----- Endpoint: field_caps + + /** + * Returns the information about the capabilities of fields among multiple + * indices. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture fieldCaps(FieldCapsRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) FieldCapsRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns the information about the capabilities of fields among multiple + * indices. + * + * @param fn + * a function that initializes a builder to create the + * {@link FieldCapsRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture fieldCaps( + Function> fn) { + return fieldCaps(fn.apply(new FieldCapsRequest.Builder()).build()); + } + + /** + * Returns the information about the capabilities of fields among multiple + * indices. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture fieldCaps() { + return this.transport.performRequestAsync(new FieldCapsRequest.Builder().build(), FieldCapsRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: get + + /** + * Returns a document. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> get(GetRequest request, + Class tDocumentClass) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.get.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns a document. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> get( + Function> fn, Class tDocumentClass) { + return get(fn.apply(new GetRequest.Builder()).build(), tDocumentClass); + } + + /** + * Returns a document. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> get(GetRequest request, Type tDocumentType) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.get.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns a document. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> get( + Function> fn, Type tDocumentType) { + return get(fn.apply(new GetRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: get_script + + /** + * Returns a script. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getScript(GetScriptRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetScriptRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns a script. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetScriptRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture getScript( + Function> fn) { + return getScript(fn.apply(new GetScriptRequest.Builder()).build()); + } + + // ----- Endpoint: get_source + + /** + * Returns the source of a document. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> getSource(GetSourceRequest request, + Class tDocumentClass) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetSourceRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.get_source.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns the source of a document. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetSourceRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> getSource( + Function> fn, Class tDocumentClass) { + return getSource(fn.apply(new GetSourceRequest.Builder()).build(), tDocumentClass); + } + + /** + * Returns the source of a document. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> getSource(GetSourceRequest request, + Type tDocumentType) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetSourceRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.get_source.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns the source of a document. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetSourceRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> getSource( + Function> fn, Type tDocumentType) { + return getSource(fn.apply(new GetSourceRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: index + + /** + * Creates or updates a document in an index. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture index(IndexRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint, IndexResponse, ErrorResponse> endpoint = (JsonEndpoint, IndexResponse, ErrorResponse>) IndexRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Creates or updates a document in an index. + * + * @param fn + * a function that initializes a builder to create the + * {@link IndexRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture index( + Function, ObjectBuilder>> fn) { + return index(fn.apply(new IndexRequest.Builder()).build()); + } + + // ----- Endpoint: info + + /** + * Returns basic information about the cluster. + * + * @see Documentation + * on elastic.co + */ + public CompletableFuture info() { + return this.transport.performRequestAsync(InfoRequest._INSTANCE, InfoRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: mget + + /** + * Allows to get multiple documents in one request. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> mget(MgetRequest request, + Class tDocumentClass) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.mget.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows to get multiple documents in one request. + * + * @param fn + * a function that initializes a builder to create the + * {@link MgetRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> mget( + Function> fn, Class tDocumentClass) { + return mget(fn.apply(new MgetRequest.Builder()).build(), tDocumentClass); + } + + /** + * Allows to get multiple documents in one request. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> mget(MgetRequest request, Type tDocumentType) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.mget.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows to get multiple documents in one request. + * + * @param fn + * a function that initializes a builder to create the + * {@link MgetRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> mget( + Function> fn, Type tDocumentType) { + return mget(fn.apply(new MgetRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: msearch + + /** + * Allows to execute several search operations in one request. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> msearch(MsearchRequest request, + Class tDocumentClass) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.msearch.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows to execute several search operations in one request. + * + * @param fn + * a function that initializes a builder to create the + * {@link MsearchRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> msearch( + Function> fn, Class tDocumentClass) { + return msearch(fn.apply(new MsearchRequest.Builder()).build(), tDocumentClass); + } + + /** + * Allows to execute several search operations in one request. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> msearch(MsearchRequest request, + Type tDocumentType) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.msearch.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows to execute several search operations in one request. + * + * @param fn + * a function that initializes a builder to create the + * {@link MsearchRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> msearch( + Function> fn, Type tDocumentType) { + return msearch(fn.apply(new MsearchRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: msearch_template + + /** + * Allows to execute several search template operations in one request. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> msearchTemplate( + MsearchTemplateRequest request, Class tDocumentClass) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchTemplateRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.msearch_template.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows to execute several search template operations in one request. + * + * @param fn + * a function that initializes a builder to create the + * {@link MsearchTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> msearchTemplate( + Function> fn, + Class tDocumentClass) { + return msearchTemplate(fn.apply(new MsearchTemplateRequest.Builder()).build(), tDocumentClass); + } + + /** + * Allows to execute several search template operations in one request. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> msearchTemplate( + MsearchTemplateRequest request, Type tDocumentType) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchTemplateRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.msearch_template.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows to execute several search template operations in one request. + * + * @param fn + * a function that initializes a builder to create the + * {@link MsearchTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> msearchTemplate( + Function> fn, Type tDocumentType) { + return msearchTemplate(fn.apply(new MsearchTemplateRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: mtermvectors + + /** + * Returns multiple termvectors in one request. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture mtermvectors(MtermvectorsRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) MtermvectorsRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns multiple termvectors in one request. + * + * @param fn + * a function that initializes a builder to create the + * {@link MtermvectorsRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture mtermvectors( + Function> fn) { + return mtermvectors(fn.apply(new MtermvectorsRequest.Builder()).build()); + } + + /** + * Returns multiple termvectors in one request. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture mtermvectors() { + return this.transport.performRequestAsync(new MtermvectorsRequest.Builder().build(), + MtermvectorsRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: open_point_in_time + + /** + * Open a point in time that can be used in subsequent searches + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture openPointInTime(OpenPointInTimeRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) OpenPointInTimeRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Open a point in time that can be used in subsequent searches + * + * @param fn + * a function that initializes a builder to create the + * {@link OpenPointInTimeRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture openPointInTime( + Function> fn) { + return openPointInTime(fn.apply(new OpenPointInTimeRequest.Builder()).build()); + } + + // ----- Endpoint: ping + + /** + * Returns whether the cluster is running. + * + * @see Documentation + * on elastic.co + */ + public CompletableFuture ping() { + return this.transport.performRequestAsync(PingRequest._INSTANCE, PingRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: put_script + + /** + * Creates or updates a script. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture putScript(PutScriptRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutScriptRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Creates or updates a script. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutScriptRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture putScript( + Function> fn) { + return putScript(fn.apply(new PutScriptRequest.Builder()).build()); + } + + // ----- Endpoint: rank_eval + + /** + * Allows to evaluate the quality of ranked search results over a set of typical + * search queries + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture rankEval(RankEvalRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) RankEvalRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows to evaluate the quality of ranked search results over a set of typical + * search queries + * + * @param fn + * a function that initializes a builder to create the + * {@link RankEvalRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture rankEval( + Function> fn) { + return rankEval(fn.apply(new RankEvalRequest.Builder()).build()); + } + + // ----- Endpoint: render_search_template + + /** + * Allows to use the Mustache language to pre-render a search definition. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture renderSearchTemplate(RenderSearchTemplateRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) RenderSearchTemplateRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows to use the Mustache language to pre-render a search definition. + * + * @param fn + * a function that initializes a builder to create the + * {@link RenderSearchTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture renderSearchTemplate( + Function> fn) { + return renderSearchTemplate(fn.apply(new RenderSearchTemplateRequest.Builder()).build()); + } + + /** + * Allows to use the Mustache language to pre-render a search definition. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture renderSearchTemplate() { + return this.transport.performRequestAsync(new RenderSearchTemplateRequest.Builder().build(), + RenderSearchTemplateRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: scripts_painless_execute + + /** + * Allows an arbitrary script to be executed and a result to be returned + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> scriptsPainlessExecute( + ScriptsPainlessExecuteRequest request, Class tResultClass) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScriptsPainlessExecuteRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.scripts_painless_execute.TResult", + getDeserializer(tResultClass)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows an arbitrary script to be executed and a result to be returned + * + * @param fn + * a function that initializes a builder to create the + * {@link ScriptsPainlessExecuteRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> scriptsPainlessExecute( + Function> fn, + Class tResultClass) { + return scriptsPainlessExecute(fn.apply(new ScriptsPainlessExecuteRequest.Builder()).build(), tResultClass); + } + + /** + * Allows an arbitrary script to be executed and a result to be returned + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> scriptsPainlessExecute( + ScriptsPainlessExecuteRequest request, Type tResultType) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScriptsPainlessExecuteRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.scripts_painless_execute.TResult", + getDeserializer(tResultType)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows an arbitrary script to be executed and a result to be returned + * + * @param fn + * a function that initializes a builder to create the + * {@link ScriptsPainlessExecuteRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> scriptsPainlessExecute( + Function> fn, + Type tResultType) { + return scriptsPainlessExecute(fn.apply(new ScriptsPainlessExecuteRequest.Builder()).build(), tResultType); + } + + // ----- Endpoint: scroll + + /** + * Allows to retrieve a large numbers of results from a single search request. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> scroll(ScrollRequest request, + Class tDocumentClass) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.scroll.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows to retrieve a large numbers of results from a single search request. + * + * @param fn + * a function that initializes a builder to create the + * {@link ScrollRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> scroll( + Function> fn, Class tDocumentClass) { + return scroll(fn.apply(new ScrollRequest.Builder()).build(), tDocumentClass); + } + + /** + * Allows to retrieve a large numbers of results from a single search request. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> scroll(ScrollRequest request, Type tDocumentType) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.scroll.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows to retrieve a large numbers of results from a single search request. + * + * @param fn + * a function that initializes a builder to create the + * {@link ScrollRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> scroll( + Function> fn, Type tDocumentType) { + return scroll(fn.apply(new ScrollRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: search + + /** + * Returns results matching a query. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> search(SearchRequest request, + Class tDocumentClass) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.search.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns results matching a query. + * + * @param fn + * a function that initializes a builder to create the + * {@link SearchRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> search( + Function> fn, Class tDocumentClass) { + return search(fn.apply(new SearchRequest.Builder()).build(), tDocumentClass); + } + + /** + * Returns results matching a query. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> search(SearchRequest request, Type tDocumentType) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.search.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns results matching a query. + * + * @param fn + * a function that initializes a builder to create the + * {@link SearchRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> search( + Function> fn, Type tDocumentType) { + return search(fn.apply(new SearchRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: search_mvt + + /** + * Searches a vector tile for geospatial values. Returns results as a binary + * Mapbox vector tile. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture searchMvt(SearchMvtRequest request) { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) SearchMvtRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Searches a vector tile for geospatial values. Returns results as a binary + * Mapbox vector tile. + * + * @param fn + * a function that initializes a builder to create the + * {@link SearchMvtRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture searchMvt( + Function> fn) { + return searchMvt(fn.apply(new SearchMvtRequest.Builder()).build()); + } + + // ----- Endpoint: search_template + + /** + * Allows to use the Mustache language to pre-render a search definition. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> searchTemplate( + SearchTemplateRequest request, Class tDocumentClass) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchTemplateRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.search_template.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows to use the Mustache language to pre-render a search definition. + * + * @param fn + * a function that initializes a builder to create the + * {@link SearchTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> searchTemplate( + Function> fn, + Class tDocumentClass) { + return searchTemplate(fn.apply(new SearchTemplateRequest.Builder()).build(), tDocumentClass); + } + + /** + * Allows to use the Mustache language to pre-render a search definition. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> searchTemplate( + SearchTemplateRequest request, Type tDocumentType) { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchTemplateRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.search_template.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows to use the Mustache language to pre-render a search definition. + * + * @param fn + * a function that initializes a builder to create the + * {@link SearchTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> searchTemplate( + Function> fn, Type tDocumentType) { + return searchTemplate(fn.apply(new SearchTemplateRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: terms_enum + + /** + * The terms enum API can be used to discover terms in the index that begin with + * the provided string. It is designed for low-latency look-ups used in + * auto-complete scenarios. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture termsEnum(TermsEnumRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) TermsEnumRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * The terms enum API can be used to discover terms in the index that begin with + * the provided string. It is designed for low-latency look-ups used in + * auto-complete scenarios. + * + * @param fn + * a function that initializes a builder to create the + * {@link TermsEnumRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture termsEnum( + Function> fn) { + return termsEnum(fn.apply(new TermsEnumRequest.Builder()).build()); + } + + // ----- Endpoint: termvectors + + /** + * Returns information and statistics about terms in the fields of a particular + * document. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture termvectors(TermvectorsRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint, TermvectorsResponse, ErrorResponse> endpoint = (JsonEndpoint, TermvectorsResponse, ErrorResponse>) TermvectorsRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns information and statistics about terms in the fields of a particular + * document. + * + * @param fn + * a function that initializes a builder to create the + * {@link TermvectorsRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture termvectors( + Function, ObjectBuilder>> fn) { + return termvectors(fn.apply(new TermvectorsRequest.Builder()).build()); + } + + // ----- Endpoint: update + + /** + * Updates a document with a script or partial document. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> update( + UpdateRequest request, Class tDocumentClass) { + @SuppressWarnings("unchecked") + JsonEndpoint, UpdateResponse, ErrorResponse> endpoint = (JsonEndpoint, UpdateResponse, ErrorResponse>) UpdateRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.update.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Updates a document with a script or partial document. + * + * @param fn + * a function that initializes a builder to create the + * {@link UpdateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> update( + Function, ObjectBuilder>> fn, + Class tDocumentClass) { + return update(fn.apply(new UpdateRequest.Builder()).build(), tDocumentClass); + } + + /** + * Updates a document with a script or partial document. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture> update( + UpdateRequest request, Type tDocumentType) { + @SuppressWarnings("unchecked") + JsonEndpoint, UpdateResponse, ErrorResponse> endpoint = (JsonEndpoint, UpdateResponse, ErrorResponse>) UpdateRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.update.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Updates a document with a script or partial document. + * + * @param fn + * a function that initializes a builder to create the + * {@link UpdateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture> update( + Function, ObjectBuilder>> fn, + Type tDocumentType) { + return update(fn.apply(new UpdateRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: update_by_query + + /** + * Performs an update on every document in the index without changing the + * source, for example to pick up a mapping change. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture updateByQuery(UpdateByQueryRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) UpdateByQueryRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Performs an update on every document in the index without changing the + * source, for example to pick up a mapping change. + * + * @param fn + * a function that initializes a builder to create the + * {@link UpdateByQueryRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture updateByQuery( + Function> fn) { + return updateByQuery(fn.apply(new UpdateByQueryRequest.Builder()).build()); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java new file mode 100644 index 000000000..3976f933b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/ElasticsearchClient.java @@ -0,0 +1,1791 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch; + +import co.elastic.clients.ApiClient; +import co.elastic.clients.elasticsearch._types.ElasticsearchException; +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch.async_search.ElasticsearchAsyncSearchClient; +import co.elastic.clients.elasticsearch.cat.ElasticsearchCatClient; +import co.elastic.clients.elasticsearch.cluster.ElasticsearchClusterClient; +import co.elastic.clients.elasticsearch.core.BulkRequest; +import co.elastic.clients.elasticsearch.core.BulkResponse; +import co.elastic.clients.elasticsearch.core.ClearScrollRequest; +import co.elastic.clients.elasticsearch.core.ClearScrollResponse; +import co.elastic.clients.elasticsearch.core.ClosePointInTimeRequest; +import co.elastic.clients.elasticsearch.core.ClosePointInTimeResponse; +import co.elastic.clients.elasticsearch.core.CountRequest; +import co.elastic.clients.elasticsearch.core.CountResponse; +import co.elastic.clients.elasticsearch.core.CreateRequest; +import co.elastic.clients.elasticsearch.core.CreateResponse; +import co.elastic.clients.elasticsearch.core.DeleteByQueryRequest; +import co.elastic.clients.elasticsearch.core.DeleteByQueryResponse; +import co.elastic.clients.elasticsearch.core.DeleteRequest; +import co.elastic.clients.elasticsearch.core.DeleteResponse; +import co.elastic.clients.elasticsearch.core.DeleteScriptRequest; +import co.elastic.clients.elasticsearch.core.DeleteScriptResponse; +import co.elastic.clients.elasticsearch.core.ExistsRequest; +import co.elastic.clients.elasticsearch.core.ExistsSourceRequest; +import co.elastic.clients.elasticsearch.core.FieldCapsRequest; +import co.elastic.clients.elasticsearch.core.FieldCapsResponse; +import co.elastic.clients.elasticsearch.core.GetRequest; +import co.elastic.clients.elasticsearch.core.GetResponse; +import co.elastic.clients.elasticsearch.core.GetScriptRequest; +import co.elastic.clients.elasticsearch.core.GetScriptResponse; +import co.elastic.clients.elasticsearch.core.GetSourceRequest; +import co.elastic.clients.elasticsearch.core.GetSourceResponse; +import co.elastic.clients.elasticsearch.core.IndexRequest; +import co.elastic.clients.elasticsearch.core.IndexResponse; +import co.elastic.clients.elasticsearch.core.InfoRequest; +import co.elastic.clients.elasticsearch.core.InfoResponse; +import co.elastic.clients.elasticsearch.core.MgetRequest; +import co.elastic.clients.elasticsearch.core.MgetResponse; +import co.elastic.clients.elasticsearch.core.MsearchRequest; +import co.elastic.clients.elasticsearch.core.MsearchResponse; +import co.elastic.clients.elasticsearch.core.MsearchTemplateRequest; +import co.elastic.clients.elasticsearch.core.MsearchTemplateResponse; +import co.elastic.clients.elasticsearch.core.MtermvectorsRequest; +import co.elastic.clients.elasticsearch.core.MtermvectorsResponse; +import co.elastic.clients.elasticsearch.core.OpenPointInTimeRequest; +import co.elastic.clients.elasticsearch.core.OpenPointInTimeResponse; +import co.elastic.clients.elasticsearch.core.PingRequest; +import co.elastic.clients.elasticsearch.core.PutScriptRequest; +import co.elastic.clients.elasticsearch.core.PutScriptResponse; +import co.elastic.clients.elasticsearch.core.RankEvalRequest; +import co.elastic.clients.elasticsearch.core.RankEvalResponse; +import co.elastic.clients.elasticsearch.core.RenderSearchTemplateRequest; +import co.elastic.clients.elasticsearch.core.RenderSearchTemplateResponse; +import co.elastic.clients.elasticsearch.core.ScriptsPainlessExecuteRequest; +import co.elastic.clients.elasticsearch.core.ScriptsPainlessExecuteResponse; +import co.elastic.clients.elasticsearch.core.ScrollRequest; +import co.elastic.clients.elasticsearch.core.ScrollResponse; +import co.elastic.clients.elasticsearch.core.SearchMvtRequest; +import co.elastic.clients.elasticsearch.core.SearchRequest; +import co.elastic.clients.elasticsearch.core.SearchResponse; +import co.elastic.clients.elasticsearch.core.SearchTemplateRequest; +import co.elastic.clients.elasticsearch.core.SearchTemplateResponse; +import co.elastic.clients.elasticsearch.core.TermsEnumRequest; +import co.elastic.clients.elasticsearch.core.TermsEnumResponse; +import co.elastic.clients.elasticsearch.core.TermvectorsRequest; +import co.elastic.clients.elasticsearch.core.TermvectorsResponse; +import co.elastic.clients.elasticsearch.core.UpdateByQueryRequest; +import co.elastic.clients.elasticsearch.core.UpdateByQueryResponse; +import co.elastic.clients.elasticsearch.core.UpdateRequest; +import co.elastic.clients.elasticsearch.core.UpdateResponse; +import co.elastic.clients.elasticsearch.enrich.ElasticsearchEnrichClient; +import co.elastic.clients.elasticsearch.graph.ElasticsearchGraphClient; +import co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient; +import co.elastic.clients.elasticsearch.ingest.ElasticsearchIngestClient; +import co.elastic.clients.elasticsearch.logstash.ElasticsearchLogstashClient; +import co.elastic.clients.elasticsearch.ml.ElasticsearchMlClient; +import co.elastic.clients.elasticsearch.query_ruleset.ElasticsearchQueryRulesetClient; +import co.elastic.clients.elasticsearch.search_application.ElasticsearchSearchApplicationClient; +import co.elastic.clients.elasticsearch.security.ElasticsearchSecurityClient; +import co.elastic.clients.elasticsearch.synonyms.ElasticsearchSynonymsClient; +import co.elastic.clients.elasticsearch.transform.ElasticsearchTransformClient; +import co.elastic.clients.transport.ElasticsearchTransport; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.JsonEndpoint; +import co.elastic.clients.transport.Transport; +import co.elastic.clients.transport.TransportOptions; +import co.elastic.clients.transport.endpoints.BinaryResponse; +import co.elastic.clients.transport.endpoints.BooleanResponse; +import co.elastic.clients.transport.endpoints.EndpointWithResponseMapperAttr; +import co.elastic.clients.util.ObjectBuilder; +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.function.Function; +import javax.annotation.Nullable; + +/** + * Client for the namespace. + */ +public class ElasticsearchClient extends ApiClient { + + public ElasticsearchClient(ElasticsearchTransport transport) { + super(transport, null); + } + + public ElasticsearchClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + @Override + public ElasticsearchClient withTransportOptions(@Nullable TransportOptions transportOptions) { + return new ElasticsearchClient(this.transport, transportOptions); + } + + // ----- Child clients + + public ElasticsearchAsyncSearchClient asyncSearch() { + return new ElasticsearchAsyncSearchClient(this.transport, this.transportOptions); + } + + public ElasticsearchCatClient cat() { + return new ElasticsearchCatClient(this.transport, this.transportOptions); + } + + public ElasticsearchClusterClient cluster() { + return new ElasticsearchClusterClient(this.transport, this.transportOptions); + } + + public ElasticsearchEnrichClient enrich() { + return new ElasticsearchEnrichClient(this.transport, this.transportOptions); + } + + public ElasticsearchGraphClient graph() { + return new ElasticsearchGraphClient(this.transport, this.transportOptions); + } + + public ElasticsearchIndicesClient indices() { + return new ElasticsearchIndicesClient(this.transport, this.transportOptions); + } + + public ElasticsearchIngestClient ingest() { + return new ElasticsearchIngestClient(this.transport, this.transportOptions); + } + + public ElasticsearchLogstashClient logstash() { + return new ElasticsearchLogstashClient(this.transport, this.transportOptions); + } + + public ElasticsearchMlClient ml() { + return new ElasticsearchMlClient(this.transport, this.transportOptions); + } + + public ElasticsearchQueryRulesetClient queryRuleset() { + return new ElasticsearchQueryRulesetClient(this.transport, this.transportOptions); + } + + public ElasticsearchSearchApplicationClient searchApplication() { + return new ElasticsearchSearchApplicationClient(this.transport, this.transportOptions); + } + + public ElasticsearchSecurityClient security() { + return new ElasticsearchSecurityClient(this.transport, this.transportOptions); + } + + public ElasticsearchSynonymsClient synonyms() { + return new ElasticsearchSynonymsClient(this.transport, this.transportOptions); + } + + public ElasticsearchTransformClient transform() { + return new ElasticsearchTransformClient(this.transport, this.transportOptions); + } + + // ----- Endpoint: bulk + + /** + * Allows to perform multiple index/update/delete operations in a single + * request. + * + * @see Documentation + * on elastic.co + */ + + public BulkResponse bulk(BulkRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) BulkRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows to perform multiple index/update/delete operations in a single + * request. + * + * @param fn + * a function that initializes a builder to create the + * {@link BulkRequest} + * @see Documentation + * on elastic.co + */ + + public final BulkResponse bulk(Function> fn) + throws IOException, ElasticsearchException { + return bulk(fn.apply(new BulkRequest.Builder()).build()); + } + + /** + * Allows to perform multiple index/update/delete operations in a single + * request. + * + * @see Documentation + * on elastic.co + */ + + public BulkResponse bulk() throws IOException, ElasticsearchException { + return this.transport.performRequest(new BulkRequest.Builder().build(), BulkRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: clear_scroll + + /** + * Explicitly clears the search context for a scroll. + * + * @see Documentation + * on elastic.co + */ + + public ClearScrollResponse clearScroll(ClearScrollRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ClearScrollRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Explicitly clears the search context for a scroll. + * + * @param fn + * a function that initializes a builder to create the + * {@link ClearScrollRequest} + * @see Documentation + * on elastic.co + */ + + public final ClearScrollResponse clearScroll( + Function> fn) + throws IOException, ElasticsearchException { + return clearScroll(fn.apply(new ClearScrollRequest.Builder()).build()); + } + + /** + * Explicitly clears the search context for a scroll. + * + * @see Documentation + * on elastic.co + */ + + public ClearScrollResponse clearScroll() throws IOException, ElasticsearchException { + return this.transport.performRequest(new ClearScrollRequest.Builder().build(), ClearScrollRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: close_point_in_time + + /** + * Close a point in time + * + * @see Documentation + * on elastic.co + */ + + public ClosePointInTimeResponse closePointInTime(ClosePointInTimeRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ClosePointInTimeRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Close a point in time + * + * @param fn + * a function that initializes a builder to create the + * {@link ClosePointInTimeRequest} + * @see Documentation + * on elastic.co + */ + + public final ClosePointInTimeResponse closePointInTime( + Function> fn) + throws IOException, ElasticsearchException { + return closePointInTime(fn.apply(new ClosePointInTimeRequest.Builder()).build()); + } + + // ----- Endpoint: count + + /** + * Returns number of documents matching a query. + * + * @see Documentation + * on elastic.co + */ + + public CountResponse count(CountRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) CountRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns number of documents matching a query. + * + * @param fn + * a function that initializes a builder to create the + * {@link CountRequest} + * @see Documentation + * on elastic.co + */ + + public final CountResponse count(Function> fn) + throws IOException, ElasticsearchException { + return count(fn.apply(new CountRequest.Builder()).build()); + } + + /** + * Returns number of documents matching a query. + * + * @see Documentation + * on elastic.co + */ + + public CountResponse count() throws IOException, ElasticsearchException { + return this.transport.performRequest(new CountRequest.Builder().build(), CountRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: create + + /** + * Creates a new document in the index. + *

+ * Returns a 409 response when a document with a same ID already exists in the + * index. + * + * @see Documentation + * on elastic.co + */ + + public CreateResponse create(CreateRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, CreateResponse, ErrorResponse> endpoint = (JsonEndpoint, CreateResponse, ErrorResponse>) CreateRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Creates a new document in the index. + *

+ * Returns a 409 response when a document with a same ID already exists in the + * index. + * + * @param fn + * a function that initializes a builder to create the + * {@link CreateRequest} + * @see Documentation + * on elastic.co + */ + + public final CreateResponse create( + Function, ObjectBuilder>> fn) + throws IOException, ElasticsearchException { + return create(fn.apply(new CreateRequest.Builder()).build()); + } + + // ----- Endpoint: delete + + /** + * Removes a document from the index. + * + * @see Documentation + * on elastic.co + */ + + public DeleteResponse delete(DeleteRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Removes a document from the index. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteRequest} + * @see Documentation + * on elastic.co + */ + + public final DeleteResponse delete(Function> fn) + throws IOException, ElasticsearchException { + return delete(fn.apply(new DeleteRequest.Builder()).build()); + } + + // ----- Endpoint: delete_by_query + + /** + * Deletes documents matching the provided query. + * + * @see Documentation + * on elastic.co + */ + + public DeleteByQueryResponse deleteByQuery(DeleteByQueryRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteByQueryRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Deletes documents matching the provided query. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteByQueryRequest} + * @see Documentation + * on elastic.co + */ + + public final DeleteByQueryResponse deleteByQuery( + Function> fn) + throws IOException, ElasticsearchException { + return deleteByQuery(fn.apply(new DeleteByQueryRequest.Builder()).build()); + } + + // ----- Endpoint: delete_script + + /** + * Deletes a script. + * + * @see Documentation + * on elastic.co + */ + + public DeleteScriptResponse deleteScript(DeleteScriptRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteScriptRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Deletes a script. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteScriptRequest} + * @see Documentation + * on elastic.co + */ + + public final DeleteScriptResponse deleteScript( + Function> fn) + throws IOException, ElasticsearchException { + return deleteScript(fn.apply(new DeleteScriptRequest.Builder()).build()); + } + + // ----- Endpoint: exists + + /** + * Returns information about whether a document exists in an index. + * + * @see Documentation + * on elastic.co + */ + + public BooleanResponse exists(ExistsRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) ExistsRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns information about whether a document exists in an index. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExistsRequest} + * @see Documentation + * on elastic.co + */ + + public final BooleanResponse exists(Function> fn) + throws IOException, ElasticsearchException { + return exists(fn.apply(new ExistsRequest.Builder()).build()); + } + + // ----- Endpoint: exists_source + + /** + * Returns information about whether a document source exists in an index. + * + * @see Documentation + * on elastic.co + */ + + public BooleanResponse existsSource(ExistsSourceRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) ExistsSourceRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns information about whether a document source exists in an index. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExistsSourceRequest} + * @see Documentation + * on elastic.co + */ + + public final BooleanResponse existsSource( + Function> fn) + throws IOException, ElasticsearchException { + return existsSource(fn.apply(new ExistsSourceRequest.Builder()).build()); + } + + // ----- Endpoint: field_caps + + /** + * Returns the information about the capabilities of fields among multiple + * indices. + * + * @see Documentation + * on elastic.co + */ + + public FieldCapsResponse fieldCaps(FieldCapsRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) FieldCapsRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns the information about the capabilities of fields among multiple + * indices. + * + * @param fn + * a function that initializes a builder to create the + * {@link FieldCapsRequest} + * @see Documentation + * on elastic.co + */ + + public final FieldCapsResponse fieldCaps(Function> fn) + throws IOException, ElasticsearchException { + return fieldCaps(fn.apply(new FieldCapsRequest.Builder()).build()); + } + + /** + * Returns the information about the capabilities of fields among multiple + * indices. + * + * @see Documentation + * on elastic.co + */ + + public FieldCapsResponse fieldCaps() throws IOException, ElasticsearchException { + return this.transport.performRequest(new FieldCapsRequest.Builder().build(), FieldCapsRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: get + + /** + * Returns a document. + * + * @see Documentation + * on elastic.co + */ + + public GetResponse get(GetRequest request, Class tDocumentClass) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.get.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns a document. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetRequest} + * @see Documentation + * on elastic.co + */ + + public final GetResponse get(Function> fn, + Class tDocumentClass) throws IOException, ElasticsearchException { + return get(fn.apply(new GetRequest.Builder()).build(), tDocumentClass); + } + + /** + * Returns a document. + * + * @see Documentation + * on elastic.co + */ + + public GetResponse get(GetRequest request, Type tDocumentType) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.get.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns a document. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetRequest} + * @see Documentation + * on elastic.co + */ + + public final GetResponse get(Function> fn, + Type tDocumentType) throws IOException, ElasticsearchException { + return get(fn.apply(new GetRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: get_script + + /** + * Returns a script. + * + * @see Documentation + * on elastic.co + */ + + public GetScriptResponse getScript(GetScriptRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetScriptRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns a script. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetScriptRequest} + * @see Documentation + * on elastic.co + */ + + public final GetScriptResponse getScript(Function> fn) + throws IOException, ElasticsearchException { + return getScript(fn.apply(new GetScriptRequest.Builder()).build()); + } + + // ----- Endpoint: get_source + + /** + * Returns the source of a document. + * + * @see Documentation + * on elastic.co + */ + + public GetSourceResponse getSource(GetSourceRequest request, Class tDocumentClass) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetSourceRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.get_source.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns the source of a document. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetSourceRequest} + * @see Documentation + * on elastic.co + */ + + public final GetSourceResponse getSource( + Function> fn, Class tDocumentClass) + throws IOException, ElasticsearchException { + return getSource(fn.apply(new GetSourceRequest.Builder()).build(), tDocumentClass); + } + + /** + * Returns the source of a document. + * + * @see Documentation + * on elastic.co + */ + + public GetSourceResponse getSource(GetSourceRequest request, Type tDocumentType) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) GetSourceRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.get_source.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns the source of a document. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetSourceRequest} + * @see Documentation + * on elastic.co + */ + + public final GetSourceResponse getSource( + Function> fn, Type tDocumentType) + throws IOException, ElasticsearchException { + return getSource(fn.apply(new GetSourceRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: index + + /** + * Creates or updates a document in an index. + * + * @see Documentation + * on elastic.co + */ + + public IndexResponse index(IndexRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, IndexResponse, ErrorResponse> endpoint = (JsonEndpoint, IndexResponse, ErrorResponse>) IndexRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Creates or updates a document in an index. + * + * @param fn + * a function that initializes a builder to create the + * {@link IndexRequest} + * @see Documentation + * on elastic.co + */ + + public final IndexResponse index( + Function, ObjectBuilder>> fn) + throws IOException, ElasticsearchException { + return index(fn.apply(new IndexRequest.Builder()).build()); + } + + // ----- Endpoint: info + + /** + * Returns basic information about the cluster. + * + * @see Documentation + * on elastic.co + */ + public InfoResponse info() throws IOException, ElasticsearchException { + return this.transport.performRequest(InfoRequest._INSTANCE, InfoRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: mget + + /** + * Allows to get multiple documents in one request. + * + * @see Documentation + * on elastic.co + */ + + public MgetResponse mget(MgetRequest request, Class tDocumentClass) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.mget.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows to get multiple documents in one request. + * + * @param fn + * a function that initializes a builder to create the + * {@link MgetRequest} + * @see Documentation + * on elastic.co + */ + + public final MgetResponse mget(Function> fn, + Class tDocumentClass) throws IOException, ElasticsearchException { + return mget(fn.apply(new MgetRequest.Builder()).build(), tDocumentClass); + } + + /** + * Allows to get multiple documents in one request. + * + * @see Documentation + * on elastic.co + */ + + public MgetResponse mget(MgetRequest request, Type tDocumentType) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MgetRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.mget.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows to get multiple documents in one request. + * + * @param fn + * a function that initializes a builder to create the + * {@link MgetRequest} + * @see Documentation + * on elastic.co + */ + + public final MgetResponse mget(Function> fn, + Type tDocumentType) throws IOException, ElasticsearchException { + return mget(fn.apply(new MgetRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: msearch + + /** + * Allows to execute several search operations in one request. + * + * @see Documentation + * on elastic.co + */ + + public MsearchResponse msearch(MsearchRequest request, Class tDocumentClass) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.msearch.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows to execute several search operations in one request. + * + * @param fn + * a function that initializes a builder to create the + * {@link MsearchRequest} + * @see Documentation + * on elastic.co + */ + + public final MsearchResponse msearch( + Function> fn, Class tDocumentClass) + throws IOException, ElasticsearchException { + return msearch(fn.apply(new MsearchRequest.Builder()).build(), tDocumentClass); + } + + /** + * Allows to execute several search operations in one request. + * + * @see Documentation + * on elastic.co + */ + + public MsearchResponse msearch(MsearchRequest request, Type tDocumentType) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.msearch.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows to execute several search operations in one request. + * + * @param fn + * a function that initializes a builder to create the + * {@link MsearchRequest} + * @see Documentation + * on elastic.co + */ + + public final MsearchResponse msearch( + Function> fn, Type tDocumentType) + throws IOException, ElasticsearchException { + return msearch(fn.apply(new MsearchRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: msearch_template + + /** + * Allows to execute several search template operations in one request. + * + * @see Documentation + * on elastic.co + */ + + public MsearchTemplateResponse msearchTemplate(MsearchTemplateRequest request, + Class tDocumentClass) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchTemplateRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.msearch_template.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows to execute several search template operations in one request. + * + * @param fn + * a function that initializes a builder to create the + * {@link MsearchTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final MsearchTemplateResponse msearchTemplate( + Function> fn, + Class tDocumentClass) throws IOException, ElasticsearchException { + return msearchTemplate(fn.apply(new MsearchTemplateRequest.Builder()).build(), tDocumentClass); + } + + /** + * Allows to execute several search template operations in one request. + * + * @see Documentation + * on elastic.co + */ + + public MsearchTemplateResponse msearchTemplate(MsearchTemplateRequest request, + Type tDocumentType) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) MsearchTemplateRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.msearch_template.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows to execute several search template operations in one request. + * + * @param fn + * a function that initializes a builder to create the + * {@link MsearchTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final MsearchTemplateResponse msearchTemplate( + Function> fn, Type tDocumentType) + throws IOException, ElasticsearchException { + return msearchTemplate(fn.apply(new MsearchTemplateRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: mtermvectors + + /** + * Returns multiple termvectors in one request. + * + * @see Documentation + * on elastic.co + */ + + public MtermvectorsResponse mtermvectors(MtermvectorsRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) MtermvectorsRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns multiple termvectors in one request. + * + * @param fn + * a function that initializes a builder to create the + * {@link MtermvectorsRequest} + * @see Documentation + * on elastic.co + */ + + public final MtermvectorsResponse mtermvectors( + Function> fn) + throws IOException, ElasticsearchException { + return mtermvectors(fn.apply(new MtermvectorsRequest.Builder()).build()); + } + + /** + * Returns multiple termvectors in one request. + * + * @see Documentation + * on elastic.co + */ + + public MtermvectorsResponse mtermvectors() throws IOException, ElasticsearchException { + return this.transport.performRequest(new MtermvectorsRequest.Builder().build(), MtermvectorsRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: open_point_in_time + + /** + * Open a point in time that can be used in subsequent searches + * + * @see Documentation + * on elastic.co + */ + + public OpenPointInTimeResponse openPointInTime(OpenPointInTimeRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) OpenPointInTimeRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Open a point in time that can be used in subsequent searches + * + * @param fn + * a function that initializes a builder to create the + * {@link OpenPointInTimeRequest} + * @see Documentation + * on elastic.co + */ + + public final OpenPointInTimeResponse openPointInTime( + Function> fn) + throws IOException, ElasticsearchException { + return openPointInTime(fn.apply(new OpenPointInTimeRequest.Builder()).build()); + } + + // ----- Endpoint: ping + + /** + * Returns whether the cluster is running. + * + * @see Documentation + * on elastic.co + */ + public BooleanResponse ping() throws IOException, ElasticsearchException { + return this.transport.performRequest(PingRequest._INSTANCE, PingRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: put_script + + /** + * Creates or updates a script. + * + * @see Documentation + * on elastic.co + */ + + public PutScriptResponse putScript(PutScriptRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutScriptRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Creates or updates a script. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutScriptRequest} + * @see Documentation + * on elastic.co + */ + + public final PutScriptResponse putScript(Function> fn) + throws IOException, ElasticsearchException { + return putScript(fn.apply(new PutScriptRequest.Builder()).build()); + } + + // ----- Endpoint: rank_eval + + /** + * Allows to evaluate the quality of ranked search results over a set of typical + * search queries + * + * @see Documentation + * on elastic.co + */ + + public RankEvalResponse rankEval(RankEvalRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) RankEvalRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows to evaluate the quality of ranked search results over a set of typical + * search queries + * + * @param fn + * a function that initializes a builder to create the + * {@link RankEvalRequest} + * @see Documentation + * on elastic.co + */ + + public final RankEvalResponse rankEval(Function> fn) + throws IOException, ElasticsearchException { + return rankEval(fn.apply(new RankEvalRequest.Builder()).build()); + } + + // ----- Endpoint: render_search_template + + /** + * Allows to use the Mustache language to pre-render a search definition. + * + * @see Documentation + * on elastic.co + */ + + public RenderSearchTemplateResponse renderSearchTemplate(RenderSearchTemplateRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) RenderSearchTemplateRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows to use the Mustache language to pre-render a search definition. + * + * @param fn + * a function that initializes a builder to create the + * {@link RenderSearchTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final RenderSearchTemplateResponse renderSearchTemplate( + Function> fn) + throws IOException, ElasticsearchException { + return renderSearchTemplate(fn.apply(new RenderSearchTemplateRequest.Builder()).build()); + } + + /** + * Allows to use the Mustache language to pre-render a search definition. + * + * @see Documentation + * on elastic.co + */ + + public RenderSearchTemplateResponse renderSearchTemplate() throws IOException, ElasticsearchException { + return this.transport.performRequest(new RenderSearchTemplateRequest.Builder().build(), + RenderSearchTemplateRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: scripts_painless_execute + + /** + * Allows an arbitrary script to be executed and a result to be returned + * + * @see Documentation + * on elastic.co + */ + + public ScriptsPainlessExecuteResponse scriptsPainlessExecute( + ScriptsPainlessExecuteRequest request, Class tResultClass) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScriptsPainlessExecuteRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.scripts_painless_execute.TResult", + getDeserializer(tResultClass)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows an arbitrary script to be executed and a result to be returned + * + * @param fn + * a function that initializes a builder to create the + * {@link ScriptsPainlessExecuteRequest} + * @see Documentation + * on elastic.co + */ + + public final ScriptsPainlessExecuteResponse scriptsPainlessExecute( + Function> fn, + Class tResultClass) throws IOException, ElasticsearchException { + return scriptsPainlessExecute(fn.apply(new ScriptsPainlessExecuteRequest.Builder()).build(), tResultClass); + } + + /** + * Allows an arbitrary script to be executed and a result to be returned + * + * @see Documentation + * on elastic.co + */ + + public ScriptsPainlessExecuteResponse scriptsPainlessExecute( + ScriptsPainlessExecuteRequest request, Type tResultType) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScriptsPainlessExecuteRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.scripts_painless_execute.TResult", + getDeserializer(tResultType)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows an arbitrary script to be executed and a result to be returned + * + * @param fn + * a function that initializes a builder to create the + * {@link ScriptsPainlessExecuteRequest} + * @see Documentation + * on elastic.co + */ + + public final ScriptsPainlessExecuteResponse scriptsPainlessExecute( + Function> fn, + Type tResultType) throws IOException, ElasticsearchException { + return scriptsPainlessExecute(fn.apply(new ScriptsPainlessExecuteRequest.Builder()).build(), tResultType); + } + + // ----- Endpoint: scroll + + /** + * Allows to retrieve a large numbers of results from a single search request. + * + * @see Documentation + * on elastic.co + */ + + public ScrollResponse scroll(ScrollRequest request, Class tDocumentClass) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.scroll.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows to retrieve a large numbers of results from a single search request. + * + * @param fn + * a function that initializes a builder to create the + * {@link ScrollRequest} + * @see Documentation + * on elastic.co + */ + + public final ScrollResponse scroll( + Function> fn, Class tDocumentClass) + throws IOException, ElasticsearchException { + return scroll(fn.apply(new ScrollRequest.Builder()).build(), tDocumentClass); + } + + /** + * Allows to retrieve a large numbers of results from a single search request. + * + * @see Documentation + * on elastic.co + */ + + public ScrollResponse scroll(ScrollRequest request, Type tDocumentType) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) ScrollRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.scroll.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows to retrieve a large numbers of results from a single search request. + * + * @param fn + * a function that initializes a builder to create the + * {@link ScrollRequest} + * @see Documentation + * on elastic.co + */ + + public final ScrollResponse scroll( + Function> fn, Type tDocumentType) + throws IOException, ElasticsearchException { + return scroll(fn.apply(new ScrollRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: search + + /** + * Returns results matching a query. + * + * @see Documentation + * on elastic.co + */ + + public SearchResponse search(SearchRequest request, Class tDocumentClass) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.search.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns results matching a query. + * + * @param fn + * a function that initializes a builder to create the + * {@link SearchRequest} + * @see Documentation + * on elastic.co + */ + + public final SearchResponse search( + Function> fn, Class tDocumentClass) + throws IOException, ElasticsearchException { + return search(fn.apply(new SearchRequest.Builder()).build(), tDocumentClass); + } + + /** + * Returns results matching a query. + * + * @see Documentation + * on elastic.co + */ + + public SearchResponse search(SearchRequest request, Type tDocumentType) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.search.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns results matching a query. + * + * @param fn + * a function that initializes a builder to create the + * {@link SearchRequest} + * @see Documentation + * on elastic.co + */ + + public final SearchResponse search( + Function> fn, Type tDocumentType) + throws IOException, ElasticsearchException { + return search(fn.apply(new SearchRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: search_mvt + + /** + * Searches a vector tile for geospatial values. Returns results as a binary + * Mapbox vector tile. + * + * @see Documentation + * on elastic.co + */ + + public BinaryResponse searchMvt(SearchMvtRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) SearchMvtRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Searches a vector tile for geospatial values. Returns results as a binary + * Mapbox vector tile. + * + * @param fn + * a function that initializes a builder to create the + * {@link SearchMvtRequest} + * @see Documentation + * on elastic.co + */ + + public final BinaryResponse searchMvt(Function> fn) + throws IOException, ElasticsearchException { + return searchMvt(fn.apply(new SearchMvtRequest.Builder()).build()); + } + + // ----- Endpoint: search_template + + /** + * Allows to use the Mustache language to pre-render a search definition. + * + * @see Documentation + * on elastic.co + */ + + public SearchTemplateResponse searchTemplate(SearchTemplateRequest request, + Class tDocumentClass) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchTemplateRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.search_template.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows to use the Mustache language to pre-render a search definition. + * + * @param fn + * a function that initializes a builder to create the + * {@link SearchTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final SearchTemplateResponse searchTemplate( + Function> fn, + Class tDocumentClass) throws IOException, ElasticsearchException { + return searchTemplate(fn.apply(new SearchTemplateRequest.Builder()).build(), tDocumentClass); + } + + /** + * Allows to use the Mustache language to pre-render a search definition. + * + * @see Documentation + * on elastic.co + */ + + public SearchTemplateResponse searchTemplate(SearchTemplateRequest request, + Type tDocumentType) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, ErrorResponse> endpoint = (JsonEndpoint, ErrorResponse>) SearchTemplateRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.search_template.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows to use the Mustache language to pre-render a search definition. + * + * @param fn + * a function that initializes a builder to create the + * {@link SearchTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final SearchTemplateResponse searchTemplate( + Function> fn, Type tDocumentType) + throws IOException, ElasticsearchException { + return searchTemplate(fn.apply(new SearchTemplateRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: terms_enum + + /** + * The terms enum API can be used to discover terms in the index that begin with + * the provided string. It is designed for low-latency look-ups used in + * auto-complete scenarios. + * + * @see Documentation + * on elastic.co + */ + + public TermsEnumResponse termsEnum(TermsEnumRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) TermsEnumRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * The terms enum API can be used to discover terms in the index that begin with + * the provided string. It is designed for low-latency look-ups used in + * auto-complete scenarios. + * + * @param fn + * a function that initializes a builder to create the + * {@link TermsEnumRequest} + * @see Documentation + * on elastic.co + */ + + public final TermsEnumResponse termsEnum(Function> fn) + throws IOException, ElasticsearchException { + return termsEnum(fn.apply(new TermsEnumRequest.Builder()).build()); + } + + // ----- Endpoint: termvectors + + /** + * Returns information and statistics about terms in the fields of a particular + * document. + * + * @see Documentation + * on elastic.co + */ + + public TermvectorsResponse termvectors(TermvectorsRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, TermvectorsResponse, ErrorResponse> endpoint = (JsonEndpoint, TermvectorsResponse, ErrorResponse>) TermvectorsRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns information and statistics about terms in the fields of a particular + * document. + * + * @param fn + * a function that initializes a builder to create the + * {@link TermvectorsRequest} + * @see Documentation + * on elastic.co + */ + + public final TermvectorsResponse termvectors( + Function, ObjectBuilder>> fn) + throws IOException, ElasticsearchException { + return termvectors(fn.apply(new TermvectorsRequest.Builder()).build()); + } + + // ----- Endpoint: update + + /** + * Updates a document with a script or partial document. + * + * @see Documentation + * on elastic.co + */ + + public UpdateResponse update( + UpdateRequest request, Class tDocumentClass) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, UpdateResponse, ErrorResponse> endpoint = (JsonEndpoint, UpdateResponse, ErrorResponse>) UpdateRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.update.TDocument", getDeserializer(tDocumentClass)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Updates a document with a script or partial document. + * + * @param fn + * a function that initializes a builder to create the + * {@link UpdateRequest} + * @see Documentation + * on elastic.co + */ + + public final UpdateResponse update( + Function, ObjectBuilder>> fn, + Class tDocumentClass) throws IOException, ElasticsearchException { + return update(fn.apply(new UpdateRequest.Builder()).build(), tDocumentClass); + } + + /** + * Updates a document with a script or partial document. + * + * @see Documentation + * on elastic.co + */ + + public UpdateResponse update( + UpdateRequest request, Type tDocumentType) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint, UpdateResponse, ErrorResponse> endpoint = (JsonEndpoint, UpdateResponse, ErrorResponse>) UpdateRequest._ENDPOINT; + endpoint = new EndpointWithResponseMapperAttr<>(endpoint, + "co.elastic.clients:Deserializer:_global.update.TDocument", getDeserializer(tDocumentType)); + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Updates a document with a script or partial document. + * + * @param fn + * a function that initializes a builder to create the + * {@link UpdateRequest} + * @see Documentation + * on elastic.co + */ + + public final UpdateResponse update( + Function, ObjectBuilder>> fn, + Type tDocumentType) throws IOException, ElasticsearchException { + return update(fn.apply(new UpdateRequest.Builder()).build(), tDocumentType); + } + + // ----- Endpoint: update_by_query + + /** + * Performs an update on every document in the index without changing the + * source, for example to pick up a mapping change. + * + * @see Documentation + * on elastic.co + */ + + public UpdateByQueryResponse updateByQuery(UpdateByQueryRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) UpdateByQueryRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Performs an update on every document in the index without changing the + * source, for example to pick up a mapping change. + * + * @param fn + * a function that initializes a builder to create the + * {@link UpdateByQueryRequest} + * @see Documentation + * on elastic.co + */ + + public final UpdateByQueryResponse updateByQuery( + Function> fn) + throws IOException, ElasticsearchException { + return updateByQuery(fn.apply(new UpdateByQueryRequest.Builder()).build()); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_helpers b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_helpers new file mode 120000 index 000000000..e85ed36e5 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_helpers @@ -0,0 +1 @@ +../../../../../../../../java-client/src/main/java/co/elastic/clients/elasticsearch/_helpers \ No newline at end of file diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/AcknowledgedResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/AcknowledgedResponse.java new file mode 100644 index 000000000..82efd08d4 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/AcknowledgedResponse.java @@ -0,0 +1,27 @@ +/* + * 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; + +/** + * Base interface for responses that are acknowledged by the server + */ +public interface AcknowledgedResponse { + boolean acknowledged(); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/AcknowledgedResponseBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/AcknowledgedResponseBase.java new file mode 100644 index 000000000..447ea4f25 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/AcknowledgedResponseBase.java @@ -0,0 +1,118 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Boolean; +import java.util.Objects; + +// typedef: _types.AcknowledgedResponseBase + +/** + * + * @see API + * specification + */ + +public abstract class AcknowledgedResponseBase implements AcknowledgedResponse, JsonpSerializable { + private final boolean acknowledged; + + // --------------------------------------------------------------------------------------------- + + protected AcknowledgedResponseBase(AbstractBuilder builder) { + + this.acknowledged = ApiTypeHelper.requireNonNull(builder.acknowledged, this, "acknowledged"); + + } + + /** + * Required - For a successful response, this value is always true. On failure, + * an exception is returned instead. + *

+ * API name: {@code acknowledged} + */ + public final boolean acknowledged() { + return this.acknowledged; + } + + /** + * 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("acknowledged"); + generator.write(this.acknowledged); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public abstract static class AbstractBuilder> + extends + WithJsonObjectBuilderBase { + private Boolean acknowledged; + + /** + * Required - For a successful response, this value is always true. On failure, + * an exception is returned instead. + *

+ * API name: {@code acknowledged} + */ + public final BuilderT acknowledged(boolean value) { + this.acknowledged = value; + return self(); + } + + protected abstract BuilderT self(); + + } + + // --------------------------------------------------------------------------------------------- + protected static > void setupAcknowledgedResponseBaseDeserializer( + ObjectDeserializer op) { + + op.add(AbstractBuilder::acknowledged, JsonpDeserializer.booleanDeserializer(), "acknowledged"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/BulkIndexByScrollFailure.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/BulkIndexByScrollFailure.java new file mode 100644 index 000000000..3d6412daa --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/BulkIndexByScrollFailure.java @@ -0,0 +1,249 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Integer; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.BulkIndexByScrollFailure + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class BulkIndexByScrollFailure implements JsonpSerializable { + private final ErrorCause cause; + + private final String id; + + private final String index; + + private final int status; + + private final String type; + + // --------------------------------------------------------------------------------------------- + + private BulkIndexByScrollFailure(Builder builder) { + + this.cause = ApiTypeHelper.requireNonNull(builder.cause, this, "cause"); + this.id = ApiTypeHelper.requireNonNull(builder.id, this, "id"); + this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); + this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status"); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + + } + + public static BulkIndexByScrollFailure of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code cause} + */ + public final ErrorCause cause() { + return this.cause; + } + + /** + * Required - API name: {@code id} + */ + public final String id() { + return this.id; + } + + /** + * Required - API name: {@code index} + */ + public final String index() { + return this.index; + } + + /** + * Required - API name: {@code status} + */ + public final int status() { + return this.status; + } + + /** + * Required - API name: {@code type} + */ + public final String type() { + return this.type; + } + + /** + * 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("cause"); + this.cause.serialize(generator, mapper); + + generator.writeKey("id"); + generator.write(this.id); + + generator.writeKey("index"); + generator.write(this.index); + + generator.writeKey("status"); + generator.write(this.status); + + generator.writeKey("type"); + generator.write(this.type); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link BulkIndexByScrollFailure}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private ErrorCause cause; + + private String id; + + private String index; + + private Integer status; + + private String type; + + /** + * Required - API name: {@code cause} + */ + public final Builder cause(ErrorCause value) { + this.cause = value; + return this; + } + + /** + * Required - API name: {@code cause} + */ + public final Builder cause(Function> fn) { + return this.cause(fn.apply(new ErrorCause.Builder()).build()); + } + + /** + * Required - API name: {@code id} + */ + public final Builder id(String value) { + this.id = value; + return this; + } + + /** + * Required - API name: {@code index} + */ + public final Builder index(String value) { + this.index = value; + return this; + } + + /** + * Required - API name: {@code status} + */ + public final Builder status(int value) { + this.status = value; + return this; + } + + /** + * Required - API name: {@code type} + */ + public final Builder type(String value) { + this.type = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link BulkIndexByScrollFailure}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public BulkIndexByScrollFailure build() { + _checkSingleUse(); + + return new BulkIndexByScrollFailure(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link BulkIndexByScrollFailure} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, BulkIndexByScrollFailure::setupBulkIndexByScrollFailureDeserializer); + + protected static void setupBulkIndexByScrollFailureDeserializer( + ObjectDeserializer op) { + + op.add(Builder::cause, ErrorCause._DESERIALIZER, "cause"); + op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id"); + op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); + op.add(Builder::status, JsonpDeserializer.integerDeserializer(), "status"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Bytes.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Bytes.java new file mode 100644 index 000000000..3a06aafa6 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Bytes.java @@ -0,0 +1,61 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API specification + */ +@JsonpDeserializable +public enum Bytes implements JsonEnum { + Bytes("b"), + + KiloBytes("kb"), + + MegaBytes("mb"), + + GigaBytes("gb"), + + TeraBytes("tb"), + + PetaBytes("pb"), + + ; + + private final String jsonValue; + + Bytes(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(Bytes.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterDetails.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterDetails.java new file mode 100644 index 000000000..b20e194d4 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterDetails.java @@ -0,0 +1,311 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Boolean; +import java.lang.Long; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.ClusterDetails + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ClusterDetails implements JsonpSerializable { + private final ClusterSearchStatusEnum status; + + private final String indices; + + @Nullable + private final Long took; + + private final boolean timedOut; + + @Nullable + private final ShardStatistics shards; + + private final List failures; + + // --------------------------------------------------------------------------------------------- + + private ClusterDetails(Builder builder) { + + this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status"); + this.indices = ApiTypeHelper.requireNonNull(builder.indices, this, "indices"); + this.took = builder.took; + this.timedOut = ApiTypeHelper.requireNonNull(builder.timedOut, this, "timedOut"); + this.shards = builder.shards; + this.failures = ApiTypeHelper.unmodifiable(builder.failures); + + } + + public static ClusterDetails of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code status} + */ + public final ClusterSearchStatusEnum status() { + return this.status; + } + + /** + * Required - API name: {@code indices} + */ + public final String indices() { + return this.indices; + } + + /** + * API name: {@code took} + */ + @Nullable + public final Long took() { + return this.took; + } + + /** + * Required - API name: {@code timed_out} + */ + public final boolean timedOut() { + return this.timedOut; + } + + /** + * API name: {@code _shards} + */ + @Nullable + public final ShardStatistics shards() { + return this.shards; + } + + /** + * API name: {@code failures} + */ + public final List failures() { + return this.failures; + } + + /** + * 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("status"); + this.status.serialize(generator, mapper); + generator.writeKey("indices"); + generator.write(this.indices); + + if (this.took != null) { + generator.writeKey("took"); + generator.write(this.took); + + } + generator.writeKey("timed_out"); + generator.write(this.timedOut); + + if (this.shards != null) { + generator.writeKey("_shards"); + this.shards.serialize(generator, mapper); + + } + if (ApiTypeHelper.isDefined(this.failures)) { + generator.writeKey("failures"); + generator.writeStartArray(); + for (ShardFailure item0 : this.failures) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ClusterDetails}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private ClusterSearchStatusEnum status; + + private String indices; + + @Nullable + private Long took; + + private Boolean timedOut; + + @Nullable + private ShardStatistics shards; + + @Nullable + private List failures; + + /** + * Required - API name: {@code status} + */ + public final Builder status(ClusterSearchStatusEnum value) { + this.status = value; + return this; + } + + /** + * Required - API name: {@code indices} + */ + public final Builder indices(String value) { + this.indices = value; + return this; + } + + /** + * API name: {@code took} + */ + public final Builder took(@Nullable Long value) { + this.took = value; + return this; + } + + /** + * Required - API name: {@code timed_out} + */ + public final Builder timedOut(boolean value) { + this.timedOut = value; + return this; + } + + /** + * API name: {@code _shards} + */ + public final Builder shards(@Nullable ShardStatistics value) { + this.shards = value; + return this; + } + + /** + * API name: {@code _shards} + */ + public final Builder shards(Function> fn) { + return this.shards(fn.apply(new ShardStatistics.Builder()).build()); + } + + /** + * API name: {@code failures} + *

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

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

+ * Adds a value to failures using a builder lambda. + */ + public final Builder failures(Function> fn) { + return failures(fn.apply(new ShardFailure.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ClusterDetails}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ClusterDetails build() { + _checkSingleUse(); + + return new ClusterDetails(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ClusterDetails} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + ClusterDetails::setupClusterDetailsDeserializer); + + protected static void setupClusterDetailsDeserializer(ObjectDeserializer op) { + + op.add(Builder::status, ClusterSearchStatusEnum._DESERIALIZER, "status"); + op.add(Builder::indices, JsonpDeserializer.stringDeserializer(), "indices"); + op.add(Builder::took, JsonpDeserializer.longDeserializer(), "took"); + op.add(Builder::timedOut, JsonpDeserializer.booleanDeserializer(), "timed_out"); + op.add(Builder::shards, ShardStatistics._DESERIALIZER, "_shards"); + op.add(Builder::failures, JsonpDeserializer.arrayDeserializer(ShardFailure._DESERIALIZER), "failures"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterInfoTarget.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterInfoTarget.java new file mode 100644 index 000000000..490c4f1c5 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterInfoTarget.java @@ -0,0 +1,61 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum ClusterInfoTarget implements JsonEnum { + All("_all"), + + Http("http"), + + Ingest("ingest"), + + ThreadPool("thread_pool"), + + Script("script"), + + ; + + private final String jsonValue; + + ClusterInfoTarget(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + ClusterInfoTarget.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterSearchStatusEnum.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterSearchStatusEnum.java new file mode 100644 index 000000000..65b16d906 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterSearchStatusEnum.java @@ -0,0 +1,61 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum ClusterSearchStatusEnum implements JsonEnum { + Running("running"), + + Successful("successful"), + + Partial("partial"), + + Skipped("skipped"), + + Failed("failed"), + + ; + + private final String jsonValue; + + ClusterSearchStatusEnum(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + ClusterSearchStatusEnum.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterStatistics.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterStatistics.java new file mode 100644 index 000000000..b763db074 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ClusterStatistics.java @@ -0,0 +1,247 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Integer; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.ClusterStatistics + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ClusterStatistics implements JsonpSerializable { + private final int skipped; + + private final int successful; + + private final int total; + + private final Map details; + + // --------------------------------------------------------------------------------------------- + + private ClusterStatistics(Builder builder) { + + this.skipped = ApiTypeHelper.requireNonNull(builder.skipped, this, "skipped"); + this.successful = ApiTypeHelper.requireNonNull(builder.successful, this, "successful"); + this.total = ApiTypeHelper.requireNonNull(builder.total, this, "total"); + this.details = ApiTypeHelper.unmodifiable(builder.details); + + } + + public static ClusterStatistics of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code skipped} + */ + public final int skipped() { + return this.skipped; + } + + /** + * Required - API name: {@code successful} + */ + public final int successful() { + return this.successful; + } + + /** + * Required - API name: {@code total} + */ + public final int total() { + return this.total; + } + + /** + * API name: {@code details} + */ + public final Map details() { + return this.details; + } + + /** + * 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("skipped"); + generator.write(this.skipped); + + generator.writeKey("successful"); + generator.write(this.successful); + + generator.writeKey("total"); + generator.write(this.total); + + if (ApiTypeHelper.isDefined(this.details)) { + generator.writeKey("details"); + generator.writeStartObject(); + for (Map.Entry item0 : this.details.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ClusterStatistics}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Integer skipped; + + private Integer successful; + + private Integer total; + + @Nullable + private Map details; + + /** + * Required - API name: {@code skipped} + */ + public final Builder skipped(int value) { + this.skipped = value; + return this; + } + + /** + * Required - API name: {@code successful} + */ + public final Builder successful(int value) { + this.successful = value; + return this; + } + + /** + * Required - API name: {@code total} + */ + public final Builder total(int value) { + this.total = value; + return this; + } + + /** + * API name: {@code details} + *

+ * Adds all entries of map to details. + */ + public final Builder details(Map map) { + this.details = _mapPutAll(this.details, map); + return this; + } + + /** + * API name: {@code details} + *

+ * Adds an entry to details. + */ + public final Builder details(String key, ClusterDetails value) { + this.details = _mapPut(this.details, key, value); + return this; + } + + /** + * API name: {@code details} + *

+ * Adds an entry to details using a builder lambda. + */ + public final Builder details(String key, Function> fn) { + return details(key, fn.apply(new ClusterDetails.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ClusterStatistics}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ClusterStatistics build() { + _checkSingleUse(); + + return new ClusterStatistics(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ClusterStatistics} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ClusterStatistics::setupClusterStatisticsDeserializer); + + protected static void setupClusterStatisticsDeserializer(ObjectDeserializer op) { + + op.add(Builder::skipped, JsonpDeserializer.integerDeserializer(), "skipped"); + op.add(Builder::successful, JsonpDeserializer.integerDeserializer(), "successful"); + op.add(Builder::total, JsonpDeserializer.integerDeserializer(), "total"); + op.add(Builder::details, JsonpDeserializer.stringMapDeserializer(ClusterDetails._DESERIALIZER), "details"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/CompletionStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/CompletionStats.java new file mode 100644 index 000000000..ea29c548c --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/CompletionStats.java @@ -0,0 +1,240 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.CompletionStats + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CompletionStats implements JsonpSerializable { + private final long sizeInBytes; + + @Nullable + private final String size; + + private final Map fields; + + // --------------------------------------------------------------------------------------------- + + private CompletionStats(Builder builder) { + + this.sizeInBytes = ApiTypeHelper.requireNonNull(builder.sizeInBytes, this, "sizeInBytes"); + this.size = builder.size; + this.fields = ApiTypeHelper.unmodifiable(builder.fields); + + } + + public static CompletionStats of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Total amount, in bytes, of memory used for completion across all + * shards assigned to selected nodes. + *

+ * API name: {@code size_in_bytes} + */ + public final long sizeInBytes() { + return this.sizeInBytes; + } + + /** + * Total amount of memory used for completion across all shards assigned to + * selected nodes. + *

+ * API name: {@code size} + */ + @Nullable + public final String size() { + return this.size; + } + + /** + * API name: {@code fields} + */ + public final Map fields() { + return this.fields; + } + + /** + * 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("size_in_bytes"); + generator.write(this.sizeInBytes); + + if (this.size != null) { + generator.writeKey("size"); + generator.write(this.size); + + } + if (ApiTypeHelper.isDefined(this.fields)) { + generator.writeKey("fields"); + generator.writeStartObject(); + for (Map.Entry item0 : this.fields.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CompletionStats}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Long sizeInBytes; + + @Nullable + private String size; + + @Nullable + private Map fields; + + /** + * Required - Total amount, in bytes, of memory used for completion across all + * shards assigned to selected nodes. + *

+ * API name: {@code size_in_bytes} + */ + public final Builder sizeInBytes(long value) { + this.sizeInBytes = value; + return this; + } + + /** + * Total amount of memory used for completion across all shards assigned to + * selected nodes. + *

+ * API name: {@code size} + */ + public final Builder size(@Nullable String value) { + this.size = value; + return this; + } + + /** + * API name: {@code fields} + *

+ * Adds all entries of map to fields. + */ + public final Builder fields(Map map) { + this.fields = _mapPutAll(this.fields, map); + return this; + } + + /** + * API name: {@code fields} + *

+ * Adds an entry to fields. + */ + public final Builder fields(String key, FieldSizeUsage value) { + this.fields = _mapPut(this.fields, key, value); + return this; + } + + /** + * API name: {@code fields} + *

+ * Adds an entry to fields using a builder lambda. + */ + public final Builder fields(String key, Function> fn) { + return fields(key, fn.apply(new FieldSizeUsage.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CompletionStats}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CompletionStats build() { + _checkSingleUse(); + + return new CompletionStats(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CompletionStats} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + CompletionStats::setupCompletionStatsDeserializer); + + protected static void setupCompletionStatsDeserializer(ObjectDeserializer op) { + + op.add(Builder::sizeInBytes, JsonpDeserializer.longDeserializer(), "size_in_bytes"); + op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size"); + op.add(Builder::fields, JsonpDeserializer.stringMapDeserializer(FieldSizeUsage._DESERIALIZER), "fields"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Conflicts.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Conflicts.java new file mode 100644 index 000000000..610e03f00 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Conflicts.java @@ -0,0 +1,61 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum Conflicts implements JsonEnum { + /** + * Stop reindexing if there are conflicts. + */ + Abort("abort"), + + /** + * Continue reindexing even if there are conflicts. + */ + Proceed("proceed"), + + ; + + private final String jsonValue; + + Conflicts(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + Conflicts.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/CoordsGeoBounds.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/CoordsGeoBounds.java new file mode 100644 index 000000000..a20fd4ea1 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/CoordsGeoBounds.java @@ -0,0 +1,213 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Double; +import java.util.Objects; +import java.util.function.Function; + +// typedef: _types.CoordsGeoBounds + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CoordsGeoBounds implements JsonpSerializable { + private final double top; + + private final double bottom; + + private final double left; + + private final double right; + + // --------------------------------------------------------------------------------------------- + + private CoordsGeoBounds(Builder builder) { + + this.top = ApiTypeHelper.requireNonNull(builder.top, this, "top"); + this.bottom = ApiTypeHelper.requireNonNull(builder.bottom, this, "bottom"); + this.left = ApiTypeHelper.requireNonNull(builder.left, this, "left"); + this.right = ApiTypeHelper.requireNonNull(builder.right, this, "right"); + + } + + public static CoordsGeoBounds of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code top} + */ + public final double top() { + return this.top; + } + + /** + * Required - API name: {@code bottom} + */ + public final double bottom() { + return this.bottom; + } + + /** + * Required - API name: {@code left} + */ + public final double left() { + return this.left; + } + + /** + * Required - API name: {@code right} + */ + public final double right() { + return this.right; + } + + /** + * 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("top"); + generator.write(this.top); + + generator.writeKey("bottom"); + generator.write(this.bottom); + + generator.writeKey("left"); + generator.write(this.left); + + generator.writeKey("right"); + generator.write(this.right); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CoordsGeoBounds}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Double top; + + private Double bottom; + + private Double left; + + private Double right; + + /** + * Required - API name: {@code top} + */ + public final Builder top(double value) { + this.top = value; + return this; + } + + /** + * Required - API name: {@code bottom} + */ + public final Builder bottom(double value) { + this.bottom = value; + return this; + } + + /** + * Required - API name: {@code left} + */ + public final Builder left(double value) { + this.left = value; + return this; + } + + /** + * Required - API name: {@code right} + */ + public final Builder right(double value) { + this.right = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CoordsGeoBounds}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CoordsGeoBounds build() { + _checkSingleUse(); + + return new CoordsGeoBounds(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CoordsGeoBounds} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + CoordsGeoBounds::setupCoordsGeoBoundsDeserializer); + + protected static void setupCoordsGeoBoundsDeserializer(ObjectDeserializer op) { + + op.add(Builder::top, JsonpDeserializer.doubleDeserializer(), "top"); + op.add(Builder::bottom, JsonpDeserializer.doubleDeserializer(), "bottom"); + op.add(Builder::left, JsonpDeserializer.doubleDeserializer(), "left"); + op.add(Builder::right, JsonpDeserializer.doubleDeserializer(), "right"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFIIndependenceMeasure.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFIIndependenceMeasure.java new file mode 100644 index 000000000..66c93bed6 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFIIndependenceMeasure.java @@ -0,0 +1,57 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum DFIIndependenceMeasure implements JsonEnum { + Standardized("standardized"), + + Saturated("saturated"), + + Chisquared("chisquared"), + + ; + + private final String jsonValue; + + DFIIndependenceMeasure(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + DFIIndependenceMeasure.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFRAfterEffect.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFRAfterEffect.java new file mode 100644 index 000000000..6cd3ce876 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFRAfterEffect.java @@ -0,0 +1,57 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum DFRAfterEffect implements JsonEnum { + No("no"), + + B("b"), + + L("l"), + + ; + + private final String jsonValue; + + DFRAfterEffect(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + DFRAfterEffect.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFRBasicModel.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFRBasicModel.java new file mode 100644 index 000000000..9f6e732ee --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DFRBasicModel.java @@ -0,0 +1,65 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum DFRBasicModel implements JsonEnum { + Be("be"), + + D("d"), + + G("g"), + + If("if"), + + In("in"), + + Ine("ine"), + + P("p"), + + ; + + private final String jsonValue; + + DFRBasicModel(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + DFRBasicModel.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DistanceUnit.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DistanceUnit.java new file mode 100644 index 000000000..5f443dcff --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DistanceUnit.java @@ -0,0 +1,69 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum DistanceUnit implements JsonEnum { + Inches("in"), + + Feet("ft"), + + Yards("yd"), + + Miles("mi"), + + NauticMiles("nmi"), + + Kilometers("km"), + + Meters("m"), + + Centimeters("cm"), + + Millimeters("mm"), + + ; + + private final String jsonValue; + + DistanceUnit(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + DistanceUnit.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DocStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DocStats.java new file mode 100644 index 000000000..c043db567 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/DocStats.java @@ -0,0 +1,190 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.DocStats + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DocStats implements JsonpSerializable { + private final long count; + + @Nullable + private final Long deleted; + + // --------------------------------------------------------------------------------------------- + + private DocStats(Builder builder) { + + this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); + this.deleted = builder.deleted; + + } + + public static DocStats of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Total number of non-deleted documents across all primary shards + * assigned to selected nodes. This number is based on documents in Lucene + * segments and may include documents from nested fields. + *

+ * API name: {@code count} + */ + public final long count() { + return this.count; + } + + /** + * Total number of deleted documents across all primary shards assigned to + * selected nodes. This number is based on documents in Lucene segments. + * Elasticsearch reclaims the disk space of deleted Lucene documents when a + * segment is merged. + *

+ * API name: {@code deleted} + */ + @Nullable + public final Long deleted() { + return this.deleted; + } + + /** + * 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("count"); + generator.write(this.count); + + if (this.deleted != null) { + generator.writeKey("deleted"); + generator.write(this.deleted); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DocStats}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Long count; + + @Nullable + private Long deleted; + + /** + * Required - Total number of non-deleted documents across all primary shards + * assigned to selected nodes. This number is based on documents in Lucene + * segments and may include documents from nested fields. + *

+ * API name: {@code count} + */ + public final Builder count(long value) { + this.count = value; + return this; + } + + /** + * Total number of deleted documents across all primary shards assigned to + * selected nodes. This number is based on documents in Lucene segments. + * Elasticsearch reclaims the disk space of deleted Lucene documents when a + * segment is merged. + *

+ * API name: {@code deleted} + */ + public final Builder deleted(@Nullable Long value) { + this.deleted = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DocStats}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DocStats build() { + _checkSingleUse(); + + return new DocStats(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DocStats} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + DocStats::setupDocStatsDeserializer); + + protected static void setupDocStatsDeserializer(ObjectDeserializer op) { + + op.add(Builder::count, JsonpDeserializer.longDeserializer(), "count"); + op.add(Builder::deleted, JsonpDeserializer.longDeserializer(), "deleted"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java new file mode 100644 index 000000000..5307ed515 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchException.java @@ -0,0 +1,69 @@ +/* + * 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; + +/** + * Exception thrown by API client methods when Elasticsearch could not accept or + * process a request. + *

+ * The {@link #error()} contains the error's type and reason along with + * additional details that depend on the error type and the API endpoint that + * was called. + */ +public class ElasticsearchException extends RuntimeException { + + private final ErrorResponse response; + private final String endpointId; + + public ElasticsearchException(String endpointId, ErrorResponse response) { + super("[" + endpointId + "] failed: [" + response.error().type() + "] " + response.error().reason()); + this.response = response; + this.endpointId = endpointId; + } + + /** + * Identifier of the API endpoint that failed to be called. + */ + public String endpointId() { + return this.endpointId; + } + + /** + * The error response sent by Elasticsearch + */ + public ErrorResponse response() { + return this.response; + } + + /** + * The cause of the error. Shortcut for {@code response().error()}. + */ + public ErrorCause error() { + return this.response.error(); + } + + /** + * Status code returned by Elasticsearch. Shortcut for + * {@code response().status()}. + */ + public int status() { + return this.response.status(); + } +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchVersionInfo.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchVersionInfo.java new file mode 100644 index 000000000..d5d1a0d98 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ElasticsearchVersionInfo.java @@ -0,0 +1,342 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.DateTime; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.ElasticsearchVersionInfo + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ElasticsearchVersionInfo implements JsonpSerializable { + private final DateTime buildDate; + + private final String buildFlavor; + + private final String buildHash; + + private final boolean buildSnapshot; + + private final String buildType; + + private final String luceneVersion; + + private final String minimumIndexCompatibilityVersion; + + private final String minimumWireCompatibilityVersion; + + private final String number; + + // --------------------------------------------------------------------------------------------- + + private ElasticsearchVersionInfo(Builder builder) { + + this.buildDate = ApiTypeHelper.requireNonNull(builder.buildDate, this, "buildDate"); + this.buildFlavor = ApiTypeHelper.requireNonNull(builder.buildFlavor, this, "buildFlavor"); + this.buildHash = ApiTypeHelper.requireNonNull(builder.buildHash, this, "buildHash"); + this.buildSnapshot = ApiTypeHelper.requireNonNull(builder.buildSnapshot, this, "buildSnapshot"); + this.buildType = ApiTypeHelper.requireNonNull(builder.buildType, this, "buildType"); + this.luceneVersion = ApiTypeHelper.requireNonNull(builder.luceneVersion, this, "luceneVersion"); + this.minimumIndexCompatibilityVersion = ApiTypeHelper.requireNonNull(builder.minimumIndexCompatibilityVersion, + this, "minimumIndexCompatibilityVersion"); + this.minimumWireCompatibilityVersion = ApiTypeHelper.requireNonNull(builder.minimumWireCompatibilityVersion, + this, "minimumWireCompatibilityVersion"); + this.number = ApiTypeHelper.requireNonNull(builder.number, this, "number"); + + } + + public static ElasticsearchVersionInfo of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code build_date} + */ + public final DateTime buildDate() { + return this.buildDate; + } + + /** + * Required - API name: {@code build_flavor} + */ + public final String buildFlavor() { + return this.buildFlavor; + } + + /** + * Required - API name: {@code build_hash} + */ + public final String buildHash() { + return this.buildHash; + } + + /** + * Required - API name: {@code build_snapshot} + */ + public final boolean buildSnapshot() { + return this.buildSnapshot; + } + + /** + * Required - API name: {@code build_type} + */ + public final String buildType() { + return this.buildType; + } + + /** + * Required - API name: {@code lucene_version} + */ + public final String luceneVersion() { + return this.luceneVersion; + } + + /** + * Required - API name: {@code minimum_index_compatibility_version} + */ + public final String minimumIndexCompatibilityVersion() { + return this.minimumIndexCompatibilityVersion; + } + + /** + * Required - API name: {@code minimum_wire_compatibility_version} + */ + public final String minimumWireCompatibilityVersion() { + return this.minimumWireCompatibilityVersion; + } + + /** + * Required - API name: {@code number} + */ + public final String number() { + return this.number; + } + + /** + * 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("build_date"); + this.buildDate.serialize(generator, mapper); + generator.writeKey("build_flavor"); + generator.write(this.buildFlavor); + + generator.writeKey("build_hash"); + generator.write(this.buildHash); + + generator.writeKey("build_snapshot"); + generator.write(this.buildSnapshot); + + generator.writeKey("build_type"); + generator.write(this.buildType); + + generator.writeKey("lucene_version"); + generator.write(this.luceneVersion); + + generator.writeKey("minimum_index_compatibility_version"); + generator.write(this.minimumIndexCompatibilityVersion); + + generator.writeKey("minimum_wire_compatibility_version"); + generator.write(this.minimumWireCompatibilityVersion); + + generator.writeKey("number"); + generator.write(this.number); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ElasticsearchVersionInfo}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private DateTime buildDate; + + private String buildFlavor; + + private String buildHash; + + private Boolean buildSnapshot; + + private String buildType; + + private String luceneVersion; + + private String minimumIndexCompatibilityVersion; + + private String minimumWireCompatibilityVersion; + + private String number; + + /** + * Required - API name: {@code build_date} + */ + public final Builder buildDate(DateTime value) { + this.buildDate = value; + return this; + } + + /** + * Required - API name: {@code build_flavor} + */ + public final Builder buildFlavor(String value) { + this.buildFlavor = value; + return this; + } + + /** + * Required - API name: {@code build_hash} + */ + public final Builder buildHash(String value) { + this.buildHash = value; + return this; + } + + /** + * Required - API name: {@code build_snapshot} + */ + public final Builder buildSnapshot(boolean value) { + this.buildSnapshot = value; + return this; + } + + /** + * Required - API name: {@code build_type} + */ + public final Builder buildType(String value) { + this.buildType = value; + return this; + } + + /** + * Required - API name: {@code lucene_version} + */ + public final Builder luceneVersion(String value) { + this.luceneVersion = value; + return this; + } + + /** + * Required - API name: {@code minimum_index_compatibility_version} + */ + public final Builder minimumIndexCompatibilityVersion(String value) { + this.minimumIndexCompatibilityVersion = value; + return this; + } + + /** + * Required - API name: {@code minimum_wire_compatibility_version} + */ + public final Builder minimumWireCompatibilityVersion(String value) { + this.minimumWireCompatibilityVersion = value; + return this; + } + + /** + * Required - API name: {@code number} + */ + public final Builder number(String value) { + this.number = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ElasticsearchVersionInfo}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ElasticsearchVersionInfo build() { + _checkSingleUse(); + + return new ElasticsearchVersionInfo(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ElasticsearchVersionInfo} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ElasticsearchVersionInfo::setupElasticsearchVersionInfoDeserializer); + + protected static void setupElasticsearchVersionInfoDeserializer( + ObjectDeserializer op) { + + op.add(Builder::buildDate, DateTime._DESERIALIZER, "build_date"); + op.add(Builder::buildFlavor, JsonpDeserializer.stringDeserializer(), "build_flavor"); + op.add(Builder::buildHash, JsonpDeserializer.stringDeserializer(), "build_hash"); + op.add(Builder::buildSnapshot, JsonpDeserializer.booleanDeserializer(), "build_snapshot"); + op.add(Builder::buildType, JsonpDeserializer.stringDeserializer(), "build_type"); + op.add(Builder::luceneVersion, JsonpDeserializer.stringDeserializer(), "lucene_version"); + op.add(Builder::minimumIndexCompatibilityVersion, JsonpDeserializer.stringDeserializer(), + "minimum_index_compatibility_version"); + op.add(Builder::minimumWireCompatibilityVersion, JsonpDeserializer.stringDeserializer(), + "minimum_wire_compatibility_version"); + op.add(Builder::number, JsonpDeserializer.stringDeserializer(), "number"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/EmptyObject.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/EmptyObject.java new file mode 100644 index 000000000..38470a72f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/EmptyObject.java @@ -0,0 +1,65 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.util.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; + +/** + * For empty Class assignments + * + * @see API + * specification + */ +@JsonpDeserializable +public class EmptyObject implements JsonpSerializable { + + public static final class Builder implements ObjectBuilder { + @Override + public EmptyObject build() { + return EmptyObject._INSTANCE; + } + } + + /** + * Serialize this object to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + generator.writeEnd(); + } + + /** + * Singleton instance for empty class {@link EmptyObject}. + */ + public static final EmptyObject _INSTANCE = new EmptyObject(); + + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer + .emptyObject(EmptyObject._INSTANCE); + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorCause.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorCause.java new file mode 100644 index 000000000..1dbe92c22 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorCause.java @@ -0,0 +1,414 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonData; +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.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.ErrorCause + +/** + * Cause and details about a request failure. This class defines the properties + * common to all error types. Additional details are also provided, that depend + * on the error type. + * + * @see API + * specification + */ +@JsonpDeserializable +public class ErrorCause implements JsonpSerializable { + private final Map metadata; + + @Nullable + private final String type; + + @Nullable + private final String reason; + + @Nullable + private final String stackTrace; + + @Nullable + private final ErrorCause causedBy; + + private final List rootCause; + + private final List suppressed; + + // --------------------------------------------------------------------------------------------- + + private ErrorCause(Builder builder) { + + this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); + + this.type = builder.type; + this.reason = builder.reason; + this.stackTrace = builder.stackTrace; + this.causedBy = builder.causedBy; + this.rootCause = ApiTypeHelper.unmodifiable(builder.rootCause); + this.suppressed = ApiTypeHelper.unmodifiable(builder.suppressed); + + } + + public static ErrorCause of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Additional details about the error + */ + public final Map metadata() { + return this.metadata; + } + + /** + * The type of error + *

+ * API name: {@code type} + */ + @Nullable + public final String type() { + return this.type; + } + + /** + * A human-readable explanation of the error, in english + *

+ * API name: {@code reason} + */ + @Nullable + public final String reason() { + return this.reason; + } + + /** + * The server stack trace. Present only if the error_trace=true + * parameter was sent with the request. + *

+ * API name: {@code stack_trace} + */ + @Nullable + public final String stackTrace() { + return this.stackTrace; + } + + /** + * API name: {@code caused_by} + */ + @Nullable + public final ErrorCause causedBy() { + return this.causedBy; + } + + /** + * API name: {@code root_cause} + */ + public final List rootCause() { + return this.rootCause; + } + + /** + * API name: {@code suppressed} + */ + public final List suppressed() { + return this.suppressed; + } + + /** + * 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) { + + for (Map.Entry item0 : this.metadata.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + + if (this.type != null) { + generator.writeKey("type"); + generator.write(this.type); + + } + if (this.reason != null) { + generator.writeKey("reason"); + generator.write(this.reason); + + } + if (this.stackTrace != null) { + generator.writeKey("stack_trace"); + generator.write(this.stackTrace); + + } + if (this.causedBy != null) { + generator.writeKey("caused_by"); + this.causedBy.serialize(generator, mapper); + + } + if (ApiTypeHelper.isDefined(this.rootCause)) { + generator.writeKey("root_cause"); + generator.writeStartArray(); + for (ErrorCause item0 : this.rootCause) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.suppressed)) { + generator.writeKey("suppressed"); + generator.writeStartArray(); + for (ErrorCause item0 : this.suppressed) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ErrorCause}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Map metadata = new HashMap<>(); + + /** + * Additional details about the error + *

+ * Adds all entries of map to metadata. + */ + public final Builder metadata(Map map) { + this.metadata = _mapPutAll(this.metadata, map); + return this; + } + + /** + * Additional details about the error + *

+ * Adds an entry to metadata. + */ + public final Builder metadata(String key, JsonData value) { + this.metadata = _mapPut(this.metadata, key, value); + return this; + } + + @Nullable + private String type; + + @Nullable + private String reason; + + @Nullable + private String stackTrace; + + @Nullable + private ErrorCause causedBy; + + @Nullable + private List rootCause; + + @Nullable + private List suppressed; + + /** + * The type of error + *

+ * API name: {@code type} + */ + public final Builder type(@Nullable String value) { + this.type = value; + return this; + } + + /** + * A human-readable explanation of the error, in english + *

+ * API name: {@code reason} + */ + public final Builder reason(@Nullable String value) { + this.reason = value; + return this; + } + + /** + * The server stack trace. Present only if the error_trace=true + * parameter was sent with the request. + *

+ * API name: {@code stack_trace} + */ + public final Builder stackTrace(@Nullable String value) { + this.stackTrace = value; + return this; + } + + /** + * API name: {@code caused_by} + */ + public final Builder causedBy(@Nullable ErrorCause value) { + this.causedBy = value; + return this; + } + + /** + * API name: {@code caused_by} + */ + public final Builder causedBy(Function> fn) { + return this.causedBy(fn.apply(new ErrorCause.Builder()).build()); + } + + /** + * API name: {@code root_cause} + *

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

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

+ * Adds a value to rootCause using a builder lambda. + */ + public final Builder rootCause(Function> fn) { + return rootCause(fn.apply(new ErrorCause.Builder()).build()); + } + + /** + * API name: {@code suppressed} + *

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

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

+ * Adds a value to suppressed using a builder lambda. + */ + public final Builder suppressed(Function> fn) { + return suppressed(fn.apply(new ErrorCause.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ErrorCause}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ErrorCause build() { + _checkSingleUse(); + + return new ErrorCause(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ErrorCause} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + ErrorCause::setupErrorCauseDeserializer); + + protected static void setupErrorCauseDeserializer(ObjectDeserializer op) { + + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + op.add(Builder::reason, JsonpDeserializer.stringDeserializer(), "reason"); + op.add(Builder::stackTrace, JsonpDeserializer.stringDeserializer(), "stack_trace"); + op.add(Builder::causedBy, ErrorCause._DESERIALIZER, "caused_by"); + op.add(Builder::rootCause, JsonpDeserializer.arrayDeserializer(ErrorCause._DESERIALIZER), "root_cause"); + op.add(Builder::suppressed, JsonpDeserializer.arrayDeserializer(ErrorCause._DESERIALIZER), "suppressed"); + + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + builder.metadata(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + op.shortcutProperty("reason"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorResponse.java new file mode 100644 index 000000000..947137910 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ErrorResponse.java @@ -0,0 +1,175 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Integer; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.ErrorResponseBase + +/** + * The response returned by Elasticsearch when request execution did not + * succeed. + * + * @see API + * specification + */ +@JsonpDeserializable +public class ErrorResponse implements JsonpSerializable { + private final ErrorCause error; + + private final int status; + + // --------------------------------------------------------------------------------------------- + + private ErrorResponse(Builder builder) { + + this.error = ApiTypeHelper.requireNonNull(builder.error, this, "error"); + this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status"); + + } + + public static ErrorResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code error} + */ + public final ErrorCause error() { + return this.error; + } + + /** + * Required - API name: {@code status} + */ + public final int status() { + return this.status; + } + + /** + * 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("error"); + this.error.serialize(generator, mapper); + + generator.writeKey("status"); + generator.write(this.status); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ErrorResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private ErrorCause error; + + private Integer status; + + /** + * Required - API name: {@code error} + */ + public final Builder error(ErrorCause value) { + this.error = value; + return this; + } + + /** + * Required - API name: {@code error} + */ + public final Builder error(Function> fn) { + return this.error(fn.apply(new ErrorCause.Builder()).build()); + } + + /** + * Required - API name: {@code status} + */ + public final Builder status(int value) { + this.status = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ErrorResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ErrorResponse build() { + _checkSingleUse(); + + return new ErrorResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ErrorResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + ErrorResponse::setupErrorResponseDeserializer); + + protected static void setupErrorResponseDeserializer(ObjectDeserializer op) { + + op.add(Builder::error, ErrorCause._DESERIALIZER, "error"); + op.add(Builder::status, JsonpDeserializer.integerDeserializer(), "status"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ExpandWildcard.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ExpandWildcard.java new file mode 100644 index 000000000..decf357a9 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ExpandWildcard.java @@ -0,0 +1,78 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum ExpandWildcard implements JsonEnum { + /** + * Match any data stream or index, including hidden ones. + */ + All("all"), + + /** + * Match open, non-hidden indices. Also matches any non-hidden data stream. + */ + Open("open"), + + /** + * Match closed, non-hidden indices. Also matches any non-hidden data stream. + * Data streams cannot be closed. + */ + Closed("closed"), + + /** + * Match hidden data streams and hidden indices. Must be combined with open, + * closed, or both. + */ + Hidden("hidden"), + + /** + * Wildcard expressions are not accepted. + */ + None("none"), + + ; + + private final String jsonValue; + + ExpandWildcard(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + ExpandWildcard.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldMemoryUsage.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldMemoryUsage.java new file mode 100644 index 000000000..ae6a22f6f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldMemoryUsage.java @@ -0,0 +1,172 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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; + +// typedef: _types.FieldMemoryUsage + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class FieldMemoryUsage implements JsonpSerializable { + @Nullable + private final String memorySize; + + private final long memorySizeInBytes; + + // --------------------------------------------------------------------------------------------- + + private FieldMemoryUsage(Builder builder) { + + this.memorySize = builder.memorySize; + this.memorySizeInBytes = ApiTypeHelper.requireNonNull(builder.memorySizeInBytes, this, "memorySizeInBytes"); + + } + + public static FieldMemoryUsage of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code memory_size} + */ + @Nullable + public final String memorySize() { + return this.memorySize; + } + + /** + * Required - API name: {@code memory_size_in_bytes} + */ + public final long memorySizeInBytes() { + return this.memorySizeInBytes; + } + + /** + * 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 (this.memorySize != null) { + generator.writeKey("memory_size"); + generator.write(this.memorySize); + + } + generator.writeKey("memory_size_in_bytes"); + generator.write(this.memorySizeInBytes); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link FieldMemoryUsage}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private String memorySize; + + private Long memorySizeInBytes; + + /** + * API name: {@code memory_size} + */ + public final Builder memorySize(@Nullable String value) { + this.memorySize = value; + return this; + } + + /** + * Required - API name: {@code memory_size_in_bytes} + */ + public final Builder memorySizeInBytes(long value) { + this.memorySizeInBytes = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link FieldMemoryUsage}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public FieldMemoryUsage build() { + _checkSingleUse(); + + return new FieldMemoryUsage(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link FieldMemoryUsage} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + FieldMemoryUsage::setupFieldMemoryUsageDeserializer); + + protected static void setupFieldMemoryUsageDeserializer(ObjectDeserializer op) { + + op.add(Builder::memorySize, JsonpDeserializer.stringDeserializer(), "memory_size"); + op.add(Builder::memorySizeInBytes, JsonpDeserializer.longDeserializer(), "memory_size_in_bytes"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSizeUsage.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSizeUsage.java new file mode 100644 index 000000000..2e34ec3f4 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSizeUsage.java @@ -0,0 +1,172 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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; + +// typedef: _types.FieldSizeUsage + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class FieldSizeUsage implements JsonpSerializable { + @Nullable + private final String size; + + private final long sizeInBytes; + + // --------------------------------------------------------------------------------------------- + + private FieldSizeUsage(Builder builder) { + + this.size = builder.size; + this.sizeInBytes = ApiTypeHelper.requireNonNull(builder.sizeInBytes, this, "sizeInBytes"); + + } + + public static FieldSizeUsage of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code size} + */ + @Nullable + public final String size() { + return this.size; + } + + /** + * Required - API name: {@code size_in_bytes} + */ + public final long sizeInBytes() { + return this.sizeInBytes; + } + + /** + * 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 (this.size != null) { + generator.writeKey("size"); + generator.write(this.size); + + } + generator.writeKey("size_in_bytes"); + generator.write(this.sizeInBytes); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link FieldSizeUsage}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private String size; + + private Long sizeInBytes; + + /** + * API name: {@code size} + */ + public final Builder size(@Nullable String value) { + this.size = value; + return this; + } + + /** + * Required - API name: {@code size_in_bytes} + */ + public final Builder sizeInBytes(long value) { + this.sizeInBytes = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link FieldSizeUsage}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public FieldSizeUsage build() { + _checkSingleUse(); + + return new FieldSizeUsage(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link FieldSizeUsage} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + FieldSizeUsage::setupFieldSizeUsageDeserializer); + + protected static void setupFieldSizeUsageDeserializer(ObjectDeserializer op) { + + op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size"); + op.add(Builder::sizeInBytes, JsonpDeserializer.longDeserializer(), "size_in_bytes"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSort.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSort.java new file mode 100644 index 000000000..66d427725 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSort.java @@ -0,0 +1,393 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.elasticsearch._types.mapping.FieldType; +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; + +// typedef: _types.FieldSort + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class FieldSort implements JsonpSerializable { + // Single key dictionary + private final String field; + + @Nullable + private final FieldValue missing; + + @Nullable + private final SortMode mode; + + @Nullable + private final NestedSortValue nested; + + @Nullable + private final SortOrder order; + + @Nullable + private final FieldType unmappedType; + + @Nullable + private final FieldSortNumericType numericType; + + @Nullable + private final String format; + + // --------------------------------------------------------------------------------------------- + + private FieldSort(Builder builder) { + + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); + + this.missing = builder.missing; + this.mode = builder.mode; + this.nested = builder.nested; + this.order = builder.order; + this.unmappedType = builder.unmappedType; + this.numericType = builder.numericType; + this.format = builder.format; + + } + + public static FieldSort of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - The target field + */ + public final String field() { + return this.field; + } + + /** + * API name: {@code missing} + */ + @Nullable + public final FieldValue missing() { + return this.missing; + } + + /** + * API name: {@code mode} + */ + @Nullable + public final SortMode mode() { + return this.mode; + } + + /** + * API name: {@code nested} + */ + @Nullable + public final NestedSortValue nested() { + return this.nested; + } + + /** + * API name: {@code order} + */ + @Nullable + public final SortOrder order() { + return this.order; + } + + /** + * API name: {@code unmapped_type} + */ + @Nullable + public final FieldType unmappedType() { + return this.unmappedType; + } + + /** + * API name: {@code numeric_type} + */ + @Nullable + public final FieldSortNumericType numericType() { + return this.numericType; + } + + /** + * API name: {@code format} + */ + @Nullable + public final String format() { + return this.format; + } + + /** + * 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.writeStartObject(this.field); + + if (this.missing != null) { + generator.writeKey("missing"); + this.missing.serialize(generator, mapper); + + } + if (this.mode != null) { + generator.writeKey("mode"); + this.mode.serialize(generator, mapper); + } + if (this.nested != null) { + generator.writeKey("nested"); + this.nested.serialize(generator, mapper); + + } + if (this.order != null) { + generator.writeKey("order"); + this.order.serialize(generator, mapper); + } + if (this.unmappedType != null) { + generator.writeKey("unmapped_type"); + this.unmappedType.serialize(generator, mapper); + } + if (this.numericType != null) { + generator.writeKey("numeric_type"); + this.numericType.serialize(generator, mapper); + } + if (this.format != null) { + generator.writeKey("format"); + generator.write(this.format); + + } + + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link FieldSort}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String field; + + /** + * Required - The target field + */ + public final Builder field(String value) { + this.field = value; + return this; + } + + @Nullable + private FieldValue missing; + + @Nullable + private SortMode mode; + + @Nullable + private NestedSortValue nested; + + @Nullable + private SortOrder order; + + @Nullable + private FieldType unmappedType; + + @Nullable + private FieldSortNumericType numericType; + + @Nullable + private String format; + + /** + * API name: {@code missing} + */ + public final Builder missing(@Nullable FieldValue value) { + this.missing = value; + return this; + } + + /** + * API name: {@code missing} + */ + public final Builder missing(Function> fn) { + return this.missing(fn.apply(new FieldValue.Builder()).build()); + } + + /** + * API name: {@code missing} + */ + public final Builder missing(String value) { + this.missing = FieldValue.of(value); + return this; + } + + /** + * API name: {@code missing} + */ + public final Builder missing(long value) { + this.missing = FieldValue.of(value); + return this; + } + + /** + * API name: {@code missing} + */ + public final Builder missing(double value) { + this.missing = FieldValue.of(value); + return this; + } + + /** + * API name: {@code missing} + */ + public final Builder missing(boolean value) { + this.missing = FieldValue.of(value); + return this; + } + + /** + * API name: {@code mode} + */ + public final Builder mode(@Nullable SortMode value) { + this.mode = value; + return this; + } + + /** + * API name: {@code nested} + */ + public final Builder nested(@Nullable NestedSortValue value) { + this.nested = value; + return this; + } + + /** + * API name: {@code nested} + */ + public final Builder nested(Function> fn) { + return this.nested(fn.apply(new NestedSortValue.Builder()).build()); + } + + /** + * API name: {@code order} + */ + public final Builder order(@Nullable SortOrder value) { + this.order = value; + return this; + } + + /** + * API name: {@code unmapped_type} + */ + public final Builder unmappedType(@Nullable FieldType value) { + this.unmappedType = value; + return this; + } + + /** + * API name: {@code numeric_type} + */ + public final Builder numericType(@Nullable FieldSortNumericType value) { + this.numericType = value; + return this; + } + + /** + * API name: {@code format} + */ + public final Builder format(@Nullable String value) { + this.format = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link FieldSort}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public FieldSort build() { + _checkSingleUse(); + + return new FieldSort(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link FieldSort} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + FieldSort::setupFieldSortDeserializer); + + protected static void setupFieldSortDeserializer(ObjectDeserializer op) { + + op.add(Builder::missing, FieldValue._DESERIALIZER, "missing"); + op.add(Builder::mode, SortMode._DESERIALIZER, "mode"); + op.add(Builder::nested, NestedSortValue._DESERIALIZER, "nested"); + op.add(Builder::order, SortOrder._DESERIALIZER, "order"); + op.add(Builder::unmappedType, FieldType._DESERIALIZER, "unmapped_type"); + op.add(Builder::numericType, FieldSortNumericType._DESERIALIZER, "numeric_type"); + op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); + + op.setKey(Builder::field, JsonpDeserializer.stringDeserializer()); + op.shortcutProperty("order"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSortNumericType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSortNumericType.java new file mode 100644 index 000000000..1cb572300 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldSortNumericType.java @@ -0,0 +1,59 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum FieldSortNumericType implements JsonEnum { + Long("long"), + + Double("double"), + + Date("date"), + + DateNanos("date_nanos"), + + ; + + private final String jsonValue; + + FieldSortNumericType(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + FieldSortNumericType.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldValue.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldValue.java new file mode 100644 index 000000000..e68f12532 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FieldValue.java @@ -0,0 +1,316 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonData; +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.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.ObjectBuilderBase; +import co.elastic.clients.util.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; + +import java.lang.Boolean; +import java.lang.Double; +import java.lang.Long; +import java.lang.Object; +import java.lang.String; +import java.util.EnumSet; +import java.util.function.Consumer; + +// typedef: _types.FieldValue + +@JsonpDeserializable +public class FieldValue implements TaggedUnion, JsonpSerializable { + + public static FieldValue of(long value) { + return new FieldValue(Kind.Long, value); + } + + public static FieldValue of(double value) { + return new FieldValue(Kind.Double, value); + } + + public static FieldValue of(boolean value) { + return value ? TRUE : FALSE; + } + + public static FieldValue of(String value) { + return new FieldValue(Kind.String, value); + } + + public static FieldValue of(JsonData value) { + return new FieldValue(Kind.Any, value); + } + + public static final FieldValue NULL = new FieldValue(Kind.Null, null); + public static final FieldValue TRUE = new FieldValue(Kind.Boolean, Boolean.TRUE); + public static final FieldValue FALSE = new FieldValue(Kind.Boolean, Boolean.FALSE); + + public enum Kind { + Double, Long, Boolean, String, Null, Any + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + public String _toJsonString() { + switch (_kind) { + case Double : + return String.valueOf(this.doubleValue()); + case Long : + return String.valueOf(this.longValue()); + case Boolean : + return String.valueOf(this.booleanValue()); + case String : + return this.stringValue(); + case Null : + return "null"; + case Any : + throw new IllegalStateException("Composite field value cannot be formatted as a string"); + + default : + throw new IllegalStateException("Unknown kind " + _kind); + } + } + + private FieldValue(Builder builder) { + this(builder._kind, builder._value); + } + + private FieldValue(Kind kind, Object value) { + this._kind = ApiTypeHelper.requireNonNull(kind, this, ""); + this._value = kind == Kind.Null ? null : ApiTypeHelper.requireNonNull(value, this, ""); + } + + public static FieldValue of(Consumer fn) { + Builder builder = new Builder(); + fn.accept(builder); + return builder.build(); + } + + /** + * Is this variant instance of kind {@code double}? + */ + public boolean isDouble() { + return _kind == Kind.Double; + } + + /** + * Get the {@code double} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code double} kind. + */ + public double doubleValue() { + return TaggedUnionUtils.get(this, Kind.Double); + } + + /** + * Is this variant instance of kind {@code long}? + */ + public boolean isLong() { + return _kind == Kind.Long; + } + + /** + * Get the {@code long} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code long} kind. + */ + public long longValue() { + return TaggedUnionUtils.get(this, Kind.Long); + } + + /** + * Is this variant instance of kind {@code boolean}? + */ + public boolean isBoolean() { + return _kind == Kind.Boolean; + } + + /** + * Get the {@code boolean} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code boolean} kind. + */ + public boolean booleanValue() { + return TaggedUnionUtils.get(this, Kind.Boolean); + } + + /** + * Is this variant instance of kind {@code string}? + */ + public boolean isString() { + return _kind == Kind.String; + } + + /** + * Get the {@code string} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code string} kind. + */ + public String stringValue() { + return TaggedUnionUtils.get(this, Kind.String); + } + + /** + * Is this variant instance of kind {@code any}? + */ + public boolean isAny() { + return _kind == Kind.Any; + } + + /** + * Get the {@code any} variant value, used to represent non-scalar values (i.e. + * objects and arrays) + * + * @throws IllegalStateException + * if the current variant is not of the {@code string} kind. + */ + public JsonData anyValue() { + return TaggedUnionUtils.get(this, Kind.Any); + } + + /** + * Is this variant instance of kind {@code null}? + */ + public boolean isNull() { + return _kind == Kind.Null; + } + + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + switch (_kind) { + case Double : + generator.write(((Double) this._value)); + break; + case Long : + generator.write(((Long) this._value)); + break; + case Boolean : + generator.write(((Boolean) this._value)); + break; + case String : + generator.write(((String) this._value)); + break; + case Null : + generator.writeNull(); + break; + case Any : + ((JsonData) this._value).serialize(generator, mapper); + break; + } + } + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + private Kind _kind; + private Object _value; + + public ObjectBuilder doubleValue(double v) { + this._kind = Kind.Double; + this._value = v; + return this; + } + + public ObjectBuilder longValue(long v) { + this._kind = Kind.Long; + this._value = v; + return this; + } + + public ObjectBuilder booleanValue(boolean v) { + this._kind = Kind.Boolean; + this._value = v; + return this; + } + + public ObjectBuilder stringValue(String v) { + this._kind = Kind.String; + this._value = v; + return this; + } + + public ObjectBuilder anyValue(JsonData v) { + this._kind = Kind.Any; + this._value = v; + return this; + } + + public ObjectBuilder nullValue() { + this._kind = Kind.Null; + this._value = null; + return this; + } + + public FieldValue build() { + _checkSingleUse(); + return new FieldValue(this); + } + } + + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer + .lazy(() -> JsonpDeserializer.of(EnumSet.of(JsonParser.Event.VALUE_STRING, JsonParser.Event.VALUE_NUMBER, + JsonParser.Event.VALUE_NULL, JsonParser.Event.VALUE_TRUE, JsonParser.Event.VALUE_FALSE, + JsonParser.Event.START_OBJECT, JsonParser.Event.START_ARRAY), (parser, mapper, event) -> { + switch (event) { + case VALUE_NULL : + return NULL; + case VALUE_STRING : + return FieldValue.of(parser.getString()); + case VALUE_TRUE : + return FieldValue.of(true); + case VALUE_FALSE : + return FieldValue.of(false); + case VALUE_NUMBER : + if (parser.isIntegralNumber()) { + return FieldValue.of(parser.getLong()); + } else { + return FieldValue.of(parser.getBigDecimal().doubleValue()); + } + case START_OBJECT : + case START_ARRAY : + return FieldValue.of(JsonData.of(parser.getValue())); + } + return null; + })); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FielddataStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FielddataStats.java new file mode 100644 index 000000000..ecc0c33f5 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/FielddataStats.java @@ -0,0 +1,258 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.FielddataStats + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class FielddataStats implements JsonpSerializable { + @Nullable + private final Long evictions; + + @Nullable + private final String memorySize; + + private final long memorySizeInBytes; + + private final Map fields; + + // --------------------------------------------------------------------------------------------- + + private FielddataStats(Builder builder) { + + this.evictions = builder.evictions; + this.memorySize = builder.memorySize; + this.memorySizeInBytes = ApiTypeHelper.requireNonNull(builder.memorySizeInBytes, this, "memorySizeInBytes"); + this.fields = ApiTypeHelper.unmodifiable(builder.fields); + + } + + public static FielddataStats of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code evictions} + */ + @Nullable + public final Long evictions() { + return this.evictions; + } + + /** + * API name: {@code memory_size} + */ + @Nullable + public final String memorySize() { + return this.memorySize; + } + + /** + * Required - API name: {@code memory_size_in_bytes} + */ + public final long memorySizeInBytes() { + return this.memorySizeInBytes; + } + + /** + * API name: {@code fields} + */ + public final Map fields() { + return this.fields; + } + + /** + * 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 (this.evictions != null) { + generator.writeKey("evictions"); + generator.write(this.evictions); + + } + if (this.memorySize != null) { + generator.writeKey("memory_size"); + generator.write(this.memorySize); + + } + generator.writeKey("memory_size_in_bytes"); + generator.write(this.memorySizeInBytes); + + if (ApiTypeHelper.isDefined(this.fields)) { + generator.writeKey("fields"); + generator.writeStartObject(); + for (Map.Entry item0 : this.fields.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link FielddataStats}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Long evictions; + + @Nullable + private String memorySize; + + private Long memorySizeInBytes; + + @Nullable + private Map fields; + + /** + * API name: {@code evictions} + */ + public final Builder evictions(@Nullable Long value) { + this.evictions = value; + return this; + } + + /** + * API name: {@code memory_size} + */ + public final Builder memorySize(@Nullable String value) { + this.memorySize = value; + return this; + } + + /** + * Required - API name: {@code memory_size_in_bytes} + */ + public final Builder memorySizeInBytes(long value) { + this.memorySizeInBytes = value; + return this; + } + + /** + * API name: {@code fields} + *

+ * Adds all entries of map to fields. + */ + public final Builder fields(Map map) { + this.fields = _mapPutAll(this.fields, map); + return this; + } + + /** + * API name: {@code fields} + *

+ * Adds an entry to fields. + */ + public final Builder fields(String key, FieldMemoryUsage value) { + this.fields = _mapPut(this.fields, key, value); + return this; + } + + /** + * API name: {@code fields} + *

+ * Adds an entry to fields using a builder lambda. + */ + public final Builder fields(String key, + Function> fn) { + return fields(key, fn.apply(new FieldMemoryUsage.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link FielddataStats}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public FielddataStats build() { + _checkSingleUse(); + + return new FielddataStats(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link FielddataStats} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + FielddataStats::setupFielddataStatsDeserializer); + + protected static void setupFielddataStatsDeserializer(ObjectDeserializer op) { + + op.add(Builder::evictions, JsonpDeserializer.longDeserializer(), "evictions"); + op.add(Builder::memorySize, JsonpDeserializer.stringDeserializer(), "memory_size"); + op.add(Builder::memorySizeInBytes, JsonpDeserializer.longDeserializer(), "memory_size_in_bytes"); + op.add(Builder::fields, JsonpDeserializer.stringMapDeserializer(FieldMemoryUsage._DESERIALIZER), "fields"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoBounds.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoBounds.java new file mode 100644 index 000000000..552e336c6 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoBounds.java @@ -0,0 +1,239 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.ObjectDeserializer; +import co.elastic.clients.json.UnionDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.ObjectBuilderBase; +import co.elastic.clients.util.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import jakarta.json.stream.JsonGenerator; +import java.lang.Object; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.GeoBounds + +/** + * A geo bounding box. It can be represented in various ways: + *

    + *
  • as 4 top/bottom/left/right coordinates
  • + *
  • as 2 top_left / bottom_right points
  • + *
  • as 2 top_right / bottom_left points
  • + *
  • as a WKT bounding box
  • + *
+ * + * @see API + * specification + */ +@JsonpDeserializable +public class GeoBounds implements TaggedUnion, JsonpSerializable { + + public enum Kind { + Coords, Tlbr, Trbl, Wkt + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + private GeoBounds(Kind kind, Object value) { + this._kind = kind; + this._value = value; + } + + private GeoBounds(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + + } + + public static GeoBounds of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Is this variant instance of kind {@code coords}? + */ + public boolean isCoords() { + return _kind == Kind.Coords; + } + + /** + * Get the {@code coords} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code coords} kind. + */ + public CoordsGeoBounds coords() { + return TaggedUnionUtils.get(this, Kind.Coords); + } + + /** + * Is this variant instance of kind {@code tlbr}? + */ + public boolean isTlbr() { + return _kind == Kind.Tlbr; + } + + /** + * Get the {@code tlbr} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code tlbr} kind. + */ + public TopLeftBottomRightGeoBounds tlbr() { + return TaggedUnionUtils.get(this, Kind.Tlbr); + } + + /** + * Is this variant instance of kind {@code trbl}? + */ + public boolean isTrbl() { + return _kind == Kind.Trbl; + } + + /** + * Get the {@code trbl} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code trbl} kind. + */ + public TopRightBottomLeftGeoBounds trbl() { + return TaggedUnionUtils.get(this, Kind.Trbl); + } + + /** + * Is this variant instance of kind {@code wkt}? + */ + public boolean isWkt() { + return _kind == Kind.Wkt; + } + + /** + * Get the {@code wkt} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code wkt} kind. + */ + public WktGeoBounds wkt() { + return TaggedUnionUtils.get(this, Kind.Wkt); + } + + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + private Kind _kind; + private Object _value; + + public ObjectBuilder coords(CoordsGeoBounds v) { + this._kind = Kind.Coords; + this._value = v; + return this; + } + + public ObjectBuilder coords(Function> fn) { + return this.coords(fn.apply(new CoordsGeoBounds.Builder()).build()); + } + + public ObjectBuilder tlbr(TopLeftBottomRightGeoBounds v) { + this._kind = Kind.Tlbr; + this._value = v; + return this; + } + + public ObjectBuilder tlbr( + Function> fn) { + return this.tlbr(fn.apply(new TopLeftBottomRightGeoBounds.Builder()).build()); + } + + public ObjectBuilder trbl(TopRightBottomLeftGeoBounds v) { + this._kind = Kind.Trbl; + this._value = v; + return this; + } + + public ObjectBuilder trbl( + Function> fn) { + return this.trbl(fn.apply(new TopRightBottomLeftGeoBounds.Builder()).build()); + } + + public ObjectBuilder wkt(WktGeoBounds v) { + this._kind = Kind.Wkt; + this._value = v; + return this; + } + + public ObjectBuilder wkt(Function> fn) { + return this.wkt(fn.apply(new WktGeoBounds.Builder()).build()); + } + + public GeoBounds build() { + _checkSingleUse(); + return new GeoBounds(this); + } + + } + + private static JsonpDeserializer buildGeoBoundsDeserializer() { + return new UnionDeserializer.Builder(GeoBounds::new, false) + .addMember(Kind.Coords, CoordsGeoBounds._DESERIALIZER) + .addMember(Kind.Tlbr, TopLeftBottomRightGeoBounds._DESERIALIZER) + .addMember(Kind.Trbl, TopRightBottomLeftGeoBounds._DESERIALIZER) + .addMember(Kind.Wkt, WktGeoBounds._DESERIALIZER).build(); + } + + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer + .lazy(GeoBounds::buildGeoBoundsDeserializer); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoBoundsBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoBoundsBuilders.java new file mode 100644 index 000000000..8a57ea128 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoBoundsBuilders.java @@ -0,0 +1,67 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +/** + * Builders for {@link GeoBounds} variants. + */ +public class GeoBoundsBuilders { + private GeoBoundsBuilders() { + } + + /** + * Creates a builder for the {@link CoordsGeoBounds coords} {@code GeoBounds} + * variant. + */ + public static CoordsGeoBounds.Builder coords() { + return new CoordsGeoBounds.Builder(); + } + + /** + * Creates a builder for the {@link TopLeftBottomRightGeoBounds tlbr} + * {@code GeoBounds} variant. + */ + public static TopLeftBottomRightGeoBounds.Builder tlbr() { + return new TopLeftBottomRightGeoBounds.Builder(); + } + + /** + * Creates a builder for the {@link TopRightBottomLeftGeoBounds trbl} + * {@code GeoBounds} variant. + */ + public static TopRightBottomLeftGeoBounds.Builder trbl() { + return new TopRightBottomLeftGeoBounds.Builder(); + } + + /** + * Creates a builder for the {@link WktGeoBounds wkt} {@code GeoBounds} variant. + */ + public static WktGeoBounds.Builder wkt() { + return new WktGeoBounds.Builder(); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceSort.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceSort.java new file mode 100644 index 000000000..21504e4ec --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceSort.java @@ -0,0 +1,339 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Boolean; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.GeoDistanceSort + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GeoDistanceSort implements SortOptionsVariant, JsonpSerializable { + private final String field; + + private final List location; + + @Nullable + private final SortMode mode; + + @Nullable + private final GeoDistanceType distanceType; + + @Nullable + private final Boolean ignoreUnmapped; + + @Nullable + private final SortOrder order; + + @Nullable + private final DistanceUnit unit; + + // --------------------------------------------------------------------------------------------- + + private GeoDistanceSort(Builder builder) { + + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); + this.location = ApiTypeHelper.unmodifiableRequired(builder.location, this, "location"); + + this.mode = builder.mode; + this.distanceType = builder.distanceType; + this.ignoreUnmapped = builder.ignoreUnmapped; + this.order = builder.order; + this.unit = builder.unit; + + } + + public static GeoDistanceSort of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * SortOptions variant kind. + */ + @Override + public SortOptions.Kind _sortOptionsKind() { + return SortOptions.Kind.GeoDistance; + } + + /** + * Required - + */ + public final String field() { + return this.field; + } + + /** + * Required - + */ + public final List location() { + return this.location; + } + + /** + * API name: {@code mode} + */ + @Nullable + public final SortMode mode() { + return this.mode; + } + + /** + * API name: {@code distance_type} + */ + @Nullable + public final GeoDistanceType distanceType() { + return this.distanceType; + } + + /** + * API name: {@code ignore_unmapped} + */ + @Nullable + public final Boolean ignoreUnmapped() { + return this.ignoreUnmapped; + } + + /** + * API name: {@code order} + */ + @Nullable + public final SortOrder order() { + return this.order; + } + + /** + * API name: {@code unit} + */ + @Nullable + public final DistanceUnit unit() { + return this.unit; + } + + /** + * 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(this.field); + generator.writeStartArray(); + for (GeoLocation item0 : this.location) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + if (this.mode != null) { + generator.writeKey("mode"); + this.mode.serialize(generator, mapper); + } + if (this.distanceType != null) { + generator.writeKey("distance_type"); + this.distanceType.serialize(generator, mapper); + } + if (this.ignoreUnmapped != null) { + generator.writeKey("ignore_unmapped"); + generator.write(this.ignoreUnmapped); + + } + if (this.order != null) { + generator.writeKey("order"); + this.order.serialize(generator, mapper); + } + if (this.unit != null) { + generator.writeKey("unit"); + this.unit.serialize(generator, mapper); + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GeoDistanceSort}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String field; + + private List location; + + /** + * Required - + */ + public final Builder field(String value) { + this.field = value; + return this; + } + + /** + * Required - Adds all elements of list to location. + */ + public final Builder location(List list) { + this.location = _listAddAll(this.location, list); + return this; + } + + /** + * Required - Adds one or more values to location. + */ + public final Builder location(GeoLocation value, GeoLocation... values) { + this.location = _listAdd(this.location, value, values); + return this; + } + + /** + * Required - Adds a value to location using a builder lambda. + */ + public final Builder location(Function> fn) { + return location(fn.apply(new GeoLocation.Builder()).build()); + } + + @Nullable + private SortMode mode; + + @Nullable + private GeoDistanceType distanceType; + + @Nullable + private Boolean ignoreUnmapped; + + @Nullable + private SortOrder order; + + @Nullable + private DistanceUnit unit; + + /** + * API name: {@code mode} + */ + public final Builder mode(@Nullable SortMode value) { + this.mode = value; + return this; + } + + /** + * API name: {@code distance_type} + */ + public final Builder distanceType(@Nullable GeoDistanceType value) { + this.distanceType = value; + return this; + } + + /** + * API name: {@code ignore_unmapped} + */ + public final Builder ignoreUnmapped(@Nullable Boolean value) { + this.ignoreUnmapped = value; + return this; + } + + /** + * API name: {@code order} + */ + public final Builder order(@Nullable SortOrder value) { + this.order = value; + return this; + } + + /** + * API name: {@code unit} + */ + public final Builder unit(@Nullable DistanceUnit value) { + this.unit = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GeoDistanceSort}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GeoDistanceSort build() { + _checkSingleUse(); + + return new GeoDistanceSort(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GeoDistanceSort} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + GeoDistanceSort::setupGeoDistanceSortDeserializer); + + protected static void setupGeoDistanceSortDeserializer(ObjectDeserializer op) { + + op.add(Builder::mode, SortMode._DESERIALIZER, "mode"); + op.add(Builder::distanceType, GeoDistanceType._DESERIALIZER, "distance_type"); + op.add(Builder::ignoreUnmapped, JsonpDeserializer.booleanDeserializer(), "ignore_unmapped"); + op.add(Builder::order, SortOrder._DESERIALIZER, "order"); + op.add(Builder::unit, DistanceUnit._DESERIALIZER, "unit"); + + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + builder.field(name); + builder.location( + JsonpDeserializer.arrayDeserializer(GeoLocation._DESERIALIZER).deserialize(parser, mapper)); + }); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceType.java new file mode 100644 index 000000000..1a7de8d2e --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoDistanceType.java @@ -0,0 +1,61 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum GeoDistanceType implements JsonEnum { + /** + * The arc calculation is the most accurate. + */ + Arc("arc"), + + /** + * The plane calculation is faster but less accurate. + */ + Plane("plane"), + + ; + + private final String jsonValue; + + GeoDistanceType(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + GeoDistanceType.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashLocation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashLocation.java new file mode 100644 index 000000000..a42647a35 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashLocation.java @@ -0,0 +1,142 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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; + +// typedef: _types.GeoHashLocation + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GeoHashLocation implements JsonpSerializable { + private final String geohash; + + // --------------------------------------------------------------------------------------------- + + private GeoHashLocation(Builder builder) { + + this.geohash = ApiTypeHelper.requireNonNull(builder.geohash, this, "geohash"); + + } + + public static GeoHashLocation of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code geohash} + */ + public final String geohash() { + return this.geohash; + } + + /** + * 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("geohash"); + generator.write(this.geohash); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GeoHashLocation}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String geohash; + + /** + * Required - API name: {@code geohash} + */ + public final Builder geohash(String value) { + this.geohash = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GeoHashLocation}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GeoHashLocation build() { + _checkSingleUse(); + + return new GeoHashLocation(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GeoHashLocation} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + GeoHashLocation::setupGeoHashLocationDeserializer); + + protected static void setupGeoHashLocationDeserializer(ObjectDeserializer op) { + + op.add(Builder::geohash, JsonpDeserializer.stringDeserializer(), "geohash"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashPrecision.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashPrecision.java new file mode 100644 index 000000000..de2957117 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashPrecision.java @@ -0,0 +1,193 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.ObjectDeserializer; +import co.elastic.clients.json.UnionDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.ObjectBuilderBase; +import co.elastic.clients.util.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import jakarta.json.stream.JsonGenerator; +import java.lang.Number; +import java.lang.Object; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.GeoHashPrecision + +/** + * A precision that can be expressed as a geohash length between 1 and 12, or a + * distance measure like "1km", "10m". + * + * @see API + * specification + */ +@JsonpDeserializable +public class GeoHashPrecision implements TaggedUnion, JsonpSerializable { + + public enum Kind { + GeohashLength, Distance + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + private GeoHashPrecision(Kind kind, Object value) { + this._kind = kind; + this._value = value; + } + + public String _toJsonString() { + switch (_kind) { + case GeohashLength : + return this.geohashLength().toString(); + case Distance : + return this.distance(); + + default : + throw new IllegalStateException("Unknown kind " + _kind); + } + } + + private GeoHashPrecision(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + + } + + public static GeoHashPrecision of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Is this variant instance of kind {@code geohash_length}? + */ + public boolean isGeohashLength() { + return _kind == Kind.GeohashLength; + } + + /** + * Get the {@code geohash_length} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code geohash_length} kind. + */ + public Number geohashLength() { + return TaggedUnionUtils.get(this, Kind.GeohashLength); + } + + /** + * Is this variant instance of kind {@code distance}? + */ + public boolean isDistance() { + return _kind == Kind.Distance; + } + + /** + * Get the {@code distance} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code distance} kind. + */ + public String distance() { + return TaggedUnionUtils.get(this, Kind.Distance); + } + + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } else { + switch (_kind) { + case GeohashLength : + generator.write(((Number) this._value).doubleValue()); + + break; + case Distance : + generator.write(((String) this._value)); + + break; + } + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + private Kind _kind; + private Object _value; + + public ObjectBuilder geohashLength(Number v) { + this._kind = Kind.GeohashLength; + this._value = v; + return this; + } + + public ObjectBuilder distance(String v) { + this._kind = Kind.Distance; + this._value = v; + return this; + } + + public GeoHashPrecision build() { + _checkSingleUse(); + return new GeoHashPrecision(this); + } + + } + + private static JsonpDeserializer buildGeoHashPrecisionDeserializer() { + return new UnionDeserializer.Builder(GeoHashPrecision::new, false) + .addMember(Kind.GeohashLength, JsonpDeserializer.numberDeserializer()) + .addMember(Kind.Distance, JsonpDeserializer.stringDeserializer()).build(); + } + + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer + .lazy(GeoHashPrecision::buildGeoHashPrecisionDeserializer); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashPrecisionBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashPrecisionBuilders.java new file mode 100644 index 000000000..abffd65dc --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoHashPrecisionBuilders.java @@ -0,0 +1,41 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +/** + * Builders for {@link GeoHashPrecision} variants. + *

+ * Variants geohash_length, distance are not available + * here as they don't have a dedicated class. Use {@link GeoHashPrecision}'s + * builder for these. + * + */ +public class GeoHashPrecisionBuilders { + private GeoHashPrecisionBuilders() { + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLine.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLine.java new file mode 100644 index 000000000..ef58346ea --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLine.java @@ -0,0 +1,207 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Double; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.GeoLine + +/** + * A GeoJson GeoLine. + * + * @see API + * specification + */ +@JsonpDeserializable +public class GeoLine implements JsonpSerializable { + private final String type; + + private final List> coordinates; + + // --------------------------------------------------------------------------------------------- + + private GeoLine(Builder builder) { + + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + this.coordinates = ApiTypeHelper.unmodifiableRequired(builder.coordinates, this, "coordinates"); + + } + + public static GeoLine of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Always "LineString" + *

+ * API name: {@code type} + */ + public final String type() { + return this.type; + } + + /** + * Required - Array of [lon, lat] coordinates + *

+ * API name: {@code coordinates} + */ + public final List> coordinates() { + return this.coordinates; + } + + /** + * 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("type"); + generator.write(this.type); + + if (ApiTypeHelper.isDefined(this.coordinates)) { + generator.writeKey("coordinates"); + generator.writeStartArray(); + for (List item0 : this.coordinates) { + generator.writeStartArray(); + if (item0 != null) { + for (Double item1 : item0) { + generator.write(item1); + + } + } + generator.writeEnd(); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GeoLine}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String type; + + private List> coordinates; + + /** + * Required - Always "LineString" + *

+ * API name: {@code type} + */ + public final Builder type(String value) { + this.type = value; + return this; + } + + /** + * Required - Array of [lon, lat] coordinates + *

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

+ * Adds all elements of list to coordinates. + */ + public final Builder coordinates(List> list) { + this.coordinates = _listAddAll(this.coordinates, list); + return this; + } + + /** + * Required - Array of [lon, lat] coordinates + *

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

+ * Adds one or more values to coordinates. + */ + public final Builder coordinates(List value, List... values) { + this.coordinates = _listAdd(this.coordinates, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GeoLine}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GeoLine build() { + _checkSingleUse(); + + return new GeoLine(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GeoLine} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + GeoLine::setupGeoLineDeserializer); + + protected static void setupGeoLineDeserializer(ObjectDeserializer op) { + + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + op.add(Builder::coordinates, JsonpDeserializer.arrayDeserializer( + JsonpDeserializer.arrayDeserializer(JsonpDeserializer.doubleDeserializer())), "coordinates"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLocation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLocation.java new file mode 100644 index 000000000..1022ff213 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLocation.java @@ -0,0 +1,252 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.ObjectDeserializer; +import co.elastic.clients.json.UnionDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.ObjectBuilderBase; +import co.elastic.clients.util.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import jakarta.json.stream.JsonGenerator; +import java.lang.Double; +import java.lang.Object; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.GeoLocation + +/** + * A latitude/longitude as a 2 dimensional point. It can be represented in + * various ways: + *

    + *
  • as a {lat, long} object
  • + *
  • as a geo hash value
  • + *
  • as a [lon, lat] array
  • + *
  • as a string in "<lat>, <lon>" or WKT + * point formats
  • + *
+ * + * @see API + * specification + */ +@JsonpDeserializable +public class GeoLocation implements TaggedUnion, JsonpSerializable { + + public enum Kind { + Coords, Geohash, Latlon, Text + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + private GeoLocation(Kind kind, Object value) { + this._kind = kind; + this._value = value; + } + + private GeoLocation(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + + } + + public static GeoLocation of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Is this variant instance of kind {@code coords}? + */ + public boolean isCoords() { + return _kind == Kind.Coords; + } + + /** + * Get the {@code coords} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code coords} kind. + */ + public List coords() { + return TaggedUnionUtils.get(this, Kind.Coords); + } + + /** + * Is this variant instance of kind {@code geohash}? + */ + public boolean isGeohash() { + return _kind == Kind.Geohash; + } + + /** + * Get the {@code geohash} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code geohash} kind. + */ + public GeoHashLocation geohash() { + return TaggedUnionUtils.get(this, Kind.Geohash); + } + + /** + * Is this variant instance of kind {@code latlon}? + */ + public boolean isLatlon() { + return _kind == Kind.Latlon; + } + + /** + * Get the {@code latlon} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code latlon} kind. + */ + public LatLonGeoLocation latlon() { + return TaggedUnionUtils.get(this, Kind.Latlon); + } + + /** + * Is this variant instance of kind {@code text}? + */ + public boolean isText() { + return _kind == Kind.Text; + } + + /** + * Get the {@code text} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code text} kind. + */ + public String text() { + return TaggedUnionUtils.get(this, Kind.Text); + } + + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } else { + switch (_kind) { + case Coords : + generator.writeStartArray(); + for (Double item0 : ((List) this._value)) { + generator.write(item0); + + } + generator.writeEnd(); + + break; + case Text : + generator.write(((String) this._value)); + + break; + } + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder { + private Kind _kind; + private Object _value; + + public ObjectBuilder coords(List v) { + this._kind = Kind.Coords; + this._value = v; + return this; + } + + public ObjectBuilder geohash(GeoHashLocation v) { + this._kind = Kind.Geohash; + this._value = v; + return this; + } + + public ObjectBuilder geohash( + Function> fn) { + return this.geohash(fn.apply(new GeoHashLocation.Builder()).build()); + } + + public ObjectBuilder latlon(LatLonGeoLocation v) { + this._kind = Kind.Latlon; + this._value = v; + return this; + } + + public ObjectBuilder latlon( + Function> fn) { + return this.latlon(fn.apply(new LatLonGeoLocation.Builder()).build()); + } + + public ObjectBuilder text(String v) { + this._kind = Kind.Text; + this._value = v; + return this; + } + + public GeoLocation build() { + _checkSingleUse(); + return new GeoLocation(this); + } + + } + + private static JsonpDeserializer buildGeoLocationDeserializer() { + return new UnionDeserializer.Builder(GeoLocation::new, false) + .addMember(Kind.Coords, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.doubleDeserializer())) + .addMember(Kind.Geohash, GeoHashLocation._DESERIALIZER) + .addMember(Kind.Latlon, LatLonGeoLocation._DESERIALIZER) + .addMember(Kind.Text, JsonpDeserializer.stringDeserializer()).build(); + } + + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer + .lazy(GeoLocation::buildGeoLocationDeserializer); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLocationBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLocationBuilders.java new file mode 100644 index 000000000..fad7f71e1 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoLocationBuilders.java @@ -0,0 +1,58 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.util.ObjectBuilder; +import java.lang.Double; +import java.util.function.Function; + +/** + * Builders for {@link GeoLocation} variants. + *

+ * Variants coords, text are not available here as + * they don't have a dedicated class. Use {@link GeoLocation}'s builder for + * these. + * + */ +public class GeoLocationBuilders { + private GeoLocationBuilders() { + } + + /** + * Creates a builder for the {@link GeoHashLocation geohash} {@code GeoLocation} + * variant. + */ + public static GeoHashLocation.Builder geohash() { + return new GeoHashLocation.Builder(); + } + + /** + * Creates a builder for the {@link LatLonGeoLocation latlon} + * {@code GeoLocation} variant. + */ + public static LatLonGeoLocation.Builder latlon() { + return new LatLonGeoLocation.Builder(); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoShapeRelation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoShapeRelation.java new file mode 100644 index 000000000..c779ac81b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/GeoShapeRelation.java @@ -0,0 +1,75 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum GeoShapeRelation implements JsonEnum { + /** + * Return all documents whose geo_shape or geo_point + * field intersects the query geometry. + */ + Intersects("intersects"), + + /** + * Return all documents whose geo_shape or geo_point + * field has nothing in common with the query geometry. + */ + Disjoint("disjoint"), + + /** + * Return all documents whose geo_shape or geo_point + * field is within the query geometry. Line geometries are not supported. + */ + Within("within"), + + /** + * Return all documents whose geo_shape or geo_point + * field contains the query geometry. + */ + Contains("contains"), + + ; + + private final String jsonValue; + + GeoShapeRelation(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + GeoShapeRelation.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/HealthStatus.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/HealthStatus.java new file mode 100644 index 000000000..aaa804eab --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/HealthStatus.java @@ -0,0 +1,75 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum HealthStatus implements JsonEnum { + /** + * All shards are assigned. + */ + Green("green", "GREEN"), + + /** + * All primary shards are assigned, but one or more replica shards are + * unassigned. If a node in the cluster fails, some data could be unavailable + * until that node is repaired. + */ + Yellow("yellow", "YELLOW"), + + /** + * One or more primary shards are unassigned, so some data is unavailable. This + * can occur briefly during cluster startup as primary shards are assigned. + */ + Red("red", "RED"), + + ; + + private final String jsonValue; + private final String[] aliases; + + HealthStatus(String jsonValue, String... aliases) { + this.jsonValue = jsonValue; + this.aliases = aliases; + } + + public String jsonValue() { + return this.jsonValue; + } + + public String[] aliases() { + return this.aliases; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + HealthStatus.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IBDistribution.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IBDistribution.java new file mode 100644 index 000000000..728e1831d --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IBDistribution.java @@ -0,0 +1,55 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum IBDistribution implements JsonEnum { + Ll("ll"), + + Spl("spl"), + + ; + + private final String jsonValue; + + IBDistribution(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + IBDistribution.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IBLambda.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IBLambda.java new file mode 100644 index 000000000..321f0be62 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IBLambda.java @@ -0,0 +1,54 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum IBLambda implements JsonEnum { + Df("df"), + + Ttf("ttf"), + + ; + + private final String jsonValue; + + IBLambda(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(IBLambda.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IndicesOptions.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IndicesOptions.java new file mode 100644 index 000000000..13857ec39 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IndicesOptions.java @@ -0,0 +1,290 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Boolean; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.IndicesOptions + +/** + * Controls how to deal with unavailable concrete indices (closed or missing), + * how wildcard expressions are expanded to actual indices (all, closed or open + * indices) and how to deal with wildcard expressions that resolve to no + * indices. + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndicesOptions implements JsonpSerializable { + @Nullable + private final Boolean allowNoIndices; + + private final List expandWildcards; + + @Nullable + private final Boolean ignoreUnavailable; + + @Nullable + private final Boolean ignoreThrottled; + + // --------------------------------------------------------------------------------------------- + + private IndicesOptions(Builder builder) { + + this.allowNoIndices = builder.allowNoIndices; + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.ignoreUnavailable = builder.ignoreUnavailable; + this.ignoreThrottled = builder.ignoreThrottled; + + } + + public static IndicesOptions of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If false, the request returns an error if any wildcard expression, index + * alias, or _all value targets only missing or closed indices. + * This behavior applies even if the request targets other open indices. For + * example, a request targeting foo*,bar* returns an error if an + * index starts with foo but no index starts with bar. + *

+ * API name: {@code allow_no_indices} + */ + @Nullable + public final Boolean allowNoIndices() { + return this.allowNoIndices; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * If true, missing or closed indices are not included in the response. + *

+ * API name: {@code ignore_unavailable} + */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + + /** + * If true, concrete, expanded or aliased indices are ignored when frozen. + *

+ * API name: {@code ignore_throttled} + */ + @Nullable + public final Boolean ignoreThrottled() { + return this.ignoreThrottled; + } + + /** + * 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 (this.allowNoIndices != null) { + generator.writeKey("allow_no_indices"); + generator.write(this.allowNoIndices); + + } + if (ApiTypeHelper.isDefined(this.expandWildcards)) { + generator.writeKey("expand_wildcards"); + generator.writeStartArray(); + for (ExpandWildcard item0 : this.expandWildcards) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + + } + if (this.ignoreUnavailable != null) { + generator.writeKey("ignore_unavailable"); + generator.write(this.ignoreUnavailable); + + } + if (this.ignoreThrottled != null) { + generator.writeKey("ignore_throttled"); + generator.write(this.ignoreThrottled); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndicesOptions}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Boolean allowNoIndices; + + @Nullable + private List expandWildcards; + + @Nullable + private Boolean ignoreUnavailable; + + @Nullable + private Boolean ignoreThrottled; + + /** + * If false, the request returns an error if any wildcard expression, index + * alias, or _all value targets only missing or closed indices. + * This behavior applies even if the request targets other open indices. For + * example, a request targeting foo*,bar* returns an error if an + * index starts with foo but no index starts with bar. + *

+ * API name: {@code allow_no_indices} + */ + public final Builder allowNoIndices(@Nullable Boolean value) { + this.allowNoIndices = value; + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * If true, missing or closed indices are not included in the response. + *

+ * API name: {@code ignore_unavailable} + */ + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + + /** + * If true, concrete, expanded or aliased indices are ignored when frozen. + *

+ * API name: {@code ignore_throttled} + */ + public final Builder ignoreThrottled(@Nullable Boolean value) { + this.ignoreThrottled = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndicesOptions}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndicesOptions build() { + _checkSingleUse(); + + return new IndicesOptions(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndicesOptions} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + IndicesOptions::setupIndicesOptionsDeserializer); + + protected static void setupIndicesOptionsDeserializer(ObjectDeserializer op) { + + op.add(Builder::allowNoIndices, JsonpDeserializer.booleanDeserializer(), "allow_no_indices"); + op.add(Builder::expandWildcards, JsonpDeserializer.arrayDeserializer(ExpandWildcard._DESERIALIZER), + "expand_wildcards"); + op.add(Builder::ignoreUnavailable, JsonpDeserializer.booleanDeserializer(), "ignore_unavailable"); + op.add(Builder::ignoreThrottled, JsonpDeserializer.booleanDeserializer(), "ignore_throttled"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IndicesResponseBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IndicesResponseBase.java new file mode 100644 index 000000000..de3ccc81d --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/IndicesResponseBase.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import co.elastic.clients.json.ObjectBuilderDeserializer; +import co.elastic.clients.json.ObjectDeserializer; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.IndicesResponseBase + +/** + * + * @see API + * specification + */ + +public abstract class IndicesResponseBase extends AcknowledgedResponseBase { + @Nullable + private final ShardStatistics shards; + + // --------------------------------------------------------------------------------------------- + + protected IndicesResponseBase(AbstractBuilder builder) { + super(builder); + + this.shards = builder.shards; + + } + + /** + * API name: {@code _shards} + */ + @Nullable + public final ShardStatistics shards() { + return this.shards; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + super.serializeInternal(generator, mapper); + if (this.shards != null) { + generator.writeKey("_shards"); + this.shards.serialize(generator, mapper); + + } + + } + + public abstract static class AbstractBuilder> + extends + AcknowledgedResponseBase.AbstractBuilder { + @Nullable + private ShardStatistics shards; + + /** + * API name: {@code _shards} + */ + public final BuilderT shards(@Nullable ShardStatistics value) { + this.shards = value; + return self(); + } + + /** + * API name: {@code _shards} + */ + public final BuilderT shards(Function> fn) { + return this.shards(fn.apply(new ShardStatistics.Builder()).build()); + } + + } + + // --------------------------------------------------------------------------------------------- + protected static > void setupIndicesResponseBaseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + op.add(AbstractBuilder::shards, ShardStatistics._DESERIALIZER, "_shards"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineGet.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineGet.java new file mode 100644 index 000000000..dedba1ba1 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineGet.java @@ -0,0 +1,381 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonData; +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.JsonpSerializer; +import co.elastic.clients.json.JsonpUtils; +import co.elastic.clients.json.NamedDeserializer; +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.Boolean; +import java.lang.Long; +import java.lang.String; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import java.util.function.Supplier; +import javax.annotation.Nullable; + +// typedef: _types.InlineGet + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class InlineGet implements JsonpSerializable { + private final Map metadata; + + private final Map fields; + + private final boolean found; + + @Nullable + private final Long seqNo; + + @Nullable + private final Long primaryTerm; + + @Nullable + private final String routing; + + private final TDocument source; + + @Nullable + private final JsonpSerializer tDocumentSerializer; + + // --------------------------------------------------------------------------------------------- + + private InlineGet(Builder builder) { + + this.metadata = ApiTypeHelper.unmodifiable(builder.metadata); + + this.fields = ApiTypeHelper.unmodifiable(builder.fields); + this.found = ApiTypeHelper.requireNonNull(builder.found, this, "found"); + this.seqNo = builder.seqNo; + this.primaryTerm = builder.primaryTerm; + this.routing = builder.routing; + this.source = ApiTypeHelper.requireNonNull(builder.source, this, "source"); + this.tDocumentSerializer = builder.tDocumentSerializer; + + } + + public static InlineGet of( + Function, ObjectBuilder>> fn) { + return fn.apply(new Builder<>()).build(); + } + + /** + * Document metadata + */ + public final Map metadata() { + return this.metadata; + } + + /** + * API name: {@code fields} + */ + public final Map fields() { + return this.fields; + } + + /** + * Required - API name: {@code found} + */ + public final boolean found() { + return this.found; + } + + /** + * API name: {@code _seq_no} + */ + @Nullable + public final Long seqNo() { + return this.seqNo; + } + + /** + * API name: {@code _primary_term} + */ + @Nullable + public final Long primaryTerm() { + return this.primaryTerm; + } + + /** + * API name: {@code _routing} + */ + @Nullable + public final String routing() { + return this.routing; + } + + /** + * Required - API name: {@code _source} + */ + public final TDocument source() { + return this.source; + } + + /** + * 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) { + + for (Map.Entry item0 : this.metadata.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + + if (ApiTypeHelper.isDefined(this.fields)) { + generator.writeKey("fields"); + generator.writeStartObject(); + for (Map.Entry item0 : this.fields.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + generator.writeKey("found"); + generator.write(this.found); + + if (this.seqNo != null) { + generator.writeKey("_seq_no"); + generator.write(this.seqNo); + + } + if (this.primaryTerm != null) { + generator.writeKey("_primary_term"); + generator.write(this.primaryTerm); + + } + if (this.routing != null) { + generator.writeKey("_routing"); + generator.write(this.routing); + + } + generator.writeKey("_source"); + JsonpUtils.serialize(this.source, generator, tDocumentSerializer, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link InlineGet}. + */ + + public static class Builder extends WithJsonObjectBuilderBase> + implements + ObjectBuilder> { + @Nullable + private Map metadata = new HashMap<>(); + + /** + * Document metadata + *

+ * Adds all entries of map to metadata. + */ + public final Builder metadata(Map map) { + this.metadata = _mapPutAll(this.metadata, map); + return this; + } + + /** + * Document metadata + *

+ * Adds an entry to metadata. + */ + public final Builder metadata(String key, JsonData value) { + this.metadata = _mapPut(this.metadata, key, value); + return this; + } + + @Nullable + private Map fields; + + private Boolean found; + + @Nullable + private Long seqNo; + + @Nullable + private Long primaryTerm; + + @Nullable + private String routing; + + private TDocument source; + + @Nullable + private JsonpSerializer tDocumentSerializer; + + /** + * API name: {@code fields} + *

+ * Adds all entries of map to fields. + */ + public final Builder fields(Map map) { + this.fields = _mapPutAll(this.fields, map); + return this; + } + + /** + * API name: {@code fields} + *

+ * Adds an entry to fields. + */ + public final Builder fields(String key, JsonData value) { + this.fields = _mapPut(this.fields, key, value); + return this; + } + + /** + * Required - API name: {@code found} + */ + public final Builder found(boolean value) { + this.found = value; + return this; + } + + /** + * API name: {@code _seq_no} + */ + public final Builder seqNo(@Nullable Long value) { + this.seqNo = value; + return this; + } + + /** + * API name: {@code _primary_term} + */ + public final Builder primaryTerm(@Nullable Long value) { + this.primaryTerm = value; + return this; + } + + /** + * API name: {@code _routing} + */ + public final Builder routing(@Nullable String value) { + this.routing = value; + return this; + } + + /** + * Required - API name: {@code _source} + */ + public final Builder source(TDocument value) { + this.source = value; + return this; + } + + /** + * Serializer for TDocument. If not set, an attempt will be made to find a + * serializer from the JSON context. + */ + public final Builder tDocumentSerializer(@Nullable JsonpSerializer value) { + this.tDocumentSerializer = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link InlineGet}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public InlineGet build() { + _checkSingleUse(); + + return new InlineGet(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Create a JSON deserializer for InlineGet + */ + public static JsonpDeserializer> createInlineGetDeserializer( + JsonpDeserializer tDocumentDeserializer) { + return ObjectBuilderDeserializer.createForObject((Supplier>) Builder::new, + op -> InlineGet.setupInlineGetDeserializer(op, tDocumentDeserializer)); + }; + + /** + * Json deserializer for {@link InlineGet} based on named deserializers provided + * by the calling {@code JsonMapper}. + */ + public static final JsonpDeserializer> _DESERIALIZER = JsonpDeserializer + .lazy(() -> createInlineGetDeserializer( + new NamedDeserializer<>("co.elastic.clients:Deserializer:_types.TDocument"))); + + protected static void setupInlineGetDeserializer(ObjectDeserializer> op, + JsonpDeserializer tDocumentDeserializer) { + + op.add(Builder::fields, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "fields"); + op.add(Builder::found, JsonpDeserializer.booleanDeserializer(), "found"); + op.add(Builder::seqNo, JsonpDeserializer.longDeserializer(), "_seq_no"); + op.add(Builder::primaryTerm, JsonpDeserializer.longDeserializer(), "_primary_term"); + op.add(Builder::routing, JsonpDeserializer.stringDeserializer(), "_routing"); + op.add(Builder::source, tDocumentDeserializer, "_source"); + + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + builder.metadata(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineScript.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineScript.java new file mode 100644 index 000000000..a468589e4 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/InlineScript.java @@ -0,0 +1,223 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +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 jakarta.json.stream.JsonGenerator; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.InlineScript + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class InlineScript extends ScriptBase { + @Nullable + private final String lang; + + private final Map options; + + private final String source; + + // --------------------------------------------------------------------------------------------- + + private InlineScript(Builder builder) { + super(builder); + + this.lang = builder.lang; + this.options = ApiTypeHelper.unmodifiable(builder.options); + this.source = ApiTypeHelper.requireNonNull(builder.source, this, "source"); + + } + + public static InlineScript of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Specifies the language the script is written in. + *

+ * API name: {@code lang} + */ + @Nullable + public final String lang() { + return this.lang; + } + + /** + * API name: {@code options} + */ + public final Map options() { + return this.options; + } + + /** + * Required - The script source. + *

+ * API name: {@code source} + */ + public final String source() { + return this.source; + } + + protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) { + + super.serializeInternal(generator, mapper); + if (this.lang != null) { + generator.writeKey("lang"); + generator.write(this.lang); + + } + if (ApiTypeHelper.isDefined(this.options)) { + generator.writeKey("options"); + generator.writeStartObject(); + for (Map.Entry item0 : this.options.entrySet()) { + generator.writeKey(item0.getKey()); + generator.write(item0.getValue()); + + } + generator.writeEnd(); + + } + generator.writeKey("source"); + generator.write(this.source); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link InlineScript}. + */ + + public static class Builder extends ScriptBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private String lang; + + @Nullable + private Map options; + + private String source; + + /** + * Specifies the language the script is written in. + *

+ * API name: {@code lang} + */ + public final Builder lang(@Nullable String value) { + this.lang = value; + return this; + } + + /** + * Specifies the language the script is written in. + *

+ * API name: {@code lang} + */ + public final Builder lang(@Nullable ScriptLanguage value) { + this.lang = value == null ? null : value.jsonValue(); + return this; + } + + /** + * API name: {@code options} + *

+ * Adds all entries of map to options. + */ + public final Builder options(Map map) { + this.options = _mapPutAll(this.options, map); + return this; + } + + /** + * API name: {@code options} + *

+ * Adds an entry to options. + */ + public final Builder options(String key, String value) { + this.options = _mapPut(this.options, key, value); + return this; + } + + /** + * Required - The script source. + *

+ * API name: {@code source} + */ + public final Builder source(String value) { + this.source = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link InlineScript}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public InlineScript build() { + _checkSingleUse(); + + return new InlineScript(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link InlineScript} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + InlineScript::setupInlineScriptDeserializer); + + protected static void setupInlineScriptDeserializer(ObjectDeserializer op) { + ScriptBase.setupScriptBaseDeserializer(op); + op.add(Builder::lang, JsonpDeserializer.stringDeserializer(), "lang"); + op.add(Builder::options, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.stringDeserializer()), + "options"); + op.add(Builder::source, JsonpDeserializer.stringDeserializer(), "source"); + + op.shortcutProperty("source"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java new file mode 100644 index 000000000..da8fbe0cf --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/KnnQuery.java @@ -0,0 +1,398 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +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.Float; +import java.lang.Long; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.KnnQuery + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class KnnQuery implements JsonpSerializable { + private final String field; + + private final List queryVector; + + @Nullable + private final QueryVectorBuilder queryVectorBuilder; + + private final long k; + + private final long numCandidates; + + @Nullable + private final Float boost; + + private final List filter; + + // --------------------------------------------------------------------------------------------- + + private KnnQuery(Builder builder) { + + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); + this.queryVector = ApiTypeHelper.unmodifiable(builder.queryVector); + this.queryVectorBuilder = builder.queryVectorBuilder; + this.k = ApiTypeHelper.requireNonNull(builder.k, this, "k"); + this.numCandidates = ApiTypeHelper.requireNonNull(builder.numCandidates, this, "numCandidates"); + this.boost = builder.boost; + this.filter = ApiTypeHelper.unmodifiable(builder.filter); + + } + + public static KnnQuery of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - The name of the vector field to search against + *

+ * API name: {@code field} + */ + public final String field() { + return this.field; + } + + /** + * The query vector + *

+ * API name: {@code query_vector} + */ + public final List queryVector() { + return this.queryVector; + } + + /** + * The query vector builder. You must provide a query_vector_builder or + * query_vector, but not both. + *

+ * API name: {@code query_vector_builder} + */ + @Nullable + public final QueryVectorBuilder queryVectorBuilder() { + return this.queryVectorBuilder; + } + + /** + * Required - The final number of nearest neighbors to return as top hits + *

+ * API name: {@code k} + */ + public final long k() { + return this.k; + } + + /** + * Required - The number of nearest neighbor candidates to consider per shard + *

+ * API name: {@code num_candidates} + */ + public final long numCandidates() { + return this.numCandidates; + } + + /** + * Boost value to apply to kNN scores + *

+ * API name: {@code boost} + */ + @Nullable + public final Float boost() { + return this.boost; + } + + /** + * Filters for the kNN search query + *

+ * API name: {@code filter} + */ + public final List filter() { + return this.filter; + } + + /** + * 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("field"); + generator.write(this.field); + + if (ApiTypeHelper.isDefined(this.queryVector)) { + generator.writeKey("query_vector"); + generator.writeStartArray(); + for (Float item0 : this.queryVector) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.queryVectorBuilder != null) { + generator.writeKey("query_vector_builder"); + this.queryVectorBuilder.serialize(generator, mapper); + + } + generator.writeKey("k"); + generator.write(this.k); + + generator.writeKey("num_candidates"); + generator.write(this.numCandidates); + + if (this.boost != null) { + generator.writeKey("boost"); + generator.write(this.boost); + + } + if (ApiTypeHelper.isDefined(this.filter)) { + generator.writeKey("filter"); + generator.writeStartArray(); + for (Query item0 : this.filter) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link KnnQuery}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String field; + + @Nullable + private List queryVector; + + @Nullable + private QueryVectorBuilder queryVectorBuilder; + + private Long k; + + private Long numCandidates; + + @Nullable + private Float boost; + + @Nullable + private List filter; + + /** + * Required - The name of the vector field to search against + *

+ * API name: {@code field} + */ + public final Builder field(String value) { + this.field = value; + return this; + } + + /** + * The query vector + *

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

+ * Adds all elements of list to queryVector. + */ + public final Builder queryVector(List list) { + this.queryVector = _listAddAll(this.queryVector, list); + return this; + } + + /** + * The query vector + *

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

+ * Adds one or more values to queryVector. + */ + public final Builder queryVector(Float value, Float... values) { + this.queryVector = _listAdd(this.queryVector, value, values); + return this; + } + + /** + * The query vector builder. You must provide a query_vector_builder or + * query_vector, but not both. + *

+ * API name: {@code query_vector_builder} + */ + public final Builder queryVectorBuilder(@Nullable QueryVectorBuilder value) { + this.queryVectorBuilder = value; + return this; + } + + /** + * The query vector builder. You must provide a query_vector_builder or + * query_vector, but not both. + *

+ * API name: {@code query_vector_builder} + */ + public final Builder queryVectorBuilder( + Function> fn) { + return this.queryVectorBuilder(fn.apply(new QueryVectorBuilder.Builder()).build()); + } + + /** + * Required - The final number of nearest neighbors to return as top hits + *

+ * API name: {@code k} + */ + public final Builder k(long value) { + this.k = value; + return this; + } + + /** + * Required - The number of nearest neighbor candidates to consider per shard + *

+ * API name: {@code num_candidates} + */ + public final Builder numCandidates(long value) { + this.numCandidates = value; + return this; + } + + /** + * Boost value to apply to kNN scores + *

+ * API name: {@code boost} + */ + public final Builder boost(@Nullable Float value) { + this.boost = value; + return this; + } + + /** + * Filters for the kNN search query + *

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

+ * Adds all elements of list to filter. + */ + public final Builder filter(List list) { + this.filter = _listAddAll(this.filter, list); + return this; + } + + /** + * Filters for the kNN search query + *

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

+ * Adds one or more values to filter. + */ + public final Builder filter(Query value, Query... values) { + this.filter = _listAdd(this.filter, value, values); + return this; + } + + /** + * Filters for the kNN search query + *

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

+ * Adds a value to filter using a builder lambda. + */ + public final Builder filter(Function> fn) { + return filter(fn.apply(new Query.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link KnnQuery}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public KnnQuery build() { + _checkSingleUse(); + + return new KnnQuery(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link KnnQuery} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + KnnQuery::setupKnnQueryDeserializer); + + protected static void setupKnnQueryDeserializer(ObjectDeserializer op) { + + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); + op.add(Builder::queryVector, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.floatDeserializer()), + "query_vector"); + op.add(Builder::queryVectorBuilder, QueryVectorBuilder._DESERIALIZER, "query_vector_builder"); + op.add(Builder::k, JsonpDeserializer.longDeserializer(), "k"); + op.add(Builder::numCandidates, JsonpDeserializer.longDeserializer(), "num_candidates"); + op.add(Builder::boost, JsonpDeserializer.floatDeserializer(), "boost"); + op.add(Builder::filter, JsonpDeserializer.arrayDeserializer(Query._DESERIALIZER), "filter"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/LatLonGeoLocation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/LatLonGeoLocation.java new file mode 100644 index 000000000..f18133b26 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/LatLonGeoLocation.java @@ -0,0 +1,173 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Double; +import java.util.Objects; +import java.util.function.Function; + +// typedef: _types.LatLonGeoLocation + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class LatLonGeoLocation implements JsonpSerializable { + private final double lat; + + private final double lon; + + // --------------------------------------------------------------------------------------------- + + private LatLonGeoLocation(Builder builder) { + + this.lat = ApiTypeHelper.requireNonNull(builder.lat, this, "lat"); + this.lon = ApiTypeHelper.requireNonNull(builder.lon, this, "lon"); + + } + + public static LatLonGeoLocation of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Latitude + *

+ * API name: {@code lat} + */ + public final double lat() { + return this.lat; + } + + /** + * Required - Longitude + *

+ * API name: {@code lon} + */ + public final double lon() { + return this.lon; + } + + /** + * 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("lat"); + generator.write(this.lat); + + generator.writeKey("lon"); + generator.write(this.lon); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link LatLonGeoLocation}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Double lat; + + private Double lon; + + /** + * Required - Latitude + *

+ * API name: {@code lat} + */ + public final Builder lat(double value) { + this.lat = value; + return this; + } + + /** + * Required - Longitude + *

+ * API name: {@code lon} + */ + public final Builder lon(double value) { + this.lon = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link LatLonGeoLocation}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public LatLonGeoLocation build() { + _checkSingleUse(); + + return new LatLonGeoLocation(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link LatLonGeoLocation} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, LatLonGeoLocation::setupLatLonGeoLocationDeserializer); + + protected static void setupLatLonGeoLocationDeserializer(ObjectDeserializer op) { + + op.add(Builder::lat, JsonpDeserializer.doubleDeserializer(), "lat"); + op.add(Builder::lon, JsonpDeserializer.doubleDeserializer(), "lon"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/NestedSortValue.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/NestedSortValue.java new file mode 100644 index 000000000..d76658461 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/NestedSortValue.java @@ -0,0 +1,245 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +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.Integer; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.NestedSortValue + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class NestedSortValue implements JsonpSerializable { + @Nullable + private final Query filter; + + @Nullable + private final Integer maxChildren; + + @Nullable + private final NestedSortValue nested; + + private final String path; + + // --------------------------------------------------------------------------------------------- + + private NestedSortValue(Builder builder) { + + this.filter = builder.filter; + this.maxChildren = builder.maxChildren; + this.nested = builder.nested; + this.path = ApiTypeHelper.requireNonNull(builder.path, this, "path"); + + } + + public static NestedSortValue of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code filter} + */ + @Nullable + public final Query filter() { + return this.filter; + } + + /** + * API name: {@code max_children} + */ + @Nullable + public final Integer maxChildren() { + return this.maxChildren; + } + + /** + * API name: {@code nested} + */ + @Nullable + public final NestedSortValue nested() { + return this.nested; + } + + /** + * Required - API name: {@code path} + */ + public final String path() { + return this.path; + } + + /** + * 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 (this.filter != null) { + generator.writeKey("filter"); + this.filter.serialize(generator, mapper); + + } + if (this.maxChildren != null) { + generator.writeKey("max_children"); + generator.write(this.maxChildren); + + } + if (this.nested != null) { + generator.writeKey("nested"); + this.nested.serialize(generator, mapper); + + } + generator.writeKey("path"); + generator.write(this.path); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link NestedSortValue}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Query filter; + + @Nullable + private Integer maxChildren; + + @Nullable + private NestedSortValue nested; + + private String path; + + /** + * API name: {@code filter} + */ + public final Builder filter(@Nullable Query value) { + this.filter = value; + return this; + } + + /** + * API name: {@code filter} + */ + public final Builder filter(Function> fn) { + return this.filter(fn.apply(new Query.Builder()).build()); + } + + /** + * API name: {@code max_children} + */ + public final Builder maxChildren(@Nullable Integer value) { + this.maxChildren = value; + return this; + } + + /** + * API name: {@code nested} + */ + public final Builder nested(@Nullable NestedSortValue value) { + this.nested = value; + return this; + } + + /** + * API name: {@code nested} + */ + public final Builder nested(Function> fn) { + return this.nested(fn.apply(new NestedSortValue.Builder()).build()); + } + + /** + * Required - API name: {@code path} + */ + public final Builder path(String value) { + this.path = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link NestedSortValue}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public NestedSortValue build() { + _checkSingleUse(); + + return new NestedSortValue(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link NestedSortValue} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + NestedSortValue::setupNestedSortValueDeserializer); + + protected static void setupNestedSortValueDeserializer(ObjectDeserializer op) { + + op.add(Builder::filter, Query._DESERIALIZER, "filter"); + op.add(Builder::maxChildren, JsonpDeserializer.integerDeserializer(), "max_children"); + op.add(Builder::nested, NestedSortValue._DESERIALIZER, "nested"); + op.add(Builder::path, JsonpDeserializer.stringDeserializer(), "path"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/NodeStatistics.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/NodeStatistics.java new file mode 100644 index 000000000..81ddd2a58 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/NodeStatistics.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Integer; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.NodeStatistics + +/** + * Contains statistics about the number of nodes selected by the request. + * + * @see API + * specification + */ +@JsonpDeserializable +public class NodeStatistics implements JsonpSerializable { + private final List failures; + + private final int total; + + private final int successful; + + private final int failed; + + // --------------------------------------------------------------------------------------------- + + private NodeStatistics(Builder builder) { + + this.failures = ApiTypeHelper.unmodifiable(builder.failures); + this.total = ApiTypeHelper.requireNonNull(builder.total, this, "total"); + this.successful = ApiTypeHelper.requireNonNull(builder.successful, this, "successful"); + this.failed = ApiTypeHelper.requireNonNull(builder.failed, this, "failed"); + + } + + public static NodeStatistics of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code failures} + */ + public final List failures() { + return this.failures; + } + + /** + * Required - Total number of nodes selected by the request. + *

+ * API name: {@code total} + */ + public final int total() { + return this.total; + } + + /** + * Required - Number of nodes that responded successfully to the request. + *

+ * API name: {@code successful} + */ + public final int successful() { + return this.successful; + } + + /** + * Required - Number of nodes that rejected the request or failed to respond. If + * this value is not 0, a reason for the rejection or failure is included in the + * response. + *

+ * API name: {@code failed} + */ + public final int failed() { + return this.failed; + } + + /** + * 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.failures)) { + generator.writeKey("failures"); + generator.writeStartArray(); + for (ErrorCause item0 : this.failures) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + generator.writeKey("total"); + generator.write(this.total); + + generator.writeKey("successful"); + generator.write(this.successful); + + generator.writeKey("failed"); + generator.write(this.failed); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link NodeStatistics}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List failures; + + private Integer total; + + private Integer successful; + + private Integer failed; + + /** + * API name: {@code failures} + *

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

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

+ * Adds a value to failures using a builder lambda. + */ + public final Builder failures(Function> fn) { + return failures(fn.apply(new ErrorCause.Builder()).build()); + } + + /** + * Required - Total number of nodes selected by the request. + *

+ * API name: {@code total} + */ + public final Builder total(int value) { + this.total = value; + return this; + } + + /** + * Required - Number of nodes that responded successfully to the request. + *

+ * API name: {@code successful} + */ + public final Builder successful(int value) { + this.successful = value; + return this; + } + + /** + * Required - Number of nodes that rejected the request or failed to respond. If + * this value is not 0, a reason for the rejection or failure is included in the + * response. + *

+ * API name: {@code failed} + */ + public final Builder failed(int value) { + this.failed = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link NodeStatistics}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public NodeStatistics build() { + _checkSingleUse(); + + return new NodeStatistics(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link NodeStatistics} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + NodeStatistics::setupNodeStatisticsDeserializer); + + protected static void setupNodeStatisticsDeserializer(ObjectDeserializer op) { + + op.add(Builder::failures, JsonpDeserializer.arrayDeserializer(ErrorCause._DESERIALIZER), "failures"); + op.add(Builder::total, JsonpDeserializer.integerDeserializer(), "total"); + op.add(Builder::successful, JsonpDeserializer.integerDeserializer(), "successful"); + op.add(Builder::failed, JsonpDeserializer.integerDeserializer(), "failed"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Normalization.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Normalization.java new file mode 100644 index 000000000..fbcd9a982 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Normalization.java @@ -0,0 +1,61 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum Normalization implements JsonEnum { + No("no"), + + H1("h1"), + + H2("h2"), + + H3("h3"), + + Z("z"), + + ; + + private final String jsonValue; + + Normalization(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + Normalization.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/OpType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/OpType.java new file mode 100644 index 000000000..5d56f5e2a --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/OpType.java @@ -0,0 +1,59 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API specification + */ +@JsonpDeserializable +public enum OpType implements JsonEnum { + /** + * Overwrite any documents that already exist. + */ + Index("index"), + + /** + * Only index documents that do not already exist. + */ + Create("create"), + + ; + + private final String jsonValue; + + OpType(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(OpType.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/PluginStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/PluginStats.java new file mode 100644 index 000000000..486ec84b7 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/PluginStats.java @@ -0,0 +1,358 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Boolean; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.PluginStats + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class PluginStats implements JsonpSerializable { + private final String classname; + + private final String description; + + private final String elasticsearchVersion; + + private final List extendedPlugins; + + private final boolean hasNativeController; + + private final String javaVersion; + + private final String name; + + private final String version; + + private final boolean licensed; + + // --------------------------------------------------------------------------------------------- + + private PluginStats(Builder builder) { + + this.classname = ApiTypeHelper.requireNonNull(builder.classname, this, "classname"); + this.description = ApiTypeHelper.requireNonNull(builder.description, this, "description"); + this.elasticsearchVersion = ApiTypeHelper.requireNonNull(builder.elasticsearchVersion, this, + "elasticsearchVersion"); + this.extendedPlugins = ApiTypeHelper.unmodifiableRequired(builder.extendedPlugins, this, "extendedPlugins"); + this.hasNativeController = ApiTypeHelper.requireNonNull(builder.hasNativeController, this, + "hasNativeController"); + this.javaVersion = ApiTypeHelper.requireNonNull(builder.javaVersion, this, "javaVersion"); + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.version = ApiTypeHelper.requireNonNull(builder.version, this, "version"); + this.licensed = ApiTypeHelper.requireNonNull(builder.licensed, this, "licensed"); + + } + + public static PluginStats of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code classname} + */ + public final String classname() { + return this.classname; + } + + /** + * Required - API name: {@code description} + */ + public final String description() { + return this.description; + } + + /** + * Required - API name: {@code elasticsearch_version} + */ + public final String elasticsearchVersion() { + return this.elasticsearchVersion; + } + + /** + * Required - API name: {@code extended_plugins} + */ + public final List extendedPlugins() { + return this.extendedPlugins; + } + + /** + * Required - API name: {@code has_native_controller} + */ + public final boolean hasNativeController() { + return this.hasNativeController; + } + + /** + * Required - API name: {@code java_version} + */ + public final String javaVersion() { + return this.javaVersion; + } + + /** + * Required - API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * Required - API name: {@code version} + */ + public final String version() { + return this.version; + } + + /** + * Required - API name: {@code licensed} + */ + public final boolean licensed() { + return this.licensed; + } + + /** + * 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("classname"); + generator.write(this.classname); + + generator.writeKey("description"); + generator.write(this.description); + + generator.writeKey("elasticsearch_version"); + generator.write(this.elasticsearchVersion); + + if (ApiTypeHelper.isDefined(this.extendedPlugins)) { + generator.writeKey("extended_plugins"); + generator.writeStartArray(); + for (String item0 : this.extendedPlugins) { + generator.write(item0); + + } + generator.writeEnd(); + + } + generator.writeKey("has_native_controller"); + generator.write(this.hasNativeController); + + generator.writeKey("java_version"); + generator.write(this.javaVersion); + + generator.writeKey("name"); + generator.write(this.name); + + generator.writeKey("version"); + generator.write(this.version); + + generator.writeKey("licensed"); + generator.write(this.licensed); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PluginStats}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String classname; + + private String description; + + private String elasticsearchVersion; + + private List extendedPlugins; + + private Boolean hasNativeController; + + private String javaVersion; + + private String name; + + private String version; + + private Boolean licensed; + + /** + * Required - API name: {@code classname} + */ + public final Builder classname(String value) { + this.classname = value; + return this; + } + + /** + * Required - API name: {@code description} + */ + public final Builder description(String value) { + this.description = value; + return this; + } + + /** + * Required - API name: {@code elasticsearch_version} + */ + public final Builder elasticsearchVersion(String value) { + this.elasticsearchVersion = value; + return this; + } + + /** + * Required - API name: {@code extended_plugins} + *

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

+ * Adds one or more values to extendedPlugins. + */ + public final Builder extendedPlugins(String value, String... values) { + this.extendedPlugins = _listAdd(this.extendedPlugins, value, values); + return this; + } + + /** + * Required - API name: {@code has_native_controller} + */ + public final Builder hasNativeController(boolean value) { + this.hasNativeController = value; + return this; + } + + /** + * Required - API name: {@code java_version} + */ + public final Builder javaVersion(String value) { + this.javaVersion = value; + return this; + } + + /** + * Required - API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Required - API name: {@code version} + */ + public final Builder version(String value) { + this.version = value; + return this; + } + + /** + * Required - API name: {@code licensed} + */ + public final Builder licensed(boolean value) { + this.licensed = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PluginStats}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PluginStats build() { + _checkSingleUse(); + + return new PluginStats(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PluginStats} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + PluginStats::setupPluginStatsDeserializer); + + protected static void setupPluginStatsDeserializer(ObjectDeserializer op) { + + op.add(Builder::classname, JsonpDeserializer.stringDeserializer(), "classname"); + op.add(Builder::description, JsonpDeserializer.stringDeserializer(), "description"); + op.add(Builder::elasticsearchVersion, JsonpDeserializer.stringDeserializer(), "elasticsearch_version"); + op.add(Builder::extendedPlugins, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "extended_plugins"); + op.add(Builder::hasNativeController, JsonpDeserializer.booleanDeserializer(), "has_native_controller"); + op.add(Builder::javaVersion, JsonpDeserializer.stringDeserializer(), "java_version"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::version, JsonpDeserializer.stringDeserializer(), "version"); + op.add(Builder::licensed, JsonpDeserializer.booleanDeserializer(), "licensed"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryCacheStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryCacheStats.java new file mode 100644 index 000000000..d7bcb2357 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryCacheStats.java @@ -0,0 +1,365 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.Integer; +import java.lang.Long; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.QueryCacheStats + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class QueryCacheStats implements JsonpSerializable { + private final int cacheCount; + + private final int cacheSize; + + private final int evictions; + + private final int hitCount; + + @Nullable + private final String memorySize; + + private final long memorySizeInBytes; + + private final int missCount; + + private final int totalCount; + + // --------------------------------------------------------------------------------------------- + + private QueryCacheStats(Builder builder) { + + this.cacheCount = ApiTypeHelper.requireNonNull(builder.cacheCount, this, "cacheCount"); + this.cacheSize = ApiTypeHelper.requireNonNull(builder.cacheSize, this, "cacheSize"); + this.evictions = ApiTypeHelper.requireNonNull(builder.evictions, this, "evictions"); + this.hitCount = ApiTypeHelper.requireNonNull(builder.hitCount, this, "hitCount"); + this.memorySize = builder.memorySize; + this.memorySizeInBytes = ApiTypeHelper.requireNonNull(builder.memorySizeInBytes, this, "memorySizeInBytes"); + this.missCount = ApiTypeHelper.requireNonNull(builder.missCount, this, "missCount"); + this.totalCount = ApiTypeHelper.requireNonNull(builder.totalCount, this, "totalCount"); + + } + + public static QueryCacheStats of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Total number of entries added to the query cache across all shards + * assigned to selected nodes. This number includes current and evicted entries. + *

+ * API name: {@code cache_count} + */ + public final int cacheCount() { + return this.cacheCount; + } + + /** + * Required - Total number of entries currently in the query cache across all + * shards assigned to selected nodes. + *

+ * API name: {@code cache_size} + */ + public final int cacheSize() { + return this.cacheSize; + } + + /** + * Required - Total number of query cache evictions across all shards assigned + * to selected nodes. + *

+ * API name: {@code evictions} + */ + public final int evictions() { + return this.evictions; + } + + /** + * Required - Total count of query cache hits across all shards assigned to + * selected nodes. + *

+ * API name: {@code hit_count} + */ + public final int hitCount() { + return this.hitCount; + } + + /** + * Total amount of memory used for the query cache across all shards assigned to + * selected nodes. + *

+ * API name: {@code memory_size} + */ + @Nullable + public final String memorySize() { + return this.memorySize; + } + + /** + * Required - Total amount, in bytes, of memory used for the query cache across + * all shards assigned to selected nodes. + *

+ * API name: {@code memory_size_in_bytes} + */ + public final long memorySizeInBytes() { + return this.memorySizeInBytes; + } + + /** + * Required - Total count of query cache misses across all shards assigned to + * selected nodes. + *

+ * API name: {@code miss_count} + */ + public final int missCount() { + return this.missCount; + } + + /** + * Required - Total count of hits and misses in the query cache across all + * shards assigned to selected nodes. + *

+ * API name: {@code total_count} + */ + public final int totalCount() { + return this.totalCount; + } + + /** + * 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("cache_count"); + generator.write(this.cacheCount); + + generator.writeKey("cache_size"); + generator.write(this.cacheSize); + + generator.writeKey("evictions"); + generator.write(this.evictions); + + generator.writeKey("hit_count"); + generator.write(this.hitCount); + + if (this.memorySize != null) { + generator.writeKey("memory_size"); + generator.write(this.memorySize); + + } + generator.writeKey("memory_size_in_bytes"); + generator.write(this.memorySizeInBytes); + + generator.writeKey("miss_count"); + generator.write(this.missCount); + + generator.writeKey("total_count"); + generator.write(this.totalCount); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link QueryCacheStats}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Integer cacheCount; + + private Integer cacheSize; + + private Integer evictions; + + private Integer hitCount; + + @Nullable + private String memorySize; + + private Long memorySizeInBytes; + + private Integer missCount; + + private Integer totalCount; + + /** + * Required - Total number of entries added to the query cache across all shards + * assigned to selected nodes. This number includes current and evicted entries. + *

+ * API name: {@code cache_count} + */ + public final Builder cacheCount(int value) { + this.cacheCount = value; + return this; + } + + /** + * Required - Total number of entries currently in the query cache across all + * shards assigned to selected nodes. + *

+ * API name: {@code cache_size} + */ + public final Builder cacheSize(int value) { + this.cacheSize = value; + return this; + } + + /** + * Required - Total number of query cache evictions across all shards assigned + * to selected nodes. + *

+ * API name: {@code evictions} + */ + public final Builder evictions(int value) { + this.evictions = value; + return this; + } + + /** + * Required - Total count of query cache hits across all shards assigned to + * selected nodes. + *

+ * API name: {@code hit_count} + */ + public final Builder hitCount(int value) { + this.hitCount = value; + return this; + } + + /** + * Total amount of memory used for the query cache across all shards assigned to + * selected nodes. + *

+ * API name: {@code memory_size} + */ + public final Builder memorySize(@Nullable String value) { + this.memorySize = value; + return this; + } + + /** + * Required - Total amount, in bytes, of memory used for the query cache across + * all shards assigned to selected nodes. + *

+ * API name: {@code memory_size_in_bytes} + */ + public final Builder memorySizeInBytes(long value) { + this.memorySizeInBytes = value; + return this; + } + + /** + * Required - Total count of query cache misses across all shards assigned to + * selected nodes. + *

+ * API name: {@code miss_count} + */ + public final Builder missCount(int value) { + this.missCount = value; + return this; + } + + /** + * Required - Total count of hits and misses in the query cache across all + * shards assigned to selected nodes. + *

+ * API name: {@code total_count} + */ + public final Builder totalCount(int value) { + this.totalCount = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link QueryCacheStats}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public QueryCacheStats build() { + _checkSingleUse(); + + return new QueryCacheStats(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link QueryCacheStats} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + QueryCacheStats::setupQueryCacheStatsDeserializer); + + protected static void setupQueryCacheStatsDeserializer(ObjectDeserializer op) { + + op.add(Builder::cacheCount, JsonpDeserializer.integerDeserializer(), "cache_count"); + op.add(Builder::cacheSize, JsonpDeserializer.integerDeserializer(), "cache_size"); + op.add(Builder::evictions, JsonpDeserializer.integerDeserializer(), "evictions"); + op.add(Builder::hitCount, JsonpDeserializer.integerDeserializer(), "hit_count"); + op.add(Builder::memorySize, JsonpDeserializer.stringDeserializer(), "memory_size"); + op.add(Builder::memorySizeInBytes, JsonpDeserializer.longDeserializer(), "memory_size_in_bytes"); + op.add(Builder::missCount, JsonpDeserializer.integerDeserializer(), "miss_count"); + op.add(Builder::totalCount, JsonpDeserializer.integerDeserializer(), "total_count"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilder.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilder.java new file mode 100644 index 000000000..bb8be5122 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilder.java @@ -0,0 +1,183 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +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.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Object; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.QueryVectorBuilder + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class QueryVectorBuilder implements TaggedUnion, JsonpSerializable { + + /** + * {@link QueryVectorBuilder} variant kinds. + * + * @see API + * specification + */ + + public enum Kind implements JsonEnum { + TextEmbedding("text_embedding"), + + ; + + private final String jsonValue; + + Kind(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + public QueryVectorBuilder(QueryVectorBuilderVariant value) { + + this._kind = ApiTypeHelper.requireNonNull(value._queryVectorBuilderKind(), this, ""); + this._value = ApiTypeHelper.requireNonNull(value, this, ""); + + } + + private QueryVectorBuilder(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + + } + + public static QueryVectorBuilder of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Is this variant instance of kind {@code text_embedding}? + */ + public boolean isTextEmbedding() { + return _kind == Kind.TextEmbedding; + } + + /** + * Get the {@code text_embedding} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code text_embedding} kind. + */ + public TextEmbedding textEmbedding() { + return TaggedUnionUtils.get(this, Kind.TextEmbedding); + } + + @Override + @SuppressWarnings("unchecked") + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeStartObject(); + + generator.writeKey(_kind.jsonValue()); + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } + + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Kind _kind; + private Object _value; + + @Override + protected Builder self() { + return this; + } + public ObjectBuilder textEmbedding(TextEmbedding v) { + this._kind = Kind.TextEmbedding; + this._value = v; + return this; + } + + public ObjectBuilder textEmbedding( + Function> fn) { + return this.textEmbedding(fn.apply(new TextEmbedding.Builder()).build()); + } + + public QueryVectorBuilder build() { + _checkSingleUse(); + return new QueryVectorBuilder(this); + } + + } + + protected static void setupQueryVectorBuilderDeserializer(ObjectDeserializer op) { + + op.add(Builder::textEmbedding, TextEmbedding._DESERIALIZER, "text_embedding"); + + } + + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, QueryVectorBuilder::setupQueryVectorBuilderDeserializer, Builder::build); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilderBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilderBuilders.java new file mode 100644 index 000000000..79ef8372e --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilderBuilders.java @@ -0,0 +1,54 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +/** + * Builders for {@link QueryVectorBuilder} variants. + */ +public class QueryVectorBuilderBuilders { + private QueryVectorBuilderBuilders() { + } + + /** + * Creates a builder for the {@link TextEmbedding text_embedding} + * {@code QueryVectorBuilder} variant. + */ + public static TextEmbedding.Builder textEmbedding() { + return new TextEmbedding.Builder(); + } + + /** + * Creates a QueryVectorBuilder of the {@link TextEmbedding text_embedding} + * {@code QueryVectorBuilder} variant. + */ + public static QueryVectorBuilder textEmbedding(Function> fn) { + QueryVectorBuilder.Builder builder = new QueryVectorBuilder.Builder(); + builder.textEmbedding(fn.apply(new TextEmbedding.Builder()).build()); + return builder.build(); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilderVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilderVariant.java new file mode 100644 index 000000000..b56403be9 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/QueryVectorBuilderVariant.java @@ -0,0 +1,37 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +/** + * Base interface for {@link QueryVectorBuilder} variants. + */ +public interface QueryVectorBuilderVariant { + + QueryVectorBuilder.Kind _queryVectorBuilderKind(); + + default QueryVectorBuilder _toQueryVectorBuilder() { + return new QueryVectorBuilder(this); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Rank.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Rank.java new file mode 100644 index 000000000..43d26d43e --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Rank.java @@ -0,0 +1,180 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +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.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Object; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.RankContainer + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Rank implements TaggedUnion, JsonpSerializable { + + /** + * {@link Rank} variant kinds. + * + * @see API + * specification + */ + + public enum Kind implements JsonEnum { + Rrf("rrf"), + + ; + + private final String jsonValue; + + Kind(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + public Rank(RankVariant value) { + + this._kind = ApiTypeHelper.requireNonNull(value._rankKind(), this, ""); + this._value = ApiTypeHelper.requireNonNull(value, this, ""); + + } + + private Rank(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + + } + + public static Rank of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Is this variant instance of kind {@code rrf}? + */ + public boolean isRrf() { + return _kind == Kind.Rrf; + } + + /** + * Get the {@code rrf} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code rrf} kind. + */ + public RrfRank rrf() { + return TaggedUnionUtils.get(this, Kind.Rrf); + } + + @Override + @SuppressWarnings("unchecked") + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeStartObject(); + + generator.writeKey(_kind.jsonValue()); + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } + + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Kind _kind; + private Object _value; + + @Override + protected Builder self() { + return this; + } + public ObjectBuilder rrf(RrfRank v) { + this._kind = Kind.Rrf; + this._value = v; + return this; + } + + public ObjectBuilder rrf(Function> fn) { + return this.rrf(fn.apply(new RrfRank.Builder()).build()); + } + + public Rank build() { + _checkSingleUse(); + return new Rank(this); + } + + } + + protected static void setupRankDeserializer(ObjectDeserializer op) { + + op.add(Builder::rrf, RrfRank._DESERIALIZER, "rrf"); + + } + + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Rank::setupRankDeserializer, Builder::build); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RankBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RankBase.java new file mode 100644 index 000000000..89e7bc8f8 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RankBase.java @@ -0,0 +1,54 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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 co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; + +// typedef: _types.RankBase + +/** + * + * @see API + * specification + */ + +public abstract class RankBase { + public RankBase() { + } + + public abstract static class AbstractBuilder> + extends + WithJsonObjectBuilderBase { + protected abstract BuilderT self(); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RankBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RankBuilders.java new file mode 100644 index 000000000..1ec42a03c --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RankBuilders.java @@ -0,0 +1,52 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +/** + * Builders for {@link Rank} variants. + */ +public class RankBuilders { + private RankBuilders() { + } + + /** + * Creates a builder for the {@link RrfRank rrf} {@code Rank} variant. + */ + public static RrfRank.Builder rrf() { + return new RrfRank.Builder(); + } + + /** + * Creates a Rank of the {@link RrfRank rrf} {@code Rank} variant. + */ + public static Rank rrf(Function> fn) { + Rank.Builder builder = new Rank.Builder(); + builder.rrf(fn.apply(new RrfRank.Builder()).build()); + return builder.build(); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RankVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RankVariant.java new file mode 100644 index 000000000..9c3fcd31b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RankVariant.java @@ -0,0 +1,37 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +/** + * Base interface for {@link Rank} variants. + */ +public interface RankVariant { + + Rank.Kind _rankKind(); + + default Rank _toRank() { + return new Rank(this); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Refresh.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Refresh.java new file mode 100644 index 000000000..99dccc0fc --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Refresh.java @@ -0,0 +1,70 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +import co.elastic.clients.json.JsonpMapper; +import jakarta.json.stream.JsonGenerator; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum Refresh implements JsonEnum { + True("true"), + + False("false"), + + WaitFor("wait_for"), + + ; + + private final String jsonValue; + + Refresh(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + @Override + public void serialize(JsonGenerator generator, JsonpMapper params) { + if (this == Refresh.True) { + generator.write(true); + } else if (this == Refresh.False) { + generator.write(false); + } else { + generator.write(jsonValue()); + } + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer.AllowingBooleans<>( + Refresh.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RequestBase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RequestBase.java new file mode 100644 index 000000000..c1469bfd2 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RequestBase.java @@ -0,0 +1,94 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; +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.transport.Endpoint; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.Map; +import java.util.Objects; + +// typedef: _types.RequestBase + +/** + * + * @see API + * specification + */ + +public abstract class RequestBase { + public RequestBase() { + } + + public abstract static class AbstractBuilder> + extends + WithJsonObjectBuilderBase { + protected abstract BuilderT self(); + + } + + @Override + public String toString() { + + StringBuilder sb = new StringBuilder(this.getClass().getSimpleName()).append(": "); + + try { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) this.getClass() + .getDeclaredField("_ENDPOINT").get(null); + + sb.append(endpoint.method(this)).append(" ").append(endpoint.requestUrl(this)); + + Map params = endpoint.queryParameters(this); + String delim = "?"; + for (Map.Entry param : params.entrySet()) { + sb.append(delim); + delim = "&"; + sb.append(param.getKey()).append("=").append(URLEncoder.encode(param.getValue(), "UTF-8")); + } + + } catch (NoSuchFieldException | IllegalAccessException e) { + // No endpoint, ignore + } catch (UnsupportedEncodingException e) { + // Should not happen (UTF-8 is builtin) + } + + if (this instanceof JsonpSerializable) { + sb.append(' '); + JsonpUtils.toString((JsonpSerializable) this, sb); + } + + return sb.toString(); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Result.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Result.java new file mode 100644 index 000000000..9cdfc3c0b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Result.java @@ -0,0 +1,59 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API specification + */ +@JsonpDeserializable +public enum Result implements JsonEnum { + Created("created"), + + Updated("updated"), + + Deleted("deleted"), + + NotFound("not_found"), + + NoOp("noop"), + + ; + + private final String jsonValue; + + Result(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(Result.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Retries.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Retries.java new file mode 100644 index 000000000..c0c711b40 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Retries.java @@ -0,0 +1,165 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.util.Objects; +import java.util.function.Function; + +// typedef: _types.Retries + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Retries implements JsonpSerializable { + private final long bulk; + + private final long search; + + // --------------------------------------------------------------------------------------------- + + private Retries(Builder builder) { + + this.bulk = ApiTypeHelper.requireNonNull(builder.bulk, this, "bulk"); + this.search = ApiTypeHelper.requireNonNull(builder.search, this, "search"); + + } + + public static Retries of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code bulk} + */ + public final long bulk() { + return this.bulk; + } + + /** + * Required - API name: {@code search} + */ + public final long search() { + return this.search; + } + + /** + * 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("bulk"); + generator.write(this.bulk); + + generator.writeKey("search"); + generator.write(this.search); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Retries}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Long bulk; + + private Long search; + + /** + * Required - API name: {@code bulk} + */ + public final Builder bulk(long value) { + this.bulk = value; + return this; + } + + /** + * Required - API name: {@code search} + */ + public final Builder search(long value) { + this.search = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link Retries}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public Retries build() { + _checkSingleUse(); + + return new Retries(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Retries} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Retries::setupRetriesDeserializer); + + protected static void setupRetriesDeserializer(ObjectDeserializer op) { + + op.add(Builder::bulk, JsonpDeserializer.longDeserializer(), "bulk"); + op.add(Builder::search, JsonpDeserializer.longDeserializer(), "search"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RrfRank.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RrfRank.java new file mode 100644 index 000000000..01bfbfb6b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/RrfRank.java @@ -0,0 +1,193 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.Long; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.RrfRank + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class RrfRank extends RankBase implements RankVariant, JsonpSerializable { + @Nullable + private final Long rankConstant; + + @Nullable + private final Long windowSize; + + // --------------------------------------------------------------------------------------------- + + private RrfRank(Builder builder) { + + this.rankConstant = builder.rankConstant; + this.windowSize = builder.windowSize; + + } + + public static RrfRank of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Rank variant kind. + */ + @Override + public Rank.Kind _rankKind() { + return Rank.Kind.Rrf; + } + + /** + * How much influence documents in individual result sets per query have over + * the final ranked result set + *

+ * API name: {@code rank_constant} + */ + @Nullable + public final Long rankConstant() { + return this.rankConstant; + } + + /** + * Size of the individual result sets per query + *

+ * API name: {@code window_size} + */ + @Nullable + public final Long windowSize() { + return this.windowSize; + } + + /** + * 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 (this.rankConstant != null) { + generator.writeKey("rank_constant"); + generator.write(this.rankConstant); + + } + if (this.windowSize != null) { + generator.writeKey("window_size"); + generator.write(this.windowSize); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link RrfRank}. + */ + + public static class Builder extends RankBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private Long rankConstant; + + @Nullable + private Long windowSize; + + /** + * How much influence documents in individual result sets per query have over + * the final ranked result set + *

+ * API name: {@code rank_constant} + */ + public final Builder rankConstant(@Nullable Long value) { + this.rankConstant = value; + return this; + } + + /** + * Size of the individual result sets per query + *

+ * API name: {@code window_size} + */ + public final Builder windowSize(@Nullable Long value) { + this.windowSize = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link RrfRank}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public RrfRank build() { + _checkSingleUse(); + + return new RrfRank(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link RrfRank} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + RrfRank::setupRrfRankDeserializer); + + protected static void setupRrfRankDeserializer(ObjectDeserializer op) { + + op.add(Builder::rankConstant, JsonpDeserializer.longDeserializer(), "rank_constant"); + op.add(Builder::windowSize, JsonpDeserializer.longDeserializer(), "window_size"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ScoreSort.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ScoreSort.java new file mode 100644 index 000000000..4e1853727 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/ScoreSort.java @@ -0,0 +1,153 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.ScoreSort + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ScoreSort implements SortOptionsVariant, JsonpSerializable { + @Nullable + private final SortOrder order; + + // --------------------------------------------------------------------------------------------- + + private ScoreSort(Builder builder) { + + this.order = builder.order; + + } + + public static ScoreSort of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * SortOptions variant kind. + */ + @Override + public SortOptions.Kind _sortOptionsKind() { + return SortOptions.Kind.Doc; + } + + /** + * API name: {@code order} + */ + @Nullable + public final SortOrder order() { + return this.order; + } + + /** + * 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 (this.order != null) { + generator.writeKey("order"); + this.order.serialize(generator, mapper); + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ScoreSort}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private SortOrder order; + + /** + * API name: {@code order} + */ + public final Builder order(@Nullable SortOrder value) { + this.order = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ScoreSort}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ScoreSort build() { + _checkSingleUse(); + + return new ScoreSort(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ScoreSort} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + ScoreSort::setupScoreSortDeserializer); + + protected static void setupScoreSortDeserializer(ObjectDeserializer op) { + + op.add(Builder::order, SortOrder._DESERIALIZER, "order"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Script.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Script.java new file mode 100644 index 000000000..1f2130c06 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/_types/Script.java @@ -0,0 +1,173 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch._types; + +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.ObjectDeserializer; +import co.elastic.clients.json.UnionDeserializer; +import co.elastic.clients.util.ApiTypeHelper; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.ObjectBuilderBase; +import co.elastic.clients.util.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import jakarta.json.stream.JsonGenerator; +import java.lang.Object; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: _types.Script + +/** + * + * @see API specification + */ +@JsonpDeserializable +public class Script implements TaggedUnion, JsonpSerializable { + + public enum Kind { + Inline, Stored + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + private Script(Kind kind, Object value) { + this._kind = kind; + this._value = value; + } + + private Script(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + + } + + public static Script of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Is this variant instance of kind {@code inline}? + */ + public boolean isInline() { + return _kind == Kind.Inline; + } + + /** + * Get the {@code inline} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code inline} kind. + */ + public InlineScript inline() { + return TaggedUnionUtils.get(this, Kind.Inline); + } + + /** + * Is this variant instance of kind {@code stored}? + */ + public boolean isStored() { + return _kind == Kind.Stored; + } + + /** + * Get the {@code stored} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code stored} kind. + */ + public StoredScriptId stored() { + return TaggedUnionUtils.get(this, Kind.Stored); + } + + @Override + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends ObjectBuilderBase implements ObjectBuilder + + + Please see the Elasticsearch API specification. + + diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/DeletePolicyRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/DeletePolicyRequest.java new file mode 100644 index 000000000..4acb57e2d --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/DeletePolicyRequest.java @@ -0,0 +1,171 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +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.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: enrich.delete_policy.Request + +/** + * Deletes an existing enrich policy and its enrich index. + * + * @see API + * specification + */ + +public class DeletePolicyRequest extends RequestBase { + private final String name; + + // --------------------------------------------------------------------------------------------- + + private DeletePolicyRequest(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + + } + + public static DeletePolicyRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Enrich policy to delete. + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeletePolicyRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + private String name; + + /** + * Required - Enrich policy to delete. + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeletePolicyRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeletePolicyRequest build() { + _checkSingleUse(); + + return new DeletePolicyRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code enrich.delete_policy}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/enrich.delete_policy", + + // Request method + request -> { + return "DELETE"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_enrich"); + buf.append("/policy"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name); + } + return params; + }, + + // Request parameters + request -> { + return Collections.emptyMap(); + + }, SimpleEndpoint.emptyMap(), false, DeletePolicyResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/DeletePolicyResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/DeletePolicyResponse.java new file mode 100644 index 000000000..22871b777 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/DeletePolicyResponse.java @@ -0,0 +1,96 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +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; + +// typedef: enrich.delete_policy.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DeletePolicyResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private DeletePolicyResponse(Builder builder) { + super(builder); + + } + + public static DeletePolicyResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeletePolicyResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeletePolicyResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeletePolicyResponse build() { + _checkSingleUse(); + + return new DeletePolicyResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeletePolicyResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DeletePolicyResponse::setupDeletePolicyResponseDeserializer); + + protected static void setupDeletePolicyResponseDeserializer(ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichAsyncClient.java new file mode 100644 index 000000000..f0c1e46f5 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichAsyncClient.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +import co.elastic.clients.ApiClient; +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.transport.ElasticsearchTransport; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.JsonEndpoint; +import co.elastic.clients.transport.Transport; +import co.elastic.clients.transport.TransportOptions; +import co.elastic.clients.util.ObjectBuilder; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import javax.annotation.Nullable; + +/** + * Client for the enrich namespace. + */ +public class ElasticsearchEnrichAsyncClient extends ApiClient { + + public ElasticsearchEnrichAsyncClient(ElasticsearchTransport transport) { + super(transport, null); + } + + public ElasticsearchEnrichAsyncClient(ElasticsearchTransport transport, + @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + @Override + public ElasticsearchEnrichAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) { + return new ElasticsearchEnrichAsyncClient(this.transport, transportOptions); + } + + // ----- Endpoint: enrich.delete_policy + + /** + * Deletes an existing enrich policy and its enrich index. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture deletePolicy(DeletePolicyRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeletePolicyRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Deletes an existing enrich policy and its enrich index. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeletePolicyRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture deletePolicy( + Function> fn) { + return deletePolicy(fn.apply(new DeletePolicyRequest.Builder()).build()); + } + + // ----- Endpoint: enrich.execute_policy + + /** + * Creates the enrich index for an existing enrich policy. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture executePolicy(ExecutePolicyRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ExecutePolicyRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Creates the enrich index for an existing enrich policy. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExecutePolicyRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture executePolicy( + Function> fn) { + return executePolicy(fn.apply(new ExecutePolicyRequest.Builder()).build()); + } + + // ----- Endpoint: enrich.get_policy + + /** + * Gets information about an enrich policy. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getPolicy(GetPolicyRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetPolicyRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Gets information about an enrich policy. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetPolicyRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture getPolicy( + Function> fn) { + return getPolicy(fn.apply(new GetPolicyRequest.Builder()).build()); + } + + /** + * Gets information about an enrich policy. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getPolicy() { + return this.transport.performRequestAsync(new GetPolicyRequest.Builder().build(), GetPolicyRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: enrich.put_policy + + /** + * Creates a new enrich policy. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture putPolicy(PutPolicyRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutPolicyRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Creates a new enrich policy. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutPolicyRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture putPolicy( + Function> fn) { + return putPolicy(fn.apply(new PutPolicyRequest.Builder()).build()); + } + + // ----- Endpoint: enrich.stats + + /** + * Gets enrich coordinator statistics and information about enrich policies that + * are currently executing. + * + * @see Documentation + * on elastic.co + */ + public CompletableFuture stats() { + return this.transport.performRequestAsync(EnrichStatsRequest._INSTANCE, EnrichStatsRequest._ENDPOINT, + this.transportOptions); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichClient.java new file mode 100644 index 000000000..b9a094353 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ElasticsearchEnrichClient.java @@ -0,0 +1,220 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +import co.elastic.clients.ApiClient; +import co.elastic.clients.elasticsearch._types.ElasticsearchException; +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.transport.ElasticsearchTransport; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.JsonEndpoint; +import co.elastic.clients.transport.Transport; +import co.elastic.clients.transport.TransportOptions; +import co.elastic.clients.util.ObjectBuilder; +import java.io.IOException; +import java.util.function.Function; +import javax.annotation.Nullable; + +/** + * Client for the enrich namespace. + */ +public class ElasticsearchEnrichClient extends ApiClient { + + public ElasticsearchEnrichClient(ElasticsearchTransport transport) { + super(transport, null); + } + + public ElasticsearchEnrichClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + @Override + public ElasticsearchEnrichClient withTransportOptions(@Nullable TransportOptions transportOptions) { + return new ElasticsearchEnrichClient(this.transport, transportOptions); + } + + // ----- Endpoint: enrich.delete_policy + + /** + * Deletes an existing enrich policy and its enrich index. + * + * @see Documentation + * on elastic.co + */ + + public DeletePolicyResponse deletePolicy(DeletePolicyRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeletePolicyRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Deletes an existing enrich policy and its enrich index. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeletePolicyRequest} + * @see Documentation + * on elastic.co + */ + + public final DeletePolicyResponse deletePolicy( + Function> fn) + throws IOException, ElasticsearchException { + return deletePolicy(fn.apply(new DeletePolicyRequest.Builder()).build()); + } + + // ----- Endpoint: enrich.execute_policy + + /** + * Creates the enrich index for an existing enrich policy. + * + * @see Documentation + * on elastic.co + */ + + public ExecutePolicyResponse executePolicy(ExecutePolicyRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ExecutePolicyRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Creates the enrich index for an existing enrich policy. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExecutePolicyRequest} + * @see Documentation + * on elastic.co + */ + + public final ExecutePolicyResponse executePolicy( + Function> fn) + throws IOException, ElasticsearchException { + return executePolicy(fn.apply(new ExecutePolicyRequest.Builder()).build()); + } + + // ----- Endpoint: enrich.get_policy + + /** + * Gets information about an enrich policy. + * + * @see Documentation + * on elastic.co + */ + + public GetPolicyResponse getPolicy(GetPolicyRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetPolicyRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Gets information about an enrich policy. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetPolicyRequest} + * @see Documentation + * on elastic.co + */ + + public final GetPolicyResponse getPolicy(Function> fn) + throws IOException, ElasticsearchException { + return getPolicy(fn.apply(new GetPolicyRequest.Builder()).build()); + } + + /** + * Gets information about an enrich policy. + * + * @see Documentation + * on elastic.co + */ + + public GetPolicyResponse getPolicy() throws IOException, ElasticsearchException { + return this.transport.performRequest(new GetPolicyRequest.Builder().build(), GetPolicyRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: enrich.put_policy + + /** + * Creates a new enrich policy. + * + * @see Documentation + * on elastic.co + */ + + public PutPolicyResponse putPolicy(PutPolicyRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutPolicyRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Creates a new enrich policy. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutPolicyRequest} + * @see Documentation + * on elastic.co + */ + + public final PutPolicyResponse putPolicy(Function> fn) + throws IOException, ElasticsearchException { + return putPolicy(fn.apply(new PutPolicyRequest.Builder()).build()); + } + + // ----- Endpoint: enrich.stats + + /** + * Gets enrich coordinator statistics and information about enrich policies that + * are currently executing. + * + * @see Documentation + * on elastic.co + */ + public EnrichStatsResponse stats() throws IOException, ElasticsearchException { + return this.transport.performRequest(EnrichStatsRequest._INSTANCE, EnrichStatsRequest._ENDPOINT, + this.transportOptions); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichPolicy.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichPolicy.java new file mode 100644 index 000000000..4ba5bdaa7 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichPolicy.java @@ -0,0 +1,319 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +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; + +// typedef: enrich._types.Policy + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class EnrichPolicy implements JsonpSerializable { + private final List enrichFields; + + private final List indices; + + private final String matchField; + + @Nullable + private final String query; + + @Nullable + private final String name; + + @Nullable + private final String elasticsearchVersion; + + // --------------------------------------------------------------------------------------------- + + private EnrichPolicy(Builder builder) { + + this.enrichFields = ApiTypeHelper.unmodifiableRequired(builder.enrichFields, this, "enrichFields"); + this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); + this.matchField = ApiTypeHelper.requireNonNull(builder.matchField, this, "matchField"); + this.query = builder.query; + this.name = builder.name; + this.elasticsearchVersion = builder.elasticsearchVersion; + + } + + public static EnrichPolicy of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code enrich_fields} + */ + public final List enrichFields() { + return this.enrichFields; + } + + /** + * Required - API name: {@code indices} + */ + public final List indices() { + return this.indices; + } + + /** + * Required - API name: {@code match_field} + */ + public final String matchField() { + return this.matchField; + } + + /** + * API name: {@code query} + */ + @Nullable + public final String query() { + return this.query; + } + + /** + * API name: {@code name} + */ + @Nullable + public final String name() { + return this.name; + } + + /** + * API name: {@code elasticsearch_version} + */ + @Nullable + public final String elasticsearchVersion() { + return this.elasticsearchVersion; + } + + /** + * 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.enrichFields)) { + generator.writeKey("enrich_fields"); + generator.writeStartArray(); + for (String item0 : this.enrichFields) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.indices)) { + generator.writeKey("indices"); + generator.writeStartArray(); + for (String item0 : this.indices) { + generator.write(item0); + + } + generator.writeEnd(); + + } + generator.writeKey("match_field"); + generator.write(this.matchField); + + if (this.query != null) { + generator.writeKey("query"); + generator.write(this.query); + + } + if (this.name != null) { + generator.writeKey("name"); + generator.write(this.name); + + } + if (this.elasticsearchVersion != null) { + generator.writeKey("elasticsearch_version"); + generator.write(this.elasticsearchVersion); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link EnrichPolicy}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private List enrichFields; + + private List indices; + + private String matchField; + + @Nullable + private String query; + + @Nullable + private String name; + + @Nullable + private String elasticsearchVersion; + + /** + * Required - API name: {@code enrich_fields} + *

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

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

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

+ * Adds one or more values to indices. + */ + public final Builder indices(String value, String... values) { + this.indices = _listAdd(this.indices, value, values); + return this; + } + + /** + * Required - API name: {@code match_field} + */ + public final Builder matchField(String value) { + this.matchField = value; + return this; + } + + /** + * API name: {@code query} + */ + public final Builder query(@Nullable String value) { + this.query = value; + return this; + } + + /** + * API name: {@code name} + */ + public final Builder name(@Nullable String value) { + this.name = value; + return this; + } + + /** + * API name: {@code elasticsearch_version} + */ + public final Builder elasticsearchVersion(@Nullable String value) { + this.elasticsearchVersion = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link EnrichPolicy}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public EnrichPolicy build() { + _checkSingleUse(); + + return new EnrichPolicy(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link EnrichPolicy} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + EnrichPolicy::setupEnrichPolicyDeserializer); + + protected static void setupEnrichPolicyDeserializer(ObjectDeserializer op) { + + op.add(Builder::enrichFields, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "enrich_fields"); + op.add(Builder::indices, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "indices"); + op.add(Builder::matchField, JsonpDeserializer.stringDeserializer(), "match_field"); + op.add(Builder::query, JsonpDeserializer.stringDeserializer(), "query"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::elasticsearchVersion, JsonpDeserializer.stringDeserializer(), "elasticsearch_version"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichPolicyType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichPolicyType.java new file mode 100644 index 000000000..bd68fee10 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichPolicyType.java @@ -0,0 +1,57 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum EnrichPolicyType implements JsonEnum { + GeoMatch("geo_match"), + + Match("match"), + + Range("range"), + + ; + + private final String jsonValue; + + EnrichPolicyType(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + EnrichPolicyType.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichStatsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichStatsRequest.java new file mode 100644 index 000000000..60bb42209 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichStatsRequest.java @@ -0,0 +1,88 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +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.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.util.Collections; +import java.util.Objects; + +// typedef: enrich.stats.Request + +/** + * Returns enrich coordinator statistics and information about enrich policies + * that are currently executing. + * + * @see API + * specification + */ + +public class EnrichStatsRequest extends RequestBase { + public EnrichStatsRequest() { + } + + /** + * Singleton instance for {@link EnrichStatsRequest}. + */ + public static final EnrichStatsRequest _INSTANCE = new EnrichStatsRequest(); + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code enrich.stats}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/enrich.stats", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + return "/_enrich/_stats"; + + }, + + // Path parameters + request -> { + return Collections.emptyMap(); + }, + + // Request parameters + request -> { + return Collections.emptyMap(); + + }, SimpleEndpoint.emptyMap(), false, EnrichStatsResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichStatsResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichStatsResponse.java new file mode 100644 index 000000000..09ef900dc --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichStatsResponse.java @@ -0,0 +1,320 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +import co.elastic.clients.elasticsearch.enrich.stats.CacheStats; +import co.elastic.clients.elasticsearch.enrich.stats.CoordinatorStats; +import co.elastic.clients.elasticsearch.enrich.stats.ExecutingPolicy; +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; + +// typedef: enrich.stats.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class EnrichStatsResponse implements JsonpSerializable { + private final List coordinatorStats; + + private final List executingPolicies; + + private final List cacheStats; + + // --------------------------------------------------------------------------------------------- + + private EnrichStatsResponse(Builder builder) { + + this.coordinatorStats = ApiTypeHelper.unmodifiableRequired(builder.coordinatorStats, this, "coordinatorStats"); + this.executingPolicies = ApiTypeHelper.unmodifiableRequired(builder.executingPolicies, this, + "executingPolicies"); + this.cacheStats = ApiTypeHelper.unmodifiable(builder.cacheStats); + + } + + public static EnrichStatsResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Objects containing information about each coordinating ingest node + * for configured enrich processors. + *

+ * API name: {@code coordinator_stats} + */ + public final List coordinatorStats() { + return this.coordinatorStats; + } + + /** + * Required - Objects containing information about each enrich policy that is + * currently executing. + *

+ * API name: {@code executing_policies} + */ + public final List executingPolicies() { + return this.executingPolicies; + } + + /** + * Objects containing information about the enrich cache stats on each ingest + * node. + *

+ * API name: {@code cache_stats} + */ + public final List cacheStats() { + return this.cacheStats; + } + + /** + * 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.coordinatorStats)) { + generator.writeKey("coordinator_stats"); + generator.writeStartArray(); + for (CoordinatorStats item0 : this.coordinatorStats) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.executingPolicies)) { + generator.writeKey("executing_policies"); + generator.writeStartArray(); + for (ExecutingPolicy item0 : this.executingPolicies) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.cacheStats)) { + generator.writeKey("cache_stats"); + generator.writeStartArray(); + for (CacheStats item0 : this.cacheStats) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link EnrichStatsResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private List coordinatorStats; + + private List executingPolicies; + + @Nullable + private List cacheStats; + + /** + * Required - Objects containing information about each coordinating ingest node + * for configured enrich processors. + *

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

+ * Adds all elements of list to coordinatorStats. + */ + public final Builder coordinatorStats(List list) { + this.coordinatorStats = _listAddAll(this.coordinatorStats, list); + return this; + } + + /** + * Required - Objects containing information about each coordinating ingest node + * for configured enrich processors. + *

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

+ * Adds one or more values to coordinatorStats. + */ + public final Builder coordinatorStats(CoordinatorStats value, CoordinatorStats... values) { + this.coordinatorStats = _listAdd(this.coordinatorStats, value, values); + return this; + } + + /** + * Required - Objects containing information about each coordinating ingest node + * for configured enrich processors. + *

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

+ * Adds a value to coordinatorStats using a builder lambda. + */ + public final Builder coordinatorStats(Function> fn) { + return coordinatorStats(fn.apply(new CoordinatorStats.Builder()).build()); + } + + /** + * Required - Objects containing information about each enrich policy that is + * currently executing. + *

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

+ * Adds all elements of list to executingPolicies. + */ + public final Builder executingPolicies(List list) { + this.executingPolicies = _listAddAll(this.executingPolicies, list); + return this; + } + + /** + * Required - Objects containing information about each enrich policy that is + * currently executing. + *

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

+ * Adds one or more values to executingPolicies. + */ + public final Builder executingPolicies(ExecutingPolicy value, ExecutingPolicy... values) { + this.executingPolicies = _listAdd(this.executingPolicies, value, values); + return this; + } + + /** + * Required - Objects containing information about each enrich policy that is + * currently executing. + *

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

+ * Adds a value to executingPolicies using a builder lambda. + */ + public final Builder executingPolicies(Function> fn) { + return executingPolicies(fn.apply(new ExecutingPolicy.Builder()).build()); + } + + /** + * Objects containing information about the enrich cache stats on each ingest + * node. + *

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

+ * Adds all elements of list to cacheStats. + */ + public final Builder cacheStats(List list) { + this.cacheStats = _listAddAll(this.cacheStats, list); + return this; + } + + /** + * Objects containing information about the enrich cache stats on each ingest + * node. + *

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

+ * Adds one or more values to cacheStats. + */ + public final Builder cacheStats(CacheStats value, CacheStats... values) { + this.cacheStats = _listAdd(this.cacheStats, value, values); + return this; + } + + /** + * Objects containing information about the enrich cache stats on each ingest + * node. + *

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

+ * Adds a value to cacheStats using a builder lambda. + */ + public final Builder cacheStats(Function> fn) { + return cacheStats(fn.apply(new CacheStats.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link EnrichStatsResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public EnrichStatsResponse build() { + _checkSingleUse(); + + return new EnrichStatsResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link EnrichStatsResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, EnrichStatsResponse::setupEnrichStatsResponseDeserializer); + + protected static void setupEnrichStatsResponseDeserializer(ObjectDeserializer op) { + + op.add(Builder::coordinatorStats, JsonpDeserializer.arrayDeserializer(CoordinatorStats._DESERIALIZER), + "coordinator_stats"); + op.add(Builder::executingPolicies, JsonpDeserializer.arrayDeserializer(ExecutingPolicy._DESERIALIZER), + "executing_policies"); + op.add(Builder::cacheStats, JsonpDeserializer.arrayDeserializer(CacheStats._DESERIALIZER), "cache_stats"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichSummary.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichSummary.java new file mode 100644 index 000000000..cb22ecebc --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/EnrichSummary.java @@ -0,0 +1,163 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +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.Pair; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: enrich._types.Summary + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class EnrichSummary implements JsonpSerializable { + private final Pair config; + + // --------------------------------------------------------------------------------------------- + + private EnrichSummary(Builder builder) { + + this.config = ApiTypeHelper.requireNonNull(builder.config, this, "config"); + + } + + public static EnrichSummary of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code config} + */ + public final Pair config() { + return this.config; + } + + /** + * 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("config"); + generator.writeStartObject(); + generator.writeKey(this.config.key().jsonValue()); + this.config.value().serialize(generator, mapper); + + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link EnrichSummary}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Pair config; + + /** + * Required - API name: {@code config} + */ + public final Builder config(Pair value) { + this.config = value; + return this; + } + + /** + * Required - API name: {@code config} + */ + public Builder config(EnrichPolicyType key, EnrichPolicy value) { + this.config = new Pair(key, value); + return this; + } + + /** + * Required - API name: {@code config} + */ + public Builder config(EnrichPolicyType key, Function> fn) { + return this.config(key, fn.apply(new EnrichPolicy.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link EnrichSummary}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public EnrichSummary build() { + _checkSingleUse(); + + return new EnrichSummary(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link EnrichSummary} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + EnrichSummary::setupEnrichSummaryDeserializer); + + protected static void setupEnrichSummaryDeserializer(ObjectDeserializer op) { + + op.add(Builder::config, + Pair.deserializer((k) -> EnrichPolicyType._DESERIALIZER.parse(k), EnrichPolicy._DESERIALIZER), + "config"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ExecutePolicyRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ExecutePolicyRequest.java new file mode 100644 index 000000000..541ac4f7f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ExecutePolicyRequest.java @@ -0,0 +1,205 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +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.Boolean; +import java.lang.String; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: enrich.execute_policy.Request + +/** + * Creates the enrich index for an existing enrich policy. + * + * @see API + * specification + */ + +public class ExecutePolicyRequest extends RequestBase { + private final String name; + + @Nullable + private final Boolean waitForCompletion; + + // --------------------------------------------------------------------------------------------- + + private ExecutePolicyRequest(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.waitForCompletion = builder.waitForCompletion; + + } + + public static ExecutePolicyRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Enrich policy to execute. + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * If true, the request blocks other enrich policy execution + * requests until complete. + *

+ * API name: {@code wait_for_completion} + */ + @Nullable + public final Boolean waitForCompletion() { + return this.waitForCompletion; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ExecutePolicyRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + private String name; + + @Nullable + private Boolean waitForCompletion; + + /** + * Required - Enrich policy to execute. + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * If true, the request blocks other enrich policy execution + * requests until complete. + *

+ * API name: {@code wait_for_completion} + */ + public final Builder waitForCompletion(@Nullable Boolean value) { + this.waitForCompletion = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ExecutePolicyRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ExecutePolicyRequest build() { + _checkSingleUse(); + + return new ExecutePolicyRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code enrich.execute_policy}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/enrich.execute_policy", + + // Request method + request -> { + return "PUT"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_enrich"); + buf.append("/policy"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + buf.append("/_execute"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.waitForCompletion != null) { + params.put("wait_for_completion", String.valueOf(request.waitForCompletion)); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, ExecutePolicyResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ExecutePolicyResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ExecutePolicyResponse.java new file mode 100644 index 000000000..f7d54009c --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/ExecutePolicyResponse.java @@ -0,0 +1,183 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +import co.elastic.clients.elasticsearch.enrich.execute_policy.ExecuteEnrichPolicyStatus; +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; + +// typedef: enrich.execute_policy.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ExecutePolicyResponse implements JsonpSerializable { + private final ExecuteEnrichPolicyStatus status; + + @Nullable + private final String taskId; + + // --------------------------------------------------------------------------------------------- + + private ExecutePolicyResponse(Builder builder) { + + this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status"); + this.taskId = builder.taskId; + + } + + public static ExecutePolicyResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code status} + */ + public final ExecuteEnrichPolicyStatus status() { + return this.status; + } + + /** + * API name: {@code task_id} + */ + @Nullable + public final String taskId() { + return this.taskId; + } + + /** + * 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("status"); + this.status.serialize(generator, mapper); + + if (this.taskId != null) { + generator.writeKey("task_id"); + generator.write(this.taskId); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ExecutePolicyResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private ExecuteEnrichPolicyStatus status; + + @Nullable + private String taskId; + + /** + * Required - API name: {@code status} + */ + public final Builder status(ExecuteEnrichPolicyStatus value) { + this.status = value; + return this; + } + + /** + * Required - API name: {@code status} + */ + public final Builder status( + Function> fn) { + return this.status(fn.apply(new ExecuteEnrichPolicyStatus.Builder()).build()); + } + + /** + * API name: {@code task_id} + */ + public final Builder taskId(@Nullable String value) { + this.taskId = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ExecutePolicyResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ExecutePolicyResponse build() { + _checkSingleUse(); + + return new ExecutePolicyResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ExecutePolicyResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ExecutePolicyResponse::setupExecutePolicyResponseDeserializer); + + protected static void setupExecutePolicyResponseDeserializer(ObjectDeserializer op) { + + op.add(Builder::status, ExecuteEnrichPolicyStatus._DESERIALIZER, "status"); + op.add(Builder::taskId, JsonpDeserializer.stringDeserializer(), "task_id"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/GetPolicyRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/GetPolicyRequest.java new file mode 100644 index 000000000..67c7de99f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/GetPolicyRequest.java @@ -0,0 +1,201 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +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.Collections; +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; + +// typedef: enrich.get_policy.Request + +/** + * Returns information about an enrich policy. + * + * @see API + * specification + */ + +public class GetPolicyRequest extends RequestBase { + private final List name; + + // --------------------------------------------------------------------------------------------- + + private GetPolicyRequest(Builder builder) { + + this.name = ApiTypeHelper.unmodifiable(builder.name); + + } + + public static GetPolicyRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Comma-separated list of enrich policy names used to limit the request. To + * return information for all enrich policies, omit this parameter. + *

+ * API name: {@code name} + */ + public final List name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetPolicyRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private List name; + + /** + * Comma-separated list of enrich policy names used to limit the request. To + * return information for all enrich policies, omit this parameter. + *

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

+ * Adds all elements of list to name. + */ + public final Builder name(List list) { + this.name = _listAddAll(this.name, list); + return this; + } + + /** + * Comma-separated list of enrich policy names used to limit the request. To + * return information for all enrich policies, omit this parameter. + *

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

+ * Adds one or more values to name. + */ + public final Builder name(String value, String... values) { + this.name = _listAdd(this.name, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetPolicyRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetPolicyRequest build() { + _checkSingleUse(); + + return new GetPolicyRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code enrich.get_policy}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/enrich.get_policy", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.name())) + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_enrich"); + buf.append("/policy"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_enrich"); + buf.append("/policy"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.name())) + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); + } + if (propsSet == 0) { + } + return params; + }, + + // Request parameters + request -> { + return Collections.emptyMap(); + + }, SimpleEndpoint.emptyMap(), false, GetPolicyResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/GetPolicyResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/GetPolicyResponse.java new file mode 100644 index 000000000..87ff700c0 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/GetPolicyResponse.java @@ -0,0 +1,171 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +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; + +// typedef: enrich.get_policy.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GetPolicyResponse implements JsonpSerializable { + private final List policies; + + // --------------------------------------------------------------------------------------------- + + private GetPolicyResponse(Builder builder) { + + this.policies = ApiTypeHelper.unmodifiableRequired(builder.policies, this, "policies"); + + } + + public static GetPolicyResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code policies} + */ + public final List policies() { + return this.policies; + } + + /** + * 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.policies)) { + generator.writeKey("policies"); + generator.writeStartArray(); + for (EnrichSummary item0 : this.policies) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetPolicyResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private List policies; + + /** + * Required - API name: {@code policies} + *

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

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

+ * Adds a value to policies using a builder lambda. + */ + public final Builder policies(Function> fn) { + return policies(fn.apply(new EnrichSummary.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetPolicyResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetPolicyResponse build() { + _checkSingleUse(); + + return new GetPolicyResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GetPolicyResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, GetPolicyResponse::setupGetPolicyResponseDeserializer); + + protected static void setupGetPolicyResponseDeserializer(ObjectDeserializer op) { + + op.add(Builder::policies, JsonpDeserializer.arrayDeserializer(EnrichSummary._DESERIALIZER), "policies"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/PutPolicyRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/PutPolicyRequest.java new file mode 100644 index 000000000..d66b72551 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/PutPolicyRequest.java @@ -0,0 +1,332 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +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.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.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: enrich.put_policy.Request + +/** + * Creates an enrich policy. + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutPolicyRequest extends RequestBase implements JsonpSerializable { + @Nullable + private final EnrichPolicy geoMatch; + + @Nullable + private final EnrichPolicy match; + + private final String name; + + @Nullable + private final EnrichPolicy range; + + // --------------------------------------------------------------------------------------------- + + private PutPolicyRequest(Builder builder) { + + this.geoMatch = builder.geoMatch; + this.match = builder.match; + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.range = builder.range; + + } + + public static PutPolicyRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Matches enrich data to incoming documents based on a geo_shape + * query. + *

+ * API name: {@code geo_match} + */ + @Nullable + public final EnrichPolicy geoMatch() { + return this.geoMatch; + } + + /** + * Matches enrich data to incoming documents based on a term query. + *

+ * API name: {@code match} + */ + @Nullable + public final EnrichPolicy match() { + return this.match; + } + + /** + * Required - Name of the enrich policy to create or update. + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * Matches a number, date, or IP address in incoming documents to a range in the + * enrich index based on a term query. + *

+ * API name: {@code range} + */ + @Nullable + public final EnrichPolicy range() { + return this.range; + } + + /** + * 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 (this.geoMatch != null) { + generator.writeKey("geo_match"); + this.geoMatch.serialize(generator, mapper); + + } + if (this.match != null) { + generator.writeKey("match"); + this.match.serialize(generator, mapper); + + } + if (this.range != null) { + generator.writeKey("range"); + this.range.serialize(generator, mapper); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutPolicyRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private EnrichPolicy geoMatch; + + @Nullable + private EnrichPolicy match; + + private String name; + + @Nullable + private EnrichPolicy range; + + /** + * Matches enrich data to incoming documents based on a geo_shape + * query. + *

+ * API name: {@code geo_match} + */ + public final Builder geoMatch(@Nullable EnrichPolicy value) { + this.geoMatch = value; + return this; + } + + /** + * Matches enrich data to incoming documents based on a geo_shape + * query. + *

+ * API name: {@code geo_match} + */ + public final Builder geoMatch(Function> fn) { + return this.geoMatch(fn.apply(new EnrichPolicy.Builder()).build()); + } + + /** + * Matches enrich data to incoming documents based on a term query. + *

+ * API name: {@code match} + */ + public final Builder match(@Nullable EnrichPolicy value) { + this.match = value; + return this; + } + + /** + * Matches enrich data to incoming documents based on a term query. + *

+ * API name: {@code match} + */ + public final Builder match(Function> fn) { + return this.match(fn.apply(new EnrichPolicy.Builder()).build()); + } + + /** + * Required - Name of the enrich policy to create or update. + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Matches a number, date, or IP address in incoming documents to a range in the + * enrich index based on a term query. + *

+ * API name: {@code range} + */ + public final Builder range(@Nullable EnrichPolicy value) { + this.range = value; + return this; + } + + /** + * Matches a number, date, or IP address in incoming documents to a range in the + * enrich index based on a term query. + *

+ * API name: {@code range} + */ + public final Builder range(Function> fn) { + return this.range(fn.apply(new EnrichPolicy.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutPolicyRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutPolicyRequest build() { + _checkSingleUse(); + + return new PutPolicyRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutPolicyRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + PutPolicyRequest::setupPutPolicyRequestDeserializer); + + protected static void setupPutPolicyRequestDeserializer(ObjectDeserializer op) { + + op.add(Builder::geoMatch, EnrichPolicy._DESERIALIZER, "geo_match"); + op.add(Builder::match, EnrichPolicy._DESERIALIZER, "match"); + op.add(Builder::range, EnrichPolicy._DESERIALIZER, "range"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code enrich.put_policy}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/enrich.put_policy", + + // Request method + request -> { + return "PUT"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_enrich"); + buf.append("/policy"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name); + } + return params; + }, + + // Request parameters + request -> { + return Collections.emptyMap(); + + }, SimpleEndpoint.emptyMap(), true, PutPolicyResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/PutPolicyResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/PutPolicyResponse.java new file mode 100644 index 000000000..4f336ce29 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/PutPolicyResponse.java @@ -0,0 +1,96 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich; + +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; + +// typedef: enrich.put_policy.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutPolicyResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private PutPolicyResponse(Builder builder) { + super(builder); + + } + + public static PutPolicyResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutPolicyResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutPolicyResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutPolicyResponse build() { + _checkSingleUse(); + + return new PutPolicyResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutPolicyResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, PutPolicyResponse::setupPutPolicyResponseDeserializer); + + protected static void setupPutPolicyResponseDeserializer(ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/execute_policy/EnrichPolicyPhase.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/execute_policy/EnrichPolicyPhase.java new file mode 100644 index 000000000..47f012902 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/execute_policy/EnrichPolicyPhase.java @@ -0,0 +1,60 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich.execute_policy; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum EnrichPolicyPhase implements JsonEnum { + Scheduled("SCHEDULED"), + + Running("RUNNING"), + + Complete("COMPLETE"), + + Failed("FAILED"), + + ; + + private final String jsonValue; + + EnrichPolicyPhase(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + EnrichPolicyPhase.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/execute_policy/ExecuteEnrichPolicyStatus.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/execute_policy/ExecuteEnrichPolicyStatus.java new file mode 100644 index 000000000..f9d5f37f6 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/execute_policy/ExecuteEnrichPolicyStatus.java @@ -0,0 +1,145 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich.execute_policy; + +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.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: enrich.execute_policy.ExecuteEnrichPolicyStatus + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ExecuteEnrichPolicyStatus implements JsonpSerializable { + private final EnrichPolicyPhase phase; + + // --------------------------------------------------------------------------------------------- + + private ExecuteEnrichPolicyStatus(Builder builder) { + + this.phase = ApiTypeHelper.requireNonNull(builder.phase, this, "phase"); + + } + + public static ExecuteEnrichPolicyStatus of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code phase} + */ + public final EnrichPolicyPhase phase() { + return this.phase; + } + + /** + * 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("phase"); + this.phase.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ExecuteEnrichPolicyStatus}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private EnrichPolicyPhase phase; + + /** + * Required - API name: {@code phase} + */ + public final Builder phase(EnrichPolicyPhase value) { + this.phase = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ExecuteEnrichPolicyStatus}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ExecuteEnrichPolicyStatus build() { + _checkSingleUse(); + + return new ExecuteEnrichPolicyStatus(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ExecuteEnrichPolicyStatus} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ExecuteEnrichPolicyStatus::setupExecuteEnrichPolicyStatusDeserializer); + + protected static void setupExecuteEnrichPolicyStatusDeserializer( + ObjectDeserializer op) { + + op.add(Builder::phase, EnrichPolicyPhase._DESERIALIZER, "phase"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/CacheStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/CacheStats.java new file mode 100644 index 000000000..a9bf07c87 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/CacheStats.java @@ -0,0 +1,239 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich.stats; + +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.Integer; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: enrich.stats.CacheStats + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CacheStats implements JsonpSerializable { + private final String nodeId; + + private final int count; + + private final int hits; + + private final int misses; + + private final int evictions; + + // --------------------------------------------------------------------------------------------- + + private CacheStats(Builder builder) { + + this.nodeId = ApiTypeHelper.requireNonNull(builder.nodeId, this, "nodeId"); + this.count = ApiTypeHelper.requireNonNull(builder.count, this, "count"); + this.hits = ApiTypeHelper.requireNonNull(builder.hits, this, "hits"); + this.misses = ApiTypeHelper.requireNonNull(builder.misses, this, "misses"); + this.evictions = ApiTypeHelper.requireNonNull(builder.evictions, this, "evictions"); + + } + + public static CacheStats of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code node_id} + */ + public final String nodeId() { + return this.nodeId; + } + + /** + * Required - API name: {@code count} + */ + public final int count() { + return this.count; + } + + /** + * Required - API name: {@code hits} + */ + public final int hits() { + return this.hits; + } + + /** + * Required - API name: {@code misses} + */ + public final int misses() { + return this.misses; + } + + /** + * Required - API name: {@code evictions} + */ + public final int evictions() { + return this.evictions; + } + + /** + * 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("node_id"); + generator.write(this.nodeId); + + generator.writeKey("count"); + generator.write(this.count); + + generator.writeKey("hits"); + generator.write(this.hits); + + generator.writeKey("misses"); + generator.write(this.misses); + + generator.writeKey("evictions"); + generator.write(this.evictions); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CacheStats}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String nodeId; + + private Integer count; + + private Integer hits; + + private Integer misses; + + private Integer evictions; + + /** + * Required - API name: {@code node_id} + */ + public final Builder nodeId(String value) { + this.nodeId = value; + return this; + } + + /** + * Required - API name: {@code count} + */ + public final Builder count(int value) { + this.count = value; + return this; + } + + /** + * Required - API name: {@code hits} + */ + public final Builder hits(int value) { + this.hits = value; + return this; + } + + /** + * Required - API name: {@code misses} + */ + public final Builder misses(int value) { + this.misses = value; + return this; + } + + /** + * Required - API name: {@code evictions} + */ + public final Builder evictions(int value) { + this.evictions = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CacheStats}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CacheStats build() { + _checkSingleUse(); + + return new CacheStats(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CacheStats} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + CacheStats::setupCacheStatsDeserializer); + + protected static void setupCacheStatsDeserializer(ObjectDeserializer op) { + + op.add(Builder::nodeId, JsonpDeserializer.stringDeserializer(), "node_id"); + op.add(Builder::count, JsonpDeserializer.integerDeserializer(), "count"); + op.add(Builder::hits, JsonpDeserializer.integerDeserializer(), "hits"); + op.add(Builder::misses, JsonpDeserializer.integerDeserializer(), "misses"); + op.add(Builder::evictions, JsonpDeserializer.integerDeserializer(), "evictions"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/CoordinatorStats.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/CoordinatorStats.java new file mode 100644 index 000000000..ea502f41b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/CoordinatorStats.java @@ -0,0 +1,244 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich.stats; + +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.Integer; +import java.lang.Long; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: enrich.stats.CoordinatorStats + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CoordinatorStats implements JsonpSerializable { + private final long executedSearchesTotal; + + private final String nodeId; + + private final int queueSize; + + private final int remoteRequestsCurrent; + + private final long remoteRequestsTotal; + + // --------------------------------------------------------------------------------------------- + + private CoordinatorStats(Builder builder) { + + this.executedSearchesTotal = ApiTypeHelper.requireNonNull(builder.executedSearchesTotal, this, + "executedSearchesTotal"); + this.nodeId = ApiTypeHelper.requireNonNull(builder.nodeId, this, "nodeId"); + this.queueSize = ApiTypeHelper.requireNonNull(builder.queueSize, this, "queueSize"); + this.remoteRequestsCurrent = ApiTypeHelper.requireNonNull(builder.remoteRequestsCurrent, this, + "remoteRequestsCurrent"); + this.remoteRequestsTotal = ApiTypeHelper.requireNonNull(builder.remoteRequestsTotal, this, + "remoteRequestsTotal"); + + } + + public static CoordinatorStats of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code executed_searches_total} + */ + public final long executedSearchesTotal() { + return this.executedSearchesTotal; + } + + /** + * Required - API name: {@code node_id} + */ + public final String nodeId() { + return this.nodeId; + } + + /** + * Required - API name: {@code queue_size} + */ + public final int queueSize() { + return this.queueSize; + } + + /** + * Required - API name: {@code remote_requests_current} + */ + public final int remoteRequestsCurrent() { + return this.remoteRequestsCurrent; + } + + /** + * Required - API name: {@code remote_requests_total} + */ + public final long remoteRequestsTotal() { + return this.remoteRequestsTotal; + } + + /** + * 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("executed_searches_total"); + generator.write(this.executedSearchesTotal); + + generator.writeKey("node_id"); + generator.write(this.nodeId); + + generator.writeKey("queue_size"); + generator.write(this.queueSize); + + generator.writeKey("remote_requests_current"); + generator.write(this.remoteRequestsCurrent); + + generator.writeKey("remote_requests_total"); + generator.write(this.remoteRequestsTotal); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CoordinatorStats}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Long executedSearchesTotal; + + private String nodeId; + + private Integer queueSize; + + private Integer remoteRequestsCurrent; + + private Long remoteRequestsTotal; + + /** + * Required - API name: {@code executed_searches_total} + */ + public final Builder executedSearchesTotal(long value) { + this.executedSearchesTotal = value; + return this; + } + + /** + * Required - API name: {@code node_id} + */ + public final Builder nodeId(String value) { + this.nodeId = value; + return this; + } + + /** + * Required - API name: {@code queue_size} + */ + public final Builder queueSize(int value) { + this.queueSize = value; + return this; + } + + /** + * Required - API name: {@code remote_requests_current} + */ + public final Builder remoteRequestsCurrent(int value) { + this.remoteRequestsCurrent = value; + return this; + } + + /** + * Required - API name: {@code remote_requests_total} + */ + public final Builder remoteRequestsTotal(long value) { + this.remoteRequestsTotal = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CoordinatorStats}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CoordinatorStats build() { + _checkSingleUse(); + + return new CoordinatorStats(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CoordinatorStats} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + CoordinatorStats::setupCoordinatorStatsDeserializer); + + protected static void setupCoordinatorStatsDeserializer(ObjectDeserializer op) { + + op.add(Builder::executedSearchesTotal, JsonpDeserializer.longDeserializer(), "executed_searches_total"); + op.add(Builder::nodeId, JsonpDeserializer.stringDeserializer(), "node_id"); + op.add(Builder::queueSize, JsonpDeserializer.integerDeserializer(), "queue_size"); + op.add(Builder::remoteRequestsCurrent, JsonpDeserializer.integerDeserializer(), "remote_requests_current"); + op.add(Builder::remoteRequestsTotal, JsonpDeserializer.longDeserializer(), "remote_requests_total"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/ExecutingPolicy.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/ExecutingPolicy.java new file mode 100644 index 000000000..ac82532de --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/enrich/stats/ExecutingPolicy.java @@ -0,0 +1,174 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.enrich.stats; + +import co.elastic.clients.elasticsearch.tasks.TaskInfo; +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; + +// typedef: enrich.stats.ExecutingPolicy + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ExecutingPolicy implements JsonpSerializable { + private final String name; + + private final TaskInfo task; + + // --------------------------------------------------------------------------------------------- + + private ExecutingPolicy(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.task = ApiTypeHelper.requireNonNull(builder.task, this, "task"); + + } + + public static ExecutingPolicy 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 task} + */ + public final TaskInfo task() { + return this.task; + } + + /** + * 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("task"); + this.task.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ExecutingPolicy}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String name; + + private TaskInfo task; + + /** + * Required - API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Required - API name: {@code task} + */ + public final Builder task(TaskInfo value) { + this.task = value; + return this; + } + + /** + * Required - API name: {@code task} + */ + public final Builder task(Function> fn) { + return this.task(fn.apply(new TaskInfo.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ExecutingPolicy}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ExecutingPolicy build() { + _checkSingleUse(); + + return new ExecutingPolicy(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ExecutingPolicy} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + ExecutingPolicy::setupExecutingPolicyDeserializer); + + protected static void setupExecutingPolicyDeserializer(ObjectDeserializer op) { + + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::task, TaskInfo._DESERIALIZER, "task"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Connection.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Connection.java new file mode 100644 index 000000000..057ba01ac --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Connection.java @@ -0,0 +1,214 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.graph; + +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.Double; +import java.lang.Long; +import java.util.Objects; +import java.util.function.Function; + +// typedef: graph._types.Connection + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Connection implements JsonpSerializable { + private final long docCount; + + private final long source; + + private final long target; + + private final double weight; + + // --------------------------------------------------------------------------------------------- + + private Connection(Builder builder) { + + this.docCount = ApiTypeHelper.requireNonNull(builder.docCount, this, "docCount"); + this.source = ApiTypeHelper.requireNonNull(builder.source, this, "source"); + this.target = ApiTypeHelper.requireNonNull(builder.target, this, "target"); + this.weight = ApiTypeHelper.requireNonNull(builder.weight, this, "weight"); + + } + + public static Connection of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code doc_count} + */ + public final long docCount() { + return this.docCount; + } + + /** + * Required - API name: {@code source} + */ + public final long source() { + return this.source; + } + + /** + * Required - API name: {@code target} + */ + public final long target() { + return this.target; + } + + /** + * Required - API name: {@code weight} + */ + public final double weight() { + return this.weight; + } + + /** + * 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("doc_count"); + generator.write(this.docCount); + + generator.writeKey("source"); + generator.write(this.source); + + generator.writeKey("target"); + generator.write(this.target); + + generator.writeKey("weight"); + generator.write(this.weight); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Connection}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Long docCount; + + private Long source; + + private Long target; + + private Double weight; + + /** + * Required - API name: {@code doc_count} + */ + public final Builder docCount(long value) { + this.docCount = value; + return this; + } + + /** + * Required - API name: {@code source} + */ + public final Builder source(long value) { + this.source = value; + return this; + } + + /** + * Required - API name: {@code target} + */ + public final Builder target(long value) { + this.target = value; + return this; + } + + /** + * Required - API name: {@code weight} + */ + public final Builder weight(double value) { + this.weight = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link Connection}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public Connection build() { + _checkSingleUse(); + + return new Connection(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Connection} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Connection::setupConnectionDeserializer); + + protected static void setupConnectionDeserializer(ObjectDeserializer op) { + + op.add(Builder::docCount, JsonpDeserializer.longDeserializer(), "doc_count"); + op.add(Builder::source, JsonpDeserializer.longDeserializer(), "source"); + op.add(Builder::target, JsonpDeserializer.longDeserializer(), "target"); + op.add(Builder::weight, JsonpDeserializer.doubleDeserializer(), "weight"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphAsyncClient.java new file mode 100644 index 000000000..a3b50e33a --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphAsyncClient.java @@ -0,0 +1,92 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.graph; + +import co.elastic.clients.ApiClient; +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.transport.ElasticsearchTransport; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.JsonEndpoint; +import co.elastic.clients.transport.Transport; +import co.elastic.clients.transport.TransportOptions; +import co.elastic.clients.util.ObjectBuilder; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import javax.annotation.Nullable; + +/** + * Client for the graph namespace. + */ +public class ElasticsearchGraphAsyncClient extends ApiClient { + + public ElasticsearchGraphAsyncClient(ElasticsearchTransport transport) { + super(transport, null); + } + + public ElasticsearchGraphAsyncClient(ElasticsearchTransport transport, + @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + @Override + public ElasticsearchGraphAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) { + return new ElasticsearchGraphAsyncClient(this.transport, transportOptions); + } + + // ----- Endpoint: graph.explore + + /** + * Explore extracted and summarized information about the documents and terms in + * an index. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture explore(ExploreRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ExploreRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Explore extracted and summarized information about the documents and terms in + * an index. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExploreRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture explore( + Function> fn) { + return explore(fn.apply(new ExploreRequest.Builder()).build()); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphClient.java new file mode 100644 index 000000000..3fec3e6d2 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ElasticsearchGraphClient.java @@ -0,0 +1,92 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.graph; + +import co.elastic.clients.ApiClient; +import co.elastic.clients.elasticsearch._types.ElasticsearchException; +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.transport.ElasticsearchTransport; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.JsonEndpoint; +import co.elastic.clients.transport.Transport; +import co.elastic.clients.transport.TransportOptions; +import co.elastic.clients.util.ObjectBuilder; +import java.io.IOException; +import java.util.function.Function; +import javax.annotation.Nullable; + +/** + * Client for the graph namespace. + */ +public class ElasticsearchGraphClient extends ApiClient { + + public ElasticsearchGraphClient(ElasticsearchTransport transport) { + super(transport, null); + } + + public ElasticsearchGraphClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + @Override + public ElasticsearchGraphClient withTransportOptions(@Nullable TransportOptions transportOptions) { + return new ElasticsearchGraphClient(this.transport, transportOptions); + } + + // ----- Endpoint: graph.explore + + /** + * Explore extracted and summarized information about the documents and terms in + * an index. + * + * @see Documentation + * on elastic.co + */ + + public ExploreResponse explore(ExploreRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ExploreRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Explore extracted and summarized information about the documents and terms in + * an index. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExploreRequest} + * @see Documentation + * on elastic.co + */ + + public final ExploreResponse explore(Function> fn) + throws IOException, ElasticsearchException { + return explore(fn.apply(new ExploreRequest.Builder()).build()); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreControls.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreControls.java new file mode 100644 index 000000000..771eae23b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreControls.java @@ -0,0 +1,295 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.graph; + +import co.elastic.clients.elasticsearch._types.Time; +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.Boolean; +import java.lang.Integer; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: graph._types.ExploreControls + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ExploreControls implements JsonpSerializable { + @Nullable + private final SampleDiversity sampleDiversity; + + @Nullable + private final Integer sampleSize; + + @Nullable + private final Time timeout; + + private final boolean useSignificance; + + // --------------------------------------------------------------------------------------------- + + private ExploreControls(Builder builder) { + + this.sampleDiversity = builder.sampleDiversity; + this.sampleSize = builder.sampleSize; + this.timeout = builder.timeout; + this.useSignificance = ApiTypeHelper.requireNonNull(builder.useSignificance, this, "useSignificance"); + + } + + public static ExploreControls of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * To avoid the top-matching documents sample being dominated by a single source + * of results, it is sometimes necessary to request diversity in the sample. You + * can do this by selecting a single-value field and setting a maximum number of + * documents per value for that field. + *

+ * API name: {@code sample_diversity} + */ + @Nullable + public final SampleDiversity sampleDiversity() { + return this.sampleDiversity; + } + + /** + * Each hop considers a sample of the best-matching documents on each shard. + * Using samples improves the speed of execution and keeps exploration focused + * on meaningfully-connected terms. Very small values (less than 50) might not + * provide sufficient weight-of-evidence to identify significant connections + * between terms. Very large sample sizes can dilute the quality of the results + * and increase execution times. + *

+ * API name: {@code sample_size} + */ + @Nullable + public final Integer sampleSize() { + return this.sampleSize; + } + + /** + * The length of time in milliseconds after which exploration will be halted and + * the results gathered so far are returned. This timeout is honored on a + * best-effort basis. Execution might overrun this timeout if, for example, a + * long pause is encountered while FieldData is loaded for a field. + *

+ * API name: {@code timeout} + */ + @Nullable + public final Time timeout() { + return this.timeout; + } + + /** + * Required - Filters associated terms so only those that are significantly + * associated with your query are included. + *

+ * API name: {@code use_significance} + */ + public final boolean useSignificance() { + return this.useSignificance; + } + + /** + * 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 (this.sampleDiversity != null) { + generator.writeKey("sample_diversity"); + this.sampleDiversity.serialize(generator, mapper); + + } + if (this.sampleSize != null) { + generator.writeKey("sample_size"); + generator.write(this.sampleSize); + + } + if (this.timeout != null) { + generator.writeKey("timeout"); + this.timeout.serialize(generator, mapper); + + } + generator.writeKey("use_significance"); + generator.write(this.useSignificance); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ExploreControls}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private SampleDiversity sampleDiversity; + + @Nullable + private Integer sampleSize; + + @Nullable + private Time timeout; + + private Boolean useSignificance; + + /** + * To avoid the top-matching documents sample being dominated by a single source + * of results, it is sometimes necessary to request diversity in the sample. You + * can do this by selecting a single-value field and setting a maximum number of + * documents per value for that field. + *

+ * API name: {@code sample_diversity} + */ + public final Builder sampleDiversity(@Nullable SampleDiversity value) { + this.sampleDiversity = value; + return this; + } + + /** + * To avoid the top-matching documents sample being dominated by a single source + * of results, it is sometimes necessary to request diversity in the sample. You + * can do this by selecting a single-value field and setting a maximum number of + * documents per value for that field. + *

+ * API name: {@code sample_diversity} + */ + public final Builder sampleDiversity(Function> fn) { + return this.sampleDiversity(fn.apply(new SampleDiversity.Builder()).build()); + } + + /** + * Each hop considers a sample of the best-matching documents on each shard. + * Using samples improves the speed of execution and keeps exploration focused + * on meaningfully-connected terms. Very small values (less than 50) might not + * provide sufficient weight-of-evidence to identify significant connections + * between terms. Very large sample sizes can dilute the quality of the results + * and increase execution times. + *

+ * API name: {@code sample_size} + */ + public final Builder sampleSize(@Nullable Integer value) { + this.sampleSize = value; + return this; + } + + /** + * The length of time in milliseconds after which exploration will be halted and + * the results gathered so far are returned. This timeout is honored on a + * best-effort basis. Execution might overrun this timeout if, for example, a + * long pause is encountered while FieldData is loaded for a field. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(@Nullable Time value) { + this.timeout = value; + return this; + } + + /** + * The length of time in milliseconds after which exploration will be halted and + * the results gathered so far are returned. This timeout is honored on a + * best-effort basis. Execution might overrun this timeout if, for example, a + * long pause is encountered while FieldData is loaded for a field. + *

+ * API name: {@code timeout} + */ + public final Builder timeout(Function> fn) { + return this.timeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Required - Filters associated terms so only those that are significantly + * associated with your query are included. + *

+ * API name: {@code use_significance} + */ + public final Builder useSignificance(boolean value) { + this.useSignificance = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ExploreControls}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ExploreControls build() { + _checkSingleUse(); + + return new ExploreControls(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ExploreControls} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + ExploreControls::setupExploreControlsDeserializer); + + protected static void setupExploreControlsDeserializer(ObjectDeserializer op) { + + op.add(Builder::sampleDiversity, SampleDiversity._DESERIALIZER, "sample_diversity"); + op.add(Builder::sampleSize, JsonpDeserializer.integerDeserializer(), "sample_size"); + op.add(Builder::timeout, Time._DESERIALIZER, "timeout"); + op.add(Builder::useSignificance, JsonpDeserializer.booleanDeserializer(), "use_significance"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreRequest.java new file mode 100644 index 000000000..cfb0047d6 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreRequest.java @@ -0,0 +1,489 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.graph; + +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.elasticsearch._types.query_dsl.Query; +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.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; + +// typedef: graph.explore.Request + +/** + * Extracts and summarizes information about the documents and terms in an + * Elasticsearch data stream or index. + * + * @see API + * specification + */ +@JsonpDeserializable +public class ExploreRequest extends RequestBase implements JsonpSerializable { + @Nullable + private final Hop connections; + + @Nullable + private final ExploreControls controls; + + private final List index; + + @Nullable + private final Query query; + + @Nullable + private final String routing; + + @Nullable + private final Time timeout; + + private final List vertices; + + // --------------------------------------------------------------------------------------------- + + private ExploreRequest(Builder builder) { + + this.connections = builder.connections; + this.controls = builder.controls; + this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); + this.query = builder.query; + this.routing = builder.routing; + this.timeout = builder.timeout; + this.vertices = ApiTypeHelper.unmodifiable(builder.vertices); + + } + + public static ExploreRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Specifies or more fields from which you want to extract terms that are + * associated with the specified vertices. + *

+ * API name: {@code connections} + */ + @Nullable + public final Hop connections() { + return this.connections; + } + + /** + * Direct the Graph API how to build the graph. + *

+ * API name: {@code controls} + */ + @Nullable + public final ExploreControls controls() { + return this.controls; + } + + /** + * Required - Name of the index. + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * A seed query that identifies the documents of interest. Can be any valid + * Elasticsearch query. + *

+ * API name: {@code query} + */ + @Nullable + public final Query query() { + return this.query; + } + + /** + * Custom value used to route operations to a specific shard. + *

+ * API name: {@code routing} + */ + @Nullable + public final String routing() { + return this.routing; + } + + /** + * Specifies the period of time to wait for a response from each shard. If no + * response is received before the timeout expires, the request fails and + * returns an error. Defaults to no timeout. + *

+ * API name: {@code timeout} + */ + @Nullable + public final Time timeout() { + return this.timeout; + } + + /** + * Specifies one or more fields that contain the terms you want to include in + * the graph as vertices. + *

+ * API name: {@code vertices} + */ + public final List vertices() { + return this.vertices; + } + + /** + * 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 (this.connections != null) { + generator.writeKey("connections"); + this.connections.serialize(generator, mapper); + + } + if (this.controls != null) { + generator.writeKey("controls"); + this.controls.serialize(generator, mapper); + + } + if (this.query != null) { + generator.writeKey("query"); + this.query.serialize(generator, mapper); + + } + if (ApiTypeHelper.isDefined(this.vertices)) { + generator.writeKey("vertices"); + generator.writeStartArray(); + for (VertexDefinition item0 : this.vertices) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ExploreRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private Hop connections; + + @Nullable + private ExploreControls controls; + + private List index; + + @Nullable + private Query query; + + @Nullable + private String routing; + + @Nullable + private Time timeout; + + @Nullable + private List vertices; + + /** + * Specifies or more fields from which you want to extract terms that are + * associated with the specified vertices. + *

+ * API name: {@code connections} + */ + public final Builder connections(@Nullable Hop value) { + this.connections = value; + return this; + } + + /** + * Specifies or more fields from which you want to extract terms that are + * associated with the specified vertices. + *

+ * API name: {@code connections} + */ + public final Builder connections(Function> fn) { + return this.connections(fn.apply(new Hop.Builder()).build()); + } + + /** + * Direct the Graph API how to build the graph. + *

+ * API name: {@code controls} + */ + public final Builder controls(@Nullable ExploreControls value) { + this.controls = value; + return this; + } + + /** + * Direct the Graph API how to build the graph. + *

+ * API name: {@code controls} + */ + public final Builder controls(Function> fn) { + return this.controls(fn.apply(new ExploreControls.Builder()).build()); + } + + /** + * Required - Name of the index. + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Required - Name of the index. + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); + return this; + } + + /** + * A seed query that identifies the documents of interest. Can be any valid + * Elasticsearch query. + *

+ * API name: {@code query} + */ + public final Builder query(@Nullable Query value) { + this.query = value; + return this; + } + + /** + * A seed query that identifies the documents of interest. Can be any valid + * Elasticsearch query. + *

+ * API name: {@code query} + */ + public final Builder query(Function> fn) { + return this.query(fn.apply(new Query.Builder()).build()); + } + + /** + * Custom value used to route operations to a specific shard. + *

+ * API name: {@code routing} + */ + public final Builder routing(@Nullable String value) { + this.routing = value; + return this; + } + + /** + * Specifies the period of time to wait for a response from each shard. If no + * response is received before the timeout expires, the request fails and + * returns an error. Defaults to no timeout. + *

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

+ * API name: {@code timeout} + */ + public final Builder timeout(Function> fn) { + return this.timeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Specifies one or more fields that contain the terms you want to include in + * the graph as vertices. + *

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

+ * Adds all elements of list to vertices. + */ + public final Builder vertices(List list) { + this.vertices = _listAddAll(this.vertices, list); + return this; + } + + /** + * Specifies one or more fields that contain the terms you want to include in + * the graph as vertices. + *

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

+ * Adds one or more values to vertices. + */ + public final Builder vertices(VertexDefinition value, VertexDefinition... values) { + this.vertices = _listAdd(this.vertices, value, values); + return this; + } + + /** + * Specifies one or more fields that contain the terms you want to include in + * the graph as vertices. + *

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

+ * Adds a value to vertices using a builder lambda. + */ + public final Builder vertices(Function> fn) { + return vertices(fn.apply(new VertexDefinition.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ExploreRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ExploreRequest build() { + _checkSingleUse(); + + return new ExploreRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ExploreRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + ExploreRequest::setupExploreRequestDeserializer); + + protected static void setupExploreRequestDeserializer(ObjectDeserializer op) { + + op.add(Builder::connections, Hop._DESERIALIZER, "connections"); + op.add(Builder::controls, ExploreControls._DESERIALIZER, "controls"); + op.add(Builder::query, Query._DESERIALIZER, "query"); + op.add(Builder::vertices, JsonpDeserializer.arrayDeserializer(VertexDefinition._DESERIALIZER), "vertices"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code graph.explore}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/graph.explore", + + // Request method + request -> { + return "POST"; + + }, + + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_graph"); + buf.append("/explore"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.routing != null) { + params.put("routing", request.routing); + } + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), true, ExploreResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreResponse.java new file mode 100644 index 000000000..1c6e18253 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/ExploreResponse.java @@ -0,0 +1,326 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.graph; + +import co.elastic.clients.elasticsearch._types.ShardFailure; +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.Boolean; +import java.lang.Long; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: graph.explore.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ExploreResponse implements JsonpSerializable { + private final List connections; + + private final List failures; + + private final boolean timedOut; + + private final long took; + + private final List vertices; + + // --------------------------------------------------------------------------------------------- + + private ExploreResponse(Builder builder) { + + this.connections = ApiTypeHelper.unmodifiableRequired(builder.connections, this, "connections"); + this.failures = ApiTypeHelper.unmodifiableRequired(builder.failures, this, "failures"); + this.timedOut = ApiTypeHelper.requireNonNull(builder.timedOut, this, "timedOut"); + this.took = ApiTypeHelper.requireNonNull(builder.took, this, "took"); + this.vertices = ApiTypeHelper.unmodifiableRequired(builder.vertices, this, "vertices"); + + } + + public static ExploreResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code connections} + */ + public final List connections() { + return this.connections; + } + + /** + * Required - API name: {@code failures} + */ + public final List failures() { + return this.failures; + } + + /** + * Required - API name: {@code timed_out} + */ + public final boolean timedOut() { + return this.timedOut; + } + + /** + * Required - API name: {@code took} + */ + public final long took() { + return this.took; + } + + /** + * Required - API name: {@code vertices} + */ + public final List vertices() { + return this.vertices; + } + + /** + * 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.connections)) { + generator.writeKey("connections"); + generator.writeStartArray(); + for (Connection item0 : this.connections) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.failures)) { + generator.writeKey("failures"); + generator.writeStartArray(); + for (ShardFailure item0 : this.failures) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + generator.writeKey("timed_out"); + generator.write(this.timedOut); + + generator.writeKey("took"); + generator.write(this.took); + + if (ApiTypeHelper.isDefined(this.vertices)) { + generator.writeKey("vertices"); + generator.writeStartArray(); + for (Vertex item0 : this.vertices) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ExploreResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private List connections; + + private List failures; + + private Boolean timedOut; + + private Long took; + + private List vertices; + + /** + * Required - API name: {@code connections} + *

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

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

+ * Adds a value to connections using a builder lambda. + */ + public final Builder connections(Function> fn) { + return connections(fn.apply(new Connection.Builder()).build()); + } + + /** + * Required - API name: {@code failures} + *

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

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

+ * Adds a value to failures using a builder lambda. + */ + public final Builder failures(Function> fn) { + return failures(fn.apply(new ShardFailure.Builder()).build()); + } + + /** + * Required - API name: {@code timed_out} + */ + public final Builder timedOut(boolean value) { + this.timedOut = value; + return this; + } + + /** + * Required - API name: {@code took} + */ + public final Builder took(long value) { + this.took = value; + return this; + } + + /** + * Required - API name: {@code vertices} + *

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

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

+ * Adds a value to vertices using a builder lambda. + */ + public final Builder vertices(Function> fn) { + return vertices(fn.apply(new Vertex.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ExploreResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ExploreResponse build() { + _checkSingleUse(); + + return new ExploreResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ExploreResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + ExploreResponse::setupExploreResponseDeserializer); + + protected static void setupExploreResponseDeserializer(ObjectDeserializer op) { + + op.add(Builder::connections, JsonpDeserializer.arrayDeserializer(Connection._DESERIALIZER), "connections"); + op.add(Builder::failures, JsonpDeserializer.arrayDeserializer(ShardFailure._DESERIALIZER), "failures"); + op.add(Builder::timedOut, JsonpDeserializer.booleanDeserializer(), "timed_out"); + op.add(Builder::took, JsonpDeserializer.longDeserializer(), "took"); + op.add(Builder::vertices, JsonpDeserializer.arrayDeserializer(Vertex._DESERIALIZER), "vertices"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Hop.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Hop.java new file mode 100644 index 000000000..8bd2128df --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Hop.java @@ -0,0 +1,265 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.graph; + +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +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; + +// typedef: graph._types.Hop + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Hop implements JsonpSerializable { + @Nullable + private final Hop connections; + + private final Query query; + + private final List vertices; + + // --------------------------------------------------------------------------------------------- + + private Hop(Builder builder) { + + this.connections = builder.connections; + this.query = ApiTypeHelper.requireNonNull(builder.query, this, "query"); + this.vertices = ApiTypeHelper.unmodifiableRequired(builder.vertices, this, "vertices"); + + } + + public static Hop of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Specifies one or more fields from which you want to extract terms that are + * associated with the specified vertices. + *

+ * API name: {@code connections} + */ + @Nullable + public final Hop connections() { + return this.connections; + } + + /** + * Required - An optional guiding query that constrains the Graph API as it + * explores connected terms. + *

+ * API name: {@code query} + */ + public final Query query() { + return this.query; + } + + /** + * Required - Contains the fields you are interested in. + *

+ * API name: {@code vertices} + */ + public final List vertices() { + return this.vertices; + } + + /** + * 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 (this.connections != null) { + generator.writeKey("connections"); + this.connections.serialize(generator, mapper); + + } + generator.writeKey("query"); + this.query.serialize(generator, mapper); + + if (ApiTypeHelper.isDefined(this.vertices)) { + generator.writeKey("vertices"); + generator.writeStartArray(); + for (VertexDefinition item0 : this.vertices) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Hop}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Hop connections; + + private Query query; + + private List vertices; + + /** + * Specifies one or more fields from which you want to extract terms that are + * associated with the specified vertices. + *

+ * API name: {@code connections} + */ + public final Builder connections(@Nullable Hop value) { + this.connections = value; + return this; + } + + /** + * Specifies one or more fields from which you want to extract terms that are + * associated with the specified vertices. + *

+ * API name: {@code connections} + */ + public final Builder connections(Function> fn) { + return this.connections(fn.apply(new Hop.Builder()).build()); + } + + /** + * Required - An optional guiding query that constrains the Graph API as it + * explores connected terms. + *

+ * API name: {@code query} + */ + public final Builder query(Query value) { + this.query = value; + return this; + } + + /** + * Required - An optional guiding query that constrains the Graph API as it + * explores connected terms. + *

+ * API name: {@code query} + */ + public final Builder query(Function> fn) { + return this.query(fn.apply(new Query.Builder()).build()); + } + + /** + * Required - Contains the fields you are interested in. + *

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

+ * Adds all elements of list to vertices. + */ + public final Builder vertices(List list) { + this.vertices = _listAddAll(this.vertices, list); + return this; + } + + /** + * Required - Contains the fields you are interested in. + *

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

+ * Adds one or more values to vertices. + */ + public final Builder vertices(VertexDefinition value, VertexDefinition... values) { + this.vertices = _listAdd(this.vertices, value, values); + return this; + } + + /** + * Required - Contains the fields you are interested in. + *

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

+ * Adds a value to vertices using a builder lambda. + */ + public final Builder vertices(Function> fn) { + return vertices(fn.apply(new VertexDefinition.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link Hop}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public Hop build() { + _checkSingleUse(); + + return new Hop(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Hop} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Hop::setupHopDeserializer); + + protected static void setupHopDeserializer(ObjectDeserializer op) { + + op.add(Builder::connections, Hop._DESERIALIZER, "connections"); + op.add(Builder::query, Query._DESERIALIZER, "query"); + op.add(Builder::vertices, JsonpDeserializer.arrayDeserializer(VertexDefinition._DESERIALIZER), "vertices"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/SampleDiversity.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/SampleDiversity.java new file mode 100644 index 000000000..0cc1cbe7d --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/SampleDiversity.java @@ -0,0 +1,167 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.graph; + +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.Integer; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: graph._types.SampleDiversity + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SampleDiversity implements JsonpSerializable { + private final String field; + + private final int maxDocsPerValue; + + // --------------------------------------------------------------------------------------------- + + private SampleDiversity(Builder builder) { + + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); + this.maxDocsPerValue = ApiTypeHelper.requireNonNull(builder.maxDocsPerValue, this, "maxDocsPerValue"); + + } + + public static SampleDiversity of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code field} + */ + public final String field() { + return this.field; + } + + /** + * Required - API name: {@code max_docs_per_value} + */ + public final int maxDocsPerValue() { + return this.maxDocsPerValue; + } + + /** + * 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("field"); + generator.write(this.field); + + generator.writeKey("max_docs_per_value"); + generator.write(this.maxDocsPerValue); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SampleDiversity}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String field; + + private Integer maxDocsPerValue; + + /** + * Required - API name: {@code field} + */ + public final Builder field(String value) { + this.field = value; + return this; + } + + /** + * Required - API name: {@code max_docs_per_value} + */ + public final Builder maxDocsPerValue(int value) { + this.maxDocsPerValue = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SampleDiversity}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SampleDiversity build() { + _checkSingleUse(); + + return new SampleDiversity(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SampleDiversity} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + SampleDiversity::setupSampleDiversityDeserializer); + + protected static void setupSampleDiversityDeserializer(ObjectDeserializer op) { + + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); + op.add(Builder::maxDocsPerValue, JsonpDeserializer.integerDeserializer(), "max_docs_per_value"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Vertex.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Vertex.java new file mode 100644 index 000000000..d1a50125f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/Vertex.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.graph; + +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.Double; +import java.lang.Long; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: graph._types.Vertex + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Vertex implements JsonpSerializable { + private final long depth; + + private final String field; + + private final String term; + + private final double weight; + + // --------------------------------------------------------------------------------------------- + + private Vertex(Builder builder) { + + this.depth = ApiTypeHelper.requireNonNull(builder.depth, this, "depth"); + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); + this.term = ApiTypeHelper.requireNonNull(builder.term, this, "term"); + this.weight = ApiTypeHelper.requireNonNull(builder.weight, this, "weight"); + + } + + public static Vertex of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code depth} + */ + public final long depth() { + return this.depth; + } + + /** + * Required - API name: {@code field} + */ + public final String field() { + return this.field; + } + + /** + * Required - API name: {@code term} + */ + public final String term() { + return this.term; + } + + /** + * Required - API name: {@code weight} + */ + public final double weight() { + return this.weight; + } + + /** + * 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("depth"); + generator.write(this.depth); + + generator.writeKey("field"); + generator.write(this.field); + + generator.writeKey("term"); + generator.write(this.term); + + generator.writeKey("weight"); + generator.write(this.weight); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Vertex}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Long depth; + + private String field; + + private String term; + + private Double weight; + + /** + * Required - API name: {@code depth} + */ + public final Builder depth(long value) { + this.depth = value; + return this; + } + + /** + * Required - API name: {@code field} + */ + public final Builder field(String value) { + this.field = value; + return this; + } + + /** + * Required - API name: {@code term} + */ + public final Builder term(String value) { + this.term = value; + return this; + } + + /** + * Required - API name: {@code weight} + */ + public final Builder weight(double value) { + this.weight = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link Vertex}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public Vertex build() { + _checkSingleUse(); + + return new Vertex(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Vertex} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Vertex::setupVertexDeserializer); + + protected static void setupVertexDeserializer(ObjectDeserializer op) { + + op.add(Builder::depth, JsonpDeserializer.longDeserializer(), "depth"); + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); + op.add(Builder::term, JsonpDeserializer.stringDeserializer(), "term"); + op.add(Builder::weight, JsonpDeserializer.doubleDeserializer(), "weight"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/VertexDefinition.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/VertexDefinition.java new file mode 100644 index 000000000..ccc9ac717 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/VertexDefinition.java @@ -0,0 +1,371 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.graph; + +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.Integer; +import java.lang.Long; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: graph._types.VertexDefinition + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class VertexDefinition implements JsonpSerializable { + private final List exclude; + + private final String field; + + private final List include; + + @Nullable + private final Long minDocCount; + + @Nullable + private final Long shardMinDocCount; + + @Nullable + private final Integer size; + + // --------------------------------------------------------------------------------------------- + + private VertexDefinition(Builder builder) { + + this.exclude = ApiTypeHelper.unmodifiable(builder.exclude); + this.field = ApiTypeHelper.requireNonNull(builder.field, this, "field"); + this.include = ApiTypeHelper.unmodifiable(builder.include); + this.minDocCount = builder.minDocCount; + this.shardMinDocCount = builder.shardMinDocCount; + this.size = builder.size; + + } + + public static VertexDefinition of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Prevents the specified terms from being included in the results. + *

+ * API name: {@code exclude} + */ + public final List exclude() { + return this.exclude; + } + + /** + * Required - Identifies a field in the documents of interest. + *

+ * API name: {@code field} + */ + public final String field() { + return this.field; + } + + /** + * Identifies the terms of interest that form the starting points from which you + * want to spider out. + *

+ * API name: {@code include} + */ + public final List include() { + return this.include; + } + + /** + * Specifies how many documents must contain a pair of terms before it is + * considered to be a useful connection. This setting acts as a certainty + * threshold. + *

+ * API name: {@code min_doc_count} + */ + @Nullable + public final Long minDocCount() { + return this.minDocCount; + } + + /** + * Controls how many documents on a particular shard have to contain a pair of + * terms before the connection is returned for global consideration. + *

+ * API name: {@code shard_min_doc_count} + */ + @Nullable + public final Long shardMinDocCount() { + return this.shardMinDocCount; + } + + /** + * Specifies the maximum number of vertex terms returned for each field. + *

+ * API name: {@code size} + */ + @Nullable + public final Integer size() { + return this.size; + } + + /** + * 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.exclude)) { + generator.writeKey("exclude"); + generator.writeStartArray(); + for (String item0 : this.exclude) { + generator.write(item0); + + } + generator.writeEnd(); + + } + generator.writeKey("field"); + generator.write(this.field); + + if (ApiTypeHelper.isDefined(this.include)) { + generator.writeKey("include"); + generator.writeStartArray(); + for (VertexInclude item0 : this.include) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.minDocCount != null) { + generator.writeKey("min_doc_count"); + generator.write(this.minDocCount); + + } + if (this.shardMinDocCount != null) { + generator.writeKey("shard_min_doc_count"); + generator.write(this.shardMinDocCount); + + } + if (this.size != null) { + generator.writeKey("size"); + generator.write(this.size); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link VertexDefinition}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List exclude; + + private String field; + + @Nullable + private List include; + + @Nullable + private Long minDocCount; + + @Nullable + private Long shardMinDocCount; + + @Nullable + private Integer size; + + /** + * Prevents the specified terms from being included in the results. + *

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

+ * Adds all elements of list to exclude. + */ + public final Builder exclude(List list) { + this.exclude = _listAddAll(this.exclude, list); + return this; + } + + /** + * Prevents the specified terms from being included in the results. + *

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

+ * Adds one or more values to exclude. + */ + public final Builder exclude(String value, String... values) { + this.exclude = _listAdd(this.exclude, value, values); + return this; + } + + /** + * Required - Identifies a field in the documents of interest. + *

+ * API name: {@code field} + */ + public final Builder field(String value) { + this.field = value; + return this; + } + + /** + * Identifies the terms of interest that form the starting points from which you + * want to spider out. + *

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

+ * Adds all elements of list to include. + */ + public final Builder include(List list) { + this.include = _listAddAll(this.include, list); + return this; + } + + /** + * Identifies the terms of interest that form the starting points from which you + * want to spider out. + *

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

+ * Adds one or more values to include. + */ + public final Builder include(VertexInclude value, VertexInclude... values) { + this.include = _listAdd(this.include, value, values); + return this; + } + + /** + * Identifies the terms of interest that form the starting points from which you + * want to spider out. + *

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

+ * Adds a value to include using a builder lambda. + */ + public final Builder include(Function> fn) { + return include(fn.apply(new VertexInclude.Builder()).build()); + } + + /** + * Specifies how many documents must contain a pair of terms before it is + * considered to be a useful connection. This setting acts as a certainty + * threshold. + *

+ * API name: {@code min_doc_count} + */ + public final Builder minDocCount(@Nullable Long value) { + this.minDocCount = value; + return this; + } + + /** + * Controls how many documents on a particular shard have to contain a pair of + * terms before the connection is returned for global consideration. + *

+ * API name: {@code shard_min_doc_count} + */ + public final Builder shardMinDocCount(@Nullable Long value) { + this.shardMinDocCount = value; + return this; + } + + /** + * Specifies the maximum number of vertex terms returned for each field. + *

+ * API name: {@code size} + */ + public final Builder size(@Nullable Integer value) { + this.size = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link VertexDefinition}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public VertexDefinition build() { + _checkSingleUse(); + + return new VertexDefinition(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link VertexDefinition} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + VertexDefinition::setupVertexDefinitionDeserializer); + + protected static void setupVertexDefinitionDeserializer(ObjectDeserializer op) { + + op.add(Builder::exclude, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "exclude"); + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); + op.add(Builder::include, JsonpDeserializer.arrayDeserializer(VertexInclude._DESERIALIZER), "include"); + op.add(Builder::minDocCount, JsonpDeserializer.longDeserializer(), "min_doc_count"); + op.add(Builder::shardMinDocCount, JsonpDeserializer.longDeserializer(), "shard_min_doc_count"); + op.add(Builder::size, JsonpDeserializer.integerDeserializer(), "size"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/VertexInclude.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/VertexInclude.java new file mode 100644 index 000000000..4437ef96f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/graph/VertexInclude.java @@ -0,0 +1,167 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.graph; + +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.Double; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: graph._types.VertexInclude + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class VertexInclude implements JsonpSerializable { + private final double boost; + + private final String term; + + // --------------------------------------------------------------------------------------------- + + private VertexInclude(Builder builder) { + + this.boost = ApiTypeHelper.requireNonNull(builder.boost, this, "boost"); + this.term = ApiTypeHelper.requireNonNull(builder.term, this, "term"); + + } + + public static VertexInclude of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code boost} + */ + public final double boost() { + return this.boost; + } + + /** + * Required - API name: {@code term} + */ + public final String term() { + return this.term; + } + + /** + * 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("boost"); + generator.write(this.boost); + + generator.writeKey("term"); + generator.write(this.term); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link VertexInclude}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Double boost; + + private String term; + + /** + * Required - API name: {@code boost} + */ + public final Builder boost(double value) { + this.boost = value; + return this; + } + + /** + * Required - API name: {@code term} + */ + public final Builder term(String value) { + this.term = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link VertexInclude}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public VertexInclude build() { + _checkSingleUse(); + + return new VertexInclude(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link VertexInclude} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + VertexInclude::setupVertexIncludeDeserializer); + + protected static void setupVertexIncludeDeserializer(ObjectDeserializer op) { + + op.add(Builder::boost, JsonpDeserializer.doubleDeserializer(), "boost"); + op.add(Builder::term, JsonpDeserializer.stringDeserializer(), "term"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Alias.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Alias.java new file mode 100644 index 000000000..ea3cc1caf --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Alias.java @@ -0,0 +1,333 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.Alias + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Alias implements JsonpSerializable { + @Nullable + private final Query filter; + + @Nullable + private final String indexRouting; + + @Nullable + private final Boolean isHidden; + + @Nullable + private final Boolean isWriteIndex; + + @Nullable + private final String routing; + + @Nullable + private final String searchRouting; + + // --------------------------------------------------------------------------------------------- + + private Alias(Builder builder) { + + this.filter = builder.filter; + this.indexRouting = builder.indexRouting; + this.isHidden = builder.isHidden; + this.isWriteIndex = builder.isWriteIndex; + this.routing = builder.routing; + this.searchRouting = builder.searchRouting; + + } + + public static Alias of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Query used to limit documents the alias can access. + *

+ * API name: {@code filter} + */ + @Nullable + public final Query filter() { + return this.filter; + } + + /** + * Value used to route indexing operations to a specific shard. If specified, + * this overwrites the routing value for indexing operations. + *

+ * API name: {@code index_routing} + */ + @Nullable + public final String indexRouting() { + return this.indexRouting; + } + + /** + * If true, the alias is hidden. All indices for the alias must + * have the same is_hidden value. + *

+ * API name: {@code is_hidden} + */ + @Nullable + public final Boolean isHidden() { + return this.isHidden; + } + + /** + * If true, the index is the write index for the alias. + *

+ * API name: {@code is_write_index} + */ + @Nullable + public final Boolean isWriteIndex() { + return this.isWriteIndex; + } + + /** + * Value used to route indexing and search operations to a specific shard. + *

+ * API name: {@code routing} + */ + @Nullable + public final String routing() { + return this.routing; + } + + /** + * Value used to route search operations to a specific shard. If specified, this + * overwrites the routing value for search operations. + *

+ * API name: {@code search_routing} + */ + @Nullable + public final String searchRouting() { + return this.searchRouting; + } + + /** + * 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 (this.filter != null) { + generator.writeKey("filter"); + this.filter.serialize(generator, mapper); + + } + if (this.indexRouting != null) { + generator.writeKey("index_routing"); + generator.write(this.indexRouting); + + } + if (this.isHidden != null) { + generator.writeKey("is_hidden"); + generator.write(this.isHidden); + + } + if (this.isWriteIndex != null) { + generator.writeKey("is_write_index"); + generator.write(this.isWriteIndex); + + } + if (this.routing != null) { + generator.writeKey("routing"); + generator.write(this.routing); + + } + if (this.searchRouting != null) { + generator.writeKey("search_routing"); + generator.write(this.searchRouting); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Alias}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Query filter; + + @Nullable + private String indexRouting; + + @Nullable + private Boolean isHidden; + + @Nullable + private Boolean isWriteIndex; + + @Nullable + private String routing; + + @Nullable + private String searchRouting; + + /** + * Query used to limit documents the alias can access. + *

+ * API name: {@code filter} + */ + public final Builder filter(@Nullable Query value) { + this.filter = value; + return this; + } + + /** + * Query used to limit documents the alias can access. + *

+ * API name: {@code filter} + */ + public final Builder filter(Function> fn) { + return this.filter(fn.apply(new Query.Builder()).build()); + } + + /** + * Value used to route indexing operations to a specific shard. If specified, + * this overwrites the routing value for indexing operations. + *

+ * API name: {@code index_routing} + */ + public final Builder indexRouting(@Nullable String value) { + this.indexRouting = value; + return this; + } + + /** + * If true, the alias is hidden. All indices for the alias must + * have the same is_hidden value. + *

+ * API name: {@code is_hidden} + */ + public final Builder isHidden(@Nullable Boolean value) { + this.isHidden = value; + return this; + } + + /** + * If true, the index is the write index for the alias. + *

+ * API name: {@code is_write_index} + */ + public final Builder isWriteIndex(@Nullable Boolean value) { + this.isWriteIndex = value; + return this; + } + + /** + * Value used to route indexing and search operations to a specific shard. + *

+ * API name: {@code routing} + */ + public final Builder routing(@Nullable String value) { + this.routing = value; + return this; + } + + /** + * Value used to route search operations to a specific shard. If specified, this + * overwrites the routing value for search operations. + *

+ * API name: {@code search_routing} + */ + public final Builder searchRouting(@Nullable String value) { + this.searchRouting = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link Alias}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public Alias build() { + _checkSingleUse(); + + return new Alias(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Alias} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Alias::setupAliasDeserializer); + + protected static void setupAliasDeserializer(ObjectDeserializer op) { + + op.add(Builder::filter, Query._DESERIALIZER, "filter"); + op.add(Builder::indexRouting, JsonpDeserializer.stringDeserializer(), "index_routing"); + op.add(Builder::isHidden, JsonpDeserializer.booleanDeserializer(), "is_hidden"); + op.add(Builder::isWriteIndex, JsonpDeserializer.booleanDeserializer(), "is_write_index"); + op.add(Builder::routing, JsonpDeserializer.stringDeserializer(), "routing"); + op.add(Builder::searchRouting, JsonpDeserializer.stringDeserializer(), "search_routing"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AliasDefinition.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AliasDefinition.java new file mode 100644 index 000000000..619b808d8 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AliasDefinition.java @@ -0,0 +1,333 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.AliasDefinition + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class AliasDefinition implements JsonpSerializable { + @Nullable + private final Query filter; + + @Nullable + private final String indexRouting; + + @Nullable + private final Boolean isWriteIndex; + + @Nullable + private final String routing; + + @Nullable + private final String searchRouting; + + @Nullable + private final Boolean isHidden; + + // --------------------------------------------------------------------------------------------- + + private AliasDefinition(Builder builder) { + + this.filter = builder.filter; + this.indexRouting = builder.indexRouting; + this.isWriteIndex = builder.isWriteIndex; + this.routing = builder.routing; + this.searchRouting = builder.searchRouting; + this.isHidden = builder.isHidden; + + } + + public static AliasDefinition of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Query used to limit documents the alias can access. + *

+ * API name: {@code filter} + */ + @Nullable + public final Query filter() { + return this.filter; + } + + /** + * Value used to route indexing operations to a specific shard. If specified, + * this overwrites the routing value for indexing operations. + *

+ * API name: {@code index_routing} + */ + @Nullable + public final String indexRouting() { + return this.indexRouting; + } + + /** + * If true, the index is the write index for the alias. + *

+ * API name: {@code is_write_index} + */ + @Nullable + public final Boolean isWriteIndex() { + return this.isWriteIndex; + } + + /** + * Value used to route indexing and search operations to a specific shard. + *

+ * API name: {@code routing} + */ + @Nullable + public final String routing() { + return this.routing; + } + + /** + * Value used to route search operations to a specific shard. If specified, this + * overwrites the routing value for search operations. + *

+ * API name: {@code search_routing} + */ + @Nullable + public final String searchRouting() { + return this.searchRouting; + } + + /** + * If true, the alias is hidden. All indices for the alias must + * have the same is_hidden value. + *

+ * API name: {@code is_hidden} + */ + @Nullable + public final Boolean isHidden() { + return this.isHidden; + } + + /** + * 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 (this.filter != null) { + generator.writeKey("filter"); + this.filter.serialize(generator, mapper); + + } + if (this.indexRouting != null) { + generator.writeKey("index_routing"); + generator.write(this.indexRouting); + + } + if (this.isWriteIndex != null) { + generator.writeKey("is_write_index"); + generator.write(this.isWriteIndex); + + } + if (this.routing != null) { + generator.writeKey("routing"); + generator.write(this.routing); + + } + if (this.searchRouting != null) { + generator.writeKey("search_routing"); + generator.write(this.searchRouting); + + } + if (this.isHidden != null) { + generator.writeKey("is_hidden"); + generator.write(this.isHidden); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link AliasDefinition}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Query filter; + + @Nullable + private String indexRouting; + + @Nullable + private Boolean isWriteIndex; + + @Nullable + private String routing; + + @Nullable + private String searchRouting; + + @Nullable + private Boolean isHidden; + + /** + * Query used to limit documents the alias can access. + *

+ * API name: {@code filter} + */ + public final Builder filter(@Nullable Query value) { + this.filter = value; + return this; + } + + /** + * Query used to limit documents the alias can access. + *

+ * API name: {@code filter} + */ + public final Builder filter(Function> fn) { + return this.filter(fn.apply(new Query.Builder()).build()); + } + + /** + * Value used to route indexing operations to a specific shard. If specified, + * this overwrites the routing value for indexing operations. + *

+ * API name: {@code index_routing} + */ + public final Builder indexRouting(@Nullable String value) { + this.indexRouting = value; + return this; + } + + /** + * If true, the index is the write index for the alias. + *

+ * API name: {@code is_write_index} + */ + public final Builder isWriteIndex(@Nullable Boolean value) { + this.isWriteIndex = value; + return this; + } + + /** + * Value used to route indexing and search operations to a specific shard. + *

+ * API name: {@code routing} + */ + public final Builder routing(@Nullable String value) { + this.routing = value; + return this; + } + + /** + * Value used to route search operations to a specific shard. If specified, this + * overwrites the routing value for search operations. + *

+ * API name: {@code search_routing} + */ + public final Builder searchRouting(@Nullable String value) { + this.searchRouting = value; + return this; + } + + /** + * If true, the alias is hidden. All indices for the alias must + * have the same is_hidden value. + *

+ * API name: {@code is_hidden} + */ + public final Builder isHidden(@Nullable Boolean value) { + this.isHidden = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link AliasDefinition}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public AliasDefinition build() { + _checkSingleUse(); + + return new AliasDefinition(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link AliasDefinition} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + AliasDefinition::setupAliasDefinitionDeserializer); + + protected static void setupAliasDefinitionDeserializer(ObjectDeserializer op) { + + op.add(Builder::filter, Query._DESERIALIZER, "filter"); + op.add(Builder::indexRouting, JsonpDeserializer.stringDeserializer(), "index_routing"); + op.add(Builder::isWriteIndex, JsonpDeserializer.booleanDeserializer(), "is_write_index"); + op.add(Builder::routing, JsonpDeserializer.stringDeserializer(), "routing"); + op.add(Builder::searchRouting, JsonpDeserializer.stringDeserializer(), "search_routing"); + op.add(Builder::isHidden, JsonpDeserializer.booleanDeserializer(), "is_hidden"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AnalyzeRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AnalyzeRequest.java new file mode 100644 index 000000000..aadb9a1f7 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AnalyzeRequest.java @@ -0,0 +1,635 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch._types.analysis.CharFilter; +import co.elastic.clients.elasticsearch._types.analysis.TokenFilter; +import co.elastic.clients.elasticsearch._types.analysis.Tokenizer; +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.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.Boolean; +import java.lang.String; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.analyze.Request + +/** + * Performs analysis on a text string and returns the resulting tokens. + * + * @see API + * specification + */ +@JsonpDeserializable +public class AnalyzeRequest extends RequestBase implements JsonpSerializable { + @Nullable + private final String analyzer; + + private final List attributes; + + private final List charFilter; + + @Nullable + private final Boolean explain; + + @Nullable + private final String field; + + private final List filter; + + @Nullable + private final String index; + + @Nullable + private final String normalizer; + + private final List text; + + @Nullable + private final Tokenizer tokenizer; + + // --------------------------------------------------------------------------------------------- + + private AnalyzeRequest(Builder builder) { + + this.analyzer = builder.analyzer; + this.attributes = ApiTypeHelper.unmodifiable(builder.attributes); + this.charFilter = ApiTypeHelper.unmodifiable(builder.charFilter); + this.explain = builder.explain; + this.field = builder.field; + this.filter = ApiTypeHelper.unmodifiable(builder.filter); + this.index = builder.index; + this.normalizer = builder.normalizer; + this.text = ApiTypeHelper.unmodifiable(builder.text); + this.tokenizer = builder.tokenizer; + + } + + public static AnalyzeRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The name of the analyzer that should be applied to the provided + * text. This could be a built-in analyzer, or an analyzer that’s + * been configured in the index. + *

+ * API name: {@code analyzer} + */ + @Nullable + public final String analyzer() { + return this.analyzer; + } + + /** + * Array of token attributes used to filter the output of the + * explain parameter. + *

+ * API name: {@code attributes} + */ + public final List attributes() { + return this.attributes; + } + + /** + * Array of character filters used to preprocess characters before the + * tokenizer. + *

+ * API name: {@code char_filter} + */ + public final List charFilter() { + return this.charFilter; + } + + /** + * If true, the response includes token attributes and additional + * details. + *

+ * API name: {@code explain} + */ + @Nullable + public final Boolean explain() { + return this.explain; + } + + /** + * Field used to derive the analyzer. To use this parameter, you must specify an + * index. If specified, the analyzer parameter overrides this + * value. + *

+ * API name: {@code field} + */ + @Nullable + public final String field() { + return this.field; + } + + /** + * Array of token filters used to apply after the tokenizer. + *

+ * API name: {@code filter} + */ + public final List filter() { + return this.filter; + } + + /** + * Index used to derive the analyzer. If specified, the analyzer or + * field parameter overrides this value. If no index is specified or the index + * does not have a default analyzer, the analyze API uses the standard analyzer. + *

+ * API name: {@code index} + */ + @Nullable + public final String index() { + return this.index; + } + + /** + * Normalizer to use to convert text into a single token. + *

+ * API name: {@code normalizer} + */ + @Nullable + public final String normalizer() { + return this.normalizer; + } + + /** + * Text to analyze. If an array of strings is provided, it is analyzed as a + * multi-value field. + *

+ * API name: {@code text} + */ + public final List text() { + return this.text; + } + + /** + * Tokenizer to use to convert text into tokens. + *

+ * API name: {@code tokenizer} + */ + @Nullable + public final Tokenizer tokenizer() { + return this.tokenizer; + } + + /** + * 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 (this.analyzer != null) { + generator.writeKey("analyzer"); + generator.write(this.analyzer); + + } + if (ApiTypeHelper.isDefined(this.attributes)) { + generator.writeKey("attributes"); + generator.writeStartArray(); + for (String item0 : this.attributes) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.charFilter)) { + generator.writeKey("char_filter"); + generator.writeStartArray(); + for (CharFilter item0 : this.charFilter) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.explain != null) { + generator.writeKey("explain"); + generator.write(this.explain); + + } + if (this.field != null) { + generator.writeKey("field"); + generator.write(this.field); + + } + if (ApiTypeHelper.isDefined(this.filter)) { + generator.writeKey("filter"); + generator.writeStartArray(); + for (TokenFilter item0 : this.filter) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.normalizer != null) { + generator.writeKey("normalizer"); + generator.write(this.normalizer); + + } + if (ApiTypeHelper.isDefined(this.text)) { + generator.writeKey("text"); + generator.writeStartArray(); + for (String item0 : this.text) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.tokenizer != null) { + generator.writeKey("tokenizer"); + this.tokenizer.serialize(generator, mapper); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link AnalyzeRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private String analyzer; + + @Nullable + private List attributes; + + @Nullable + private List charFilter; + + @Nullable + private Boolean explain; + + @Nullable + private String field; + + @Nullable + private List filter; + + @Nullable + private String index; + + @Nullable + private String normalizer; + + @Nullable + private List text; + + @Nullable + private Tokenizer tokenizer; + + /** + * The name of the analyzer that should be applied to the provided + * text. This could be a built-in analyzer, or an analyzer that’s + * been configured in the index. + *

+ * API name: {@code analyzer} + */ + public final Builder analyzer(@Nullable String value) { + this.analyzer = value; + return this; + } + + /** + * Array of token attributes used to filter the output of the + * explain parameter. + *

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

+ * Adds all elements of list to attributes. + */ + public final Builder attributes(List list) { + this.attributes = _listAddAll(this.attributes, list); + return this; + } + + /** + * Array of token attributes used to filter the output of the + * explain parameter. + *

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

+ * Adds one or more values to attributes. + */ + public final Builder attributes(String value, String... values) { + this.attributes = _listAdd(this.attributes, value, values); + return this; + } + + /** + * Array of character filters used to preprocess characters before the + * tokenizer. + *

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

+ * Adds all elements of list to charFilter. + */ + public final Builder charFilter(List list) { + this.charFilter = _listAddAll(this.charFilter, list); + return this; + } + + /** + * Array of character filters used to preprocess characters before the + * tokenizer. + *

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

+ * Adds one or more values to charFilter. + */ + public final Builder charFilter(CharFilter value, CharFilter... values) { + this.charFilter = _listAdd(this.charFilter, value, values); + return this; + } + + /** + * Array of character filters used to preprocess characters before the + * tokenizer. + *

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

+ * Adds a value to charFilter using a builder lambda. + */ + public final Builder charFilter(Function> fn) { + return charFilter(fn.apply(new CharFilter.Builder()).build()); + } + + /** + * If true, the response includes token attributes and additional + * details. + *

+ * API name: {@code explain} + */ + public final Builder explain(@Nullable Boolean value) { + this.explain = value; + return this; + } + + /** + * Field used to derive the analyzer. To use this parameter, you must specify an + * index. If specified, the analyzer parameter overrides this + * value. + *

+ * API name: {@code field} + */ + public final Builder field(@Nullable String value) { + this.field = value; + return this; + } + + /** + * Array of token filters used to apply after the tokenizer. + *

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

+ * Adds all elements of list to filter. + */ + public final Builder filter(List list) { + this.filter = _listAddAll(this.filter, list); + return this; + } + + /** + * Array of token filters used to apply after the tokenizer. + *

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

+ * Adds one or more values to filter. + */ + public final Builder filter(TokenFilter value, TokenFilter... values) { + this.filter = _listAdd(this.filter, value, values); + return this; + } + + /** + * Array of token filters used to apply after the tokenizer. + *

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

+ * Adds a value to filter using a builder lambda. + */ + public final Builder filter(Function> fn) { + return filter(fn.apply(new TokenFilter.Builder()).build()); + } + + /** + * Index used to derive the analyzer. If specified, the analyzer or + * field parameter overrides this value. If no index is specified or the index + * does not have a default analyzer, the analyze API uses the standard analyzer. + *

+ * API name: {@code index} + */ + public final Builder index(@Nullable String value) { + this.index = value; + return this; + } + + /** + * Normalizer to use to convert text into a single token. + *

+ * API name: {@code normalizer} + */ + public final Builder normalizer(@Nullable String value) { + this.normalizer = value; + return this; + } + + /** + * Text to analyze. If an array of strings is provided, it is analyzed as a + * multi-value field. + *

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

+ * Adds all elements of list to text. + */ + public final Builder text(List list) { + this.text = _listAddAll(this.text, list); + return this; + } + + /** + * Text to analyze. If an array of strings is provided, it is analyzed as a + * multi-value field. + *

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

+ * Adds one or more values to text. + */ + public final Builder text(String value, String... values) { + this.text = _listAdd(this.text, value, values); + return this; + } + + /** + * Tokenizer to use to convert text into tokens. + *

+ * API name: {@code tokenizer} + */ + public final Builder tokenizer(@Nullable Tokenizer value) { + this.tokenizer = value; + return this; + } + + /** + * Tokenizer to use to convert text into tokens. + *

+ * API name: {@code tokenizer} + */ + public final Builder tokenizer(Function> fn) { + return this.tokenizer(fn.apply(new Tokenizer.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link AnalyzeRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public AnalyzeRequest build() { + _checkSingleUse(); + + return new AnalyzeRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link AnalyzeRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + AnalyzeRequest::setupAnalyzeRequestDeserializer); + + protected static void setupAnalyzeRequestDeserializer(ObjectDeserializer op) { + + op.add(Builder::analyzer, JsonpDeserializer.stringDeserializer(), "analyzer"); + op.add(Builder::attributes, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "attributes"); + op.add(Builder::charFilter, JsonpDeserializer.arrayDeserializer(CharFilter._DESERIALIZER), "char_filter"); + op.add(Builder::explain, JsonpDeserializer.booleanDeserializer(), "explain"); + op.add(Builder::field, JsonpDeserializer.stringDeserializer(), "field"); + op.add(Builder::filter, JsonpDeserializer.arrayDeserializer(TokenFilter._DESERIALIZER), "filter"); + op.add(Builder::normalizer, JsonpDeserializer.stringDeserializer(), "normalizer"); + op.add(Builder::text, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "text"); + op.add(Builder::tokenizer, Tokenizer._DESERIALIZER, "tokenizer"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.analyze}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.analyze", + + // Request method + request -> { + return "POST"; + + }, + + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + if (request.index() != null) + propsSet |= _index; + + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_analyze"); + return buf.toString(); + } + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index, buf); + buf.append("/_analyze"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _index = 1 << 0; + + int propsSet = 0; + + if (request.index() != null) + propsSet |= _index; + + if (propsSet == 0) { + } + if (propsSet == (_index)) { + params.put("index", request.index); + } + return params; + }, + + // Request parameters + request -> { + return Collections.emptyMap(); + + }, SimpleEndpoint.emptyMap(), true, AnalyzeResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AnalyzeResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AnalyzeResponse.java new file mode 100644 index 000000000..4d4a5ecf9 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/AnalyzeResponse.java @@ -0,0 +1,210 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch.indices.analyze.AnalyzeDetail; +import co.elastic.clients.elasticsearch.indices.analyze.AnalyzeToken; +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; + +// typedef: indices.analyze.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class AnalyzeResponse implements JsonpSerializable { + @Nullable + private final AnalyzeDetail detail; + + private final List tokens; + + // --------------------------------------------------------------------------------------------- + + private AnalyzeResponse(Builder builder) { + + this.detail = builder.detail; + this.tokens = ApiTypeHelper.unmodifiable(builder.tokens); + + } + + public static AnalyzeResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code detail} + */ + @Nullable + public final AnalyzeDetail detail() { + return this.detail; + } + + /** + * API name: {@code tokens} + */ + public final List tokens() { + return this.tokens; + } + + /** + * 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 (this.detail != null) { + generator.writeKey("detail"); + this.detail.serialize(generator, mapper); + + } + if (ApiTypeHelper.isDefined(this.tokens)) { + generator.writeKey("tokens"); + generator.writeStartArray(); + for (AnalyzeToken item0 : this.tokens) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link AnalyzeResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private AnalyzeDetail detail; + + @Nullable + private List tokens; + + /** + * API name: {@code detail} + */ + public final Builder detail(@Nullable AnalyzeDetail value) { + this.detail = value; + return this; + } + + /** + * API name: {@code detail} + */ + public final Builder detail(Function> fn) { + return this.detail(fn.apply(new AnalyzeDetail.Builder()).build()); + } + + /** + * API name: {@code tokens} + *

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

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

+ * Adds a value to tokens using a builder lambda. + */ + public final Builder tokens(Function> fn) { + return tokens(fn.apply(new AnalyzeToken.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link AnalyzeResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public AnalyzeResponse build() { + _checkSingleUse(); + + return new AnalyzeResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link AnalyzeResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + AnalyzeResponse::setupAnalyzeResponseDeserializer); + + protected static void setupAnalyzeResponseDeserializer(ObjectDeserializer op) { + + op.add(Builder::detail, AnalyzeDetail._DESERIALIZER, "detail"); + op.add(Builder::tokens, JsonpDeserializer.arrayDeserializer(AnalyzeToken._DESERIALIZER), "tokens"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CacheQueries.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CacheQueries.java new file mode 100644 index 000000000..4f56739c2 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CacheQueries.java @@ -0,0 +1,141 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.Boolean; +import java.util.Objects; +import java.util.function.Function; + +// typedef: indices._types.CacheQueries + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CacheQueries implements JsonpSerializable { + private final boolean enabled; + + // --------------------------------------------------------------------------------------------- + + private CacheQueries(Builder builder) { + + this.enabled = ApiTypeHelper.requireNonNull(builder.enabled, this, "enabled"); + + } + + public static CacheQueries of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code enabled} + */ + public final boolean enabled() { + return this.enabled; + } + + /** + * 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("enabled"); + generator.write(this.enabled); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CacheQueries}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Boolean enabled; + + /** + * Required - API name: {@code enabled} + */ + public final Builder enabled(boolean value) { + this.enabled = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CacheQueries}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CacheQueries build() { + _checkSingleUse(); + + return new CacheQueries(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CacheQueries} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + CacheQueries::setupCacheQueriesDeserializer); + + protected static void setupCacheQueriesDeserializer(ObjectDeserializer op) { + + op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateDataStreamRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateDataStreamRequest.java new file mode 100644 index 000000000..05c23df8d --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateDataStreamRequest.java @@ -0,0 +1,186 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +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.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.create_data_stream.Request + +/** + * Creates a data stream. You must have a matching index template with data + * stream enabled. + * + * @see API + * specification + */ + +public class CreateDataStreamRequest extends RequestBase { + private final String name; + + // --------------------------------------------------------------------------------------------- + + private CreateDataStreamRequest(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + + } + + public static CreateDataStreamRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Name of the data stream, which must meet the following criteria: + * Lowercase only; Cannot include \, /, + * *, ?, ", <, + * >, |, ,, #, + * :, or a space character; Cannot start with -, + * _, +, or .ds-; Cannot be + * . or ..; Cannot be longer than 255 bytes. + * Multi-byte characters count towards this limit faster. + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CreateDataStreamRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + private String name; + + /** + * Required - Name of the data stream, which must meet the following criteria: + * Lowercase only; Cannot include \, /, + * *, ?, ", <, + * >, |, ,, #, + * :, or a space character; Cannot start with -, + * _, +, or .ds-; Cannot be + * . or ..; Cannot be longer than 255 bytes. + * Multi-byte characters count towards this limit faster. + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CreateDataStreamRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CreateDataStreamRequest build() { + _checkSingleUse(); + + return new CreateDataStreamRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.create_data_stream}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.create_data_stream", + + // Request method + request -> { + return "PUT"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_data_stream"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name); + } + return params; + }, + + // Request parameters + request -> { + return Collections.emptyMap(); + + }, SimpleEndpoint.emptyMap(), false, CreateDataStreamResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateDataStreamResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateDataStreamResponse.java new file mode 100644 index 000000000..91eb66afd --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateDataStreamResponse.java @@ -0,0 +1,98 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.create_data_stream.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CreateDataStreamResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private CreateDataStreamResponse(Builder builder) { + super(builder); + + } + + public static CreateDataStreamResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CreateDataStreamResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CreateDataStreamResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CreateDataStreamResponse build() { + _checkSingleUse(); + + return new CreateDataStreamResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CreateDataStreamResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, CreateDataStreamResponse::setupCreateDataStreamResponseDeserializer); + + protected static void setupCreateDataStreamResponseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateIndexRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateIndexRequest.java new file mode 100644 index 000000000..e6089255a --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateIndexRequest.java @@ -0,0 +1,492 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.elasticsearch._types.WaitForActiveShards; +import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; +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.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.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.create.Request + +/** + * Creates a new index. + * + * @see API + * specification + */ +@JsonpDeserializable +public class CreateIndexRequest extends RequestBase implements JsonpSerializable { + private final Map aliases; + + private final String index; + + @Nullable + private final TypeMapping mappings; + + @Nullable + private final Time masterTimeout; + + @Nullable + private final IndexSettings settings; + + @Nullable + private final Time timeout; + + @Nullable + private final WaitForActiveShards waitForActiveShards; + + // --------------------------------------------------------------------------------------------- + + private CreateIndexRequest(Builder builder) { + + this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); + this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); + this.mappings = builder.mappings; + this.masterTimeout = builder.masterTimeout; + this.settings = builder.settings; + this.timeout = builder.timeout; + this.waitForActiveShards = builder.waitForActiveShards; + + } + + public static CreateIndexRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Aliases for the index. + *

+ * API name: {@code aliases} + */ + public final Map aliases() { + return this.aliases; + } + + /** + * Required - Name of the index you wish to create. + *

+ * API name: {@code index} + */ + public final String index() { + return this.index; + } + + /** + * Mapping for fields in the index. If specified, this mapping can include: + *

    + *
  • Field names
  • + *
  • Field data types
  • + *
  • Mapping parameters
  • + *
+ *

+ * API name: {@code mappings} + */ + @Nullable + public final TypeMapping mappings() { + return this.mappings; + } + + /** + * 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; + } + + /** + * Configuration options for the index. + *

+ * API name: {@code settings} + */ + @Nullable + public final IndexSettings settings() { + return this.settings; + } + + /** + * 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; + } + + /** + * The number of shard copies that must be active before proceeding with the + * operation. Set to all or any positive integer up to the total + * number of shards in the index (number_of_replicas+1). + *

+ * API name: {@code wait_for_active_shards} + */ + @Nullable + public final WaitForActiveShards waitForActiveShards() { + return this.waitForActiveShards; + } + + /** + * 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.aliases)) { + generator.writeKey("aliases"); + generator.writeStartObject(); + for (Map.Entry item0 : this.aliases.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.mappings != null) { + generator.writeKey("mappings"); + this.mappings.serialize(generator, mapper); + + } + if (this.settings != null) { + generator.writeKey("settings"); + this.settings.serialize(generator, mapper); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CreateIndexRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Map aliases; + + private String index; + + @Nullable + private TypeMapping mappings; + + @Nullable + private Time masterTimeout; + + @Nullable + private IndexSettings settings; + + @Nullable + private Time timeout; + + @Nullable + private WaitForActiveShards waitForActiveShards; + + /** + * Aliases for the index. + *

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

+ * Adds all entries of map to aliases. + */ + public final Builder aliases(Map map) { + this.aliases = _mapPutAll(this.aliases, map); + return this; + } + + /** + * Aliases for the index. + *

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

+ * Adds an entry to aliases. + */ + public final Builder aliases(String key, Alias value) { + this.aliases = _mapPut(this.aliases, key, value); + return this; + } + + /** + * Aliases for the index. + *

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

+ * Adds an entry to aliases using a builder lambda. + */ + public final Builder aliases(String key, Function> fn) { + return aliases(key, fn.apply(new Alias.Builder()).build()); + } + + /** + * Required - Name of the index you wish to create. + *

+ * API name: {@code index} + */ + public final Builder index(String value) { + this.index = value; + return this; + } + + /** + * Mapping for fields in the index. If specified, this mapping can include: + *

    + *
  • Field names
  • + *
  • Field data types
  • + *
  • Mapping parameters
  • + *
+ *

+ * API name: {@code mappings} + */ + public final Builder mappings(@Nullable TypeMapping value) { + this.mappings = value; + return this; + } + + /** + * Mapping for fields in the index. If specified, this mapping can include: + *

    + *
  • Field names
  • + *
  • Field data types
  • + *
  • Mapping parameters
  • + *
+ *

+ * API name: {@code mappings} + */ + public final Builder mappings(Function> fn) { + return this.mappings(fn.apply(new TypeMapping.Builder()).build()); + } + + /** + * 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()); + } + + /** + * Configuration options for the index. + *

+ * API name: {@code settings} + */ + public final Builder settings(@Nullable IndexSettings value) { + this.settings = value; + return this; + } + + /** + * Configuration options for the index. + *

+ * API name: {@code settings} + */ + public final Builder settings(Function> fn) { + return this.settings(fn.apply(new IndexSettings.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()); + } + + /** + * The number of shard copies that must be active before proceeding with the + * operation. Set to all or any positive integer up to the total + * number of shards in the index (number_of_replicas+1). + *

+ * API name: {@code wait_for_active_shards} + */ + public final Builder waitForActiveShards(@Nullable WaitForActiveShards value) { + this.waitForActiveShards = value; + return this; + } + + /** + * The number of shard copies that must be active before proceeding with the + * operation. Set to all or any positive integer up to the total + * number of shards in the index (number_of_replicas+1). + *

+ * API name: {@code wait_for_active_shards} + */ + public final Builder waitForActiveShards( + Function> fn) { + return this.waitForActiveShards(fn.apply(new WaitForActiveShards.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CreateIndexRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CreateIndexRequest build() { + _checkSingleUse(); + + return new CreateIndexRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CreateIndexRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, CreateIndexRequest::setupCreateIndexRequestDeserializer); + + protected static void setupCreateIndexRequestDeserializer(ObjectDeserializer op) { + + op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(Alias._DESERIALIZER), "aliases"); + op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); + op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.create}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.create", + + // Request method + request -> { + return "PUT"; + + }, + + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + params.put("index", request.index); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } + if (request.waitForActiveShards != null) { + params.put("wait_for_active_shards", request.waitForActiveShards._toJsonString()); + } + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), true, CreateIndexResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateIndexResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateIndexResponse.java new file mode 100644 index 000000000..808311ca1 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/CreateIndexResponse.java @@ -0,0 +1,194 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.AcknowledgedResponse; +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.Boolean; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.create.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CreateIndexResponse implements AcknowledgedResponse, JsonpSerializable { + private final String index; + + private final boolean shardsAcknowledged; + + private final boolean acknowledged; + + // --------------------------------------------------------------------------------------------- + + private CreateIndexResponse(Builder builder) { + + this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); + this.shardsAcknowledged = ApiTypeHelper.requireNonNull(builder.shardsAcknowledged, this, "shardsAcknowledged"); + this.acknowledged = ApiTypeHelper.requireNonNull(builder.acknowledged, this, "acknowledged"); + + } + + public static CreateIndexResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code index} + */ + public final String index() { + return this.index; + } + + /** + * Required - API name: {@code shards_acknowledged} + */ + public final boolean shardsAcknowledged() { + return this.shardsAcknowledged; + } + + /** + * Required - API name: {@code acknowledged} + */ + public final boolean acknowledged() { + return this.acknowledged; + } + + /** + * 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("index"); + generator.write(this.index); + + generator.writeKey("shards_acknowledged"); + generator.write(this.shardsAcknowledged); + + generator.writeKey("acknowledged"); + generator.write(this.acknowledged); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CreateIndexResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private String index; + + private Boolean shardsAcknowledged; + + private Boolean acknowledged; + + /** + * Required - API name: {@code index} + */ + public final Builder index(String value) { + this.index = value; + return this; + } + + /** + * Required - API name: {@code shards_acknowledged} + */ + public final Builder shardsAcknowledged(boolean value) { + this.shardsAcknowledged = value; + return this; + } + + /** + * Required - API name: {@code acknowledged} + */ + public final Builder acknowledged(boolean value) { + this.acknowledged = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CreateIndexResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CreateIndexResponse build() { + _checkSingleUse(); + + return new CreateIndexResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CreateIndexResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, CreateIndexResponse::setupCreateIndexResponseDeserializer); + + protected static void setupCreateIndexResponseDeserializer(ObjectDeserializer op) { + + op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); + op.add(Builder::shardsAcknowledged, JsonpDeserializer.booleanDeserializer(), "shards_acknowledged"); + op.add(Builder::acknowledged, JsonpDeserializer.booleanDeserializer(), "acknowledged"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStream.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStream.java new file mode 100644 index 000000000..fd84a51a7 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStream.java @@ -0,0 +1,633 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.HealthStatus; +import co.elastic.clients.json.JsonData; +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.Boolean; +import java.lang.Integer; +import java.lang.String; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.DataStream + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DataStream implements JsonpSerializable { + private final Map meta; + + @Nullable + private final Boolean allowCustomRouting; + + private final int generation; + + private final boolean hidden; + + @Nullable + private final String ilmPolicy; + + private final List indices; + + @Nullable + private final DataStreamLifecycleWithRollover lifecycle; + + private final String name; + + @Nullable + private final Boolean replicated; + + private final HealthStatus status; + + @Nullable + private final Boolean system; + + private final String template; + + private final DataStreamTimestampField timestampField; + + // --------------------------------------------------------------------------------------------- + + private DataStream(Builder builder) { + + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.allowCustomRouting = builder.allowCustomRouting; + this.generation = ApiTypeHelper.requireNonNull(builder.generation, this, "generation"); + this.hidden = ApiTypeHelper.requireNonNull(builder.hidden, this, "hidden"); + this.ilmPolicy = builder.ilmPolicy; + this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); + this.lifecycle = builder.lifecycle; + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.replicated = builder.replicated; + this.status = ApiTypeHelper.requireNonNull(builder.status, this, "status"); + this.system = builder.system; + this.template = ApiTypeHelper.requireNonNull(builder.template, this, "template"); + this.timestampField = ApiTypeHelper.requireNonNull(builder.timestampField, this, "timestampField"); + + } + + public static DataStream of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Custom metadata for the stream, copied from the _meta object of + * the stream’s matching index template. If empty, the response omits this + * property. + *

+ * API name: {@code _meta} + */ + public final Map meta() { + return this.meta; + } + + /** + * If true, the data stream allows custom routing on write request. + *

+ * API name: {@code allow_custom_routing} + */ + @Nullable + public final Boolean allowCustomRouting() { + return this.allowCustomRouting; + } + + /** + * Required - Current generation for the data stream. This number acts as a + * cumulative count of the stream’s rollovers, starting at 1. + *

+ * API name: {@code generation} + */ + public final int generation() { + return this.generation; + } + + /** + * Required - If true, the data stream is hidden. + *

+ * API name: {@code hidden} + */ + public final boolean hidden() { + return this.hidden; + } + + /** + * Name of the current ILM lifecycle policy in the stream’s matching index + * template. This lifecycle policy is set in the + * index.lifecycle.name setting. If the template does not include a + * lifecycle policy, this property is not included in the response. NOTE: A data + * stream’s backing indices may be assigned different lifecycle policies. To + * retrieve the lifecycle policy for individual backing indices, use the get + * index settings API. + *

+ * API name: {@code ilm_policy} + */ + @Nullable + public final String ilmPolicy() { + return this.ilmPolicy; + } + + /** + * Required - Array of objects containing information about the data stream’s + * backing indices. The last item in this array contains information about the + * stream’s current write index. + *

+ * API name: {@code indices} + */ + public final List indices() { + return this.indices; + } + + /** + * Contains the configuration for the data lifecycle management of this data + * stream. + *

+ * API name: {@code lifecycle} + */ + @Nullable + public final DataStreamLifecycleWithRollover lifecycle() { + return this.lifecycle; + } + + /** + * Required - Name of the data stream. + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * If true, the data stream is created and managed by cross-cluster + * replication and the local cluster can not write into this data stream or + * change its mappings. + *

+ * API name: {@code replicated} + */ + @Nullable + public final Boolean replicated() { + return this.replicated; + } + + /** + * Required - Health status of the data stream. This health status is based on + * the state of the primary and replica shards of the stream’s backing indices. + *

+ * API name: {@code status} + */ + public final HealthStatus status() { + return this.status; + } + + /** + * If true, the data stream is created and managed by an Elastic + * stack component and cannot be modified through normal user interaction. + *

+ * API name: {@code system} + */ + @Nullable + public final Boolean system() { + return this.system; + } + + /** + * Required - Name of the index template used to create the data stream’s + * backing indices. The template’s index pattern must match the name of this + * data stream. + *

+ * API name: {@code template} + */ + public final String template() { + return this.template; + } + + /** + * Required - Information about the @timestamp field in the data + * stream. + *

+ * API name: {@code timestamp_field} + */ + public final DataStreamTimestampField timestampField() { + return this.timestampField; + } + + /** + * 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.meta)) { + generator.writeKey("_meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.allowCustomRouting != null) { + generator.writeKey("allow_custom_routing"); + generator.write(this.allowCustomRouting); + + } + generator.writeKey("generation"); + generator.write(this.generation); + + generator.writeKey("hidden"); + generator.write(this.hidden); + + if (this.ilmPolicy != null) { + generator.writeKey("ilm_policy"); + generator.write(this.ilmPolicy); + + } + if (ApiTypeHelper.isDefined(this.indices)) { + generator.writeKey("indices"); + generator.writeStartArray(); + for (DataStreamIndex item0 : this.indices) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.lifecycle != null) { + generator.writeKey("lifecycle"); + this.lifecycle.serialize(generator, mapper); + + } + generator.writeKey("name"); + generator.write(this.name); + + if (this.replicated != null) { + generator.writeKey("replicated"); + generator.write(this.replicated); + + } + generator.writeKey("status"); + this.status.serialize(generator, mapper); + if (this.system != null) { + generator.writeKey("system"); + generator.write(this.system); + + } + generator.writeKey("template"); + generator.write(this.template); + + generator.writeKey("timestamp_field"); + this.timestampField.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DataStream}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Map meta; + + @Nullable + private Boolean allowCustomRouting; + + private Integer generation; + + private Boolean hidden; + + @Nullable + private String ilmPolicy; + + private List indices; + + @Nullable + private DataStreamLifecycleWithRollover lifecycle; + + private String name; + + @Nullable + private Boolean replicated; + + private HealthStatus status; + + @Nullable + private Boolean system; + + private String template; + + private DataStreamTimestampField timestampField; + + /** + * Custom metadata for the stream, copied from the _meta object of + * the stream’s matching index template. If empty, the response omits this + * property. + *

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

+ * Adds all entries of map to meta. + */ + public final Builder meta(Map map) { + this.meta = _mapPutAll(this.meta, map); + return this; + } + + /** + * Custom metadata for the stream, copied from the _meta object of + * the stream’s matching index template. If empty, the response omits this + * property. + *

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

+ * Adds an entry to meta. + */ + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); + return this; + } + + /** + * If true, the data stream allows custom routing on write request. + *

+ * API name: {@code allow_custom_routing} + */ + public final Builder allowCustomRouting(@Nullable Boolean value) { + this.allowCustomRouting = value; + return this; + } + + /** + * Required - Current generation for the data stream. This number acts as a + * cumulative count of the stream’s rollovers, starting at 1. + *

+ * API name: {@code generation} + */ + public final Builder generation(int value) { + this.generation = value; + return this; + } + + /** + * Required - If true, the data stream is hidden. + *

+ * API name: {@code hidden} + */ + public final Builder hidden(boolean value) { + this.hidden = value; + return this; + } + + /** + * Name of the current ILM lifecycle policy in the stream’s matching index + * template. This lifecycle policy is set in the + * index.lifecycle.name setting. If the template does not include a + * lifecycle policy, this property is not included in the response. NOTE: A data + * stream’s backing indices may be assigned different lifecycle policies. To + * retrieve the lifecycle policy for individual backing indices, use the get + * index settings API. + *

+ * API name: {@code ilm_policy} + */ + public final Builder ilmPolicy(@Nullable String value) { + this.ilmPolicy = value; + return this; + } + + /** + * Required - Array of objects containing information about the data stream’s + * backing indices. The last item in this array contains information about the + * stream’s current write index. + *

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

+ * Adds all elements of list to indices. + */ + public final Builder indices(List list) { + this.indices = _listAddAll(this.indices, list); + return this; + } + + /** + * Required - Array of objects containing information about the data stream’s + * backing indices. The last item in this array contains information about the + * stream’s current write index. + *

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

+ * Adds one or more values to indices. + */ + public final Builder indices(DataStreamIndex value, DataStreamIndex... values) { + this.indices = _listAdd(this.indices, value, values); + return this; + } + + /** + * Required - Array of objects containing information about the data stream’s + * backing indices. The last item in this array contains information about the + * stream’s current write index. + *

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

+ * Adds a value to indices using a builder lambda. + */ + public final Builder indices(Function> fn) { + return indices(fn.apply(new DataStreamIndex.Builder()).build()); + } + + /** + * Contains the configuration for the data lifecycle management of this data + * stream. + *

+ * API name: {@code lifecycle} + */ + public final Builder lifecycle(@Nullable DataStreamLifecycleWithRollover value) { + this.lifecycle = value; + return this; + } + + /** + * Contains the configuration for the data lifecycle management of this data + * stream. + *

+ * API name: {@code lifecycle} + */ + public final Builder lifecycle( + Function> fn) { + return this.lifecycle(fn.apply(new DataStreamLifecycleWithRollover.Builder()).build()); + } + + /** + * Required - Name of the data stream. + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * If true, the data stream is created and managed by cross-cluster + * replication and the local cluster can not write into this data stream or + * change its mappings. + *

+ * API name: {@code replicated} + */ + public final Builder replicated(@Nullable Boolean value) { + this.replicated = value; + return this; + } + + /** + * Required - Health status of the data stream. This health status is based on + * the state of the primary and replica shards of the stream’s backing indices. + *

+ * API name: {@code status} + */ + public final Builder status(HealthStatus value) { + this.status = value; + return this; + } + + /** + * If true, the data stream is created and managed by an Elastic + * stack component and cannot be modified through normal user interaction. + *

+ * API name: {@code system} + */ + public final Builder system(@Nullable Boolean value) { + this.system = value; + return this; + } + + /** + * Required - Name of the index template used to create the data stream’s + * backing indices. The template’s index pattern must match the name of this + * data stream. + *

+ * API name: {@code template} + */ + public final Builder template(String value) { + this.template = value; + return this; + } + + /** + * Required - Information about the @timestamp field in the data + * stream. + *

+ * API name: {@code timestamp_field} + */ + public final Builder timestampField(DataStreamTimestampField value) { + this.timestampField = value; + return this; + } + + /** + * Required - Information about the @timestamp field in the data + * stream. + *

+ * API name: {@code timestamp_field} + */ + public final Builder timestampField( + Function> fn) { + return this.timestampField(fn.apply(new DataStreamTimestampField.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DataStream}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DataStream build() { + _checkSingleUse(); + + return new DataStream(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DataStream} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + DataStream::setupDataStreamDeserializer); + + protected static void setupDataStreamDeserializer(ObjectDeserializer op) { + + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); + op.add(Builder::allowCustomRouting, JsonpDeserializer.booleanDeserializer(), "allow_custom_routing"); + op.add(Builder::generation, JsonpDeserializer.integerDeserializer(), "generation"); + op.add(Builder::hidden, JsonpDeserializer.booleanDeserializer(), "hidden"); + op.add(Builder::ilmPolicy, JsonpDeserializer.stringDeserializer(), "ilm_policy"); + op.add(Builder::indices, JsonpDeserializer.arrayDeserializer(DataStreamIndex._DESERIALIZER), "indices"); + op.add(Builder::lifecycle, DataStreamLifecycleWithRollover._DESERIALIZER, "lifecycle"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::replicated, JsonpDeserializer.booleanDeserializer(), "replicated"); + op.add(Builder::status, HealthStatus._DESERIALIZER, "status"); + op.add(Builder::system, JsonpDeserializer.booleanDeserializer(), "system"); + op.add(Builder::template, JsonpDeserializer.stringDeserializer(), "template"); + op.add(Builder::timestampField, DataStreamTimestampField._DESERIALIZER, "timestamp_field"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamIndex.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamIndex.java new file mode 100644 index 000000000..97ef044ba --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamIndex.java @@ -0,0 +1,174 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices._types.DataStreamIndex + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DataStreamIndex implements JsonpSerializable { + private final String indexName; + + private final String indexUuid; + + // --------------------------------------------------------------------------------------------- + + private DataStreamIndex(Builder builder) { + + this.indexName = ApiTypeHelper.requireNonNull(builder.indexName, this, "indexName"); + this.indexUuid = ApiTypeHelper.requireNonNull(builder.indexUuid, this, "indexUuid"); + + } + + public static DataStreamIndex of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Name of the backing index. + *

+ * API name: {@code index_name} + */ + public final String indexName() { + return this.indexName; + } + + /** + * Required - Universally unique identifier (UUID) for the index. + *

+ * API name: {@code index_uuid} + */ + public final String indexUuid() { + return this.indexUuid; + } + + /** + * 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("index_name"); + generator.write(this.indexName); + + generator.writeKey("index_uuid"); + generator.write(this.indexUuid); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DataStreamIndex}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String indexName; + + private String indexUuid; + + /** + * Required - Name of the backing index. + *

+ * API name: {@code index_name} + */ + public final Builder indexName(String value) { + this.indexName = value; + return this; + } + + /** + * Required - Universally unique identifier (UUID) for the index. + *

+ * API name: {@code index_uuid} + */ + public final Builder indexUuid(String value) { + this.indexUuid = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DataStreamIndex}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DataStreamIndex build() { + _checkSingleUse(); + + return new DataStreamIndex(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DataStreamIndex} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + DataStreamIndex::setupDataStreamIndexDeserializer); + + protected static void setupDataStreamIndexDeserializer(ObjectDeserializer op) { + + op.add(Builder::indexName, JsonpDeserializer.stringDeserializer(), "index_name"); + op.add(Builder::indexUuid, JsonpDeserializer.stringDeserializer(), "index_uuid"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycle.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycle.java new file mode 100644 index 000000000..3d07b3813 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycle.java @@ -0,0 +1,159 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.Time; +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.DataStreamLifecycle + +/** + * Data lifecycle denotes that a data stream is managed by the data stream + * lifecycle and contains the configuration. + * + * @see API + * specification + */ +@JsonpDeserializable +public class DataStreamLifecycle implements JsonpSerializable { + @Nullable + private final Time dataRetention; + + // --------------------------------------------------------------------------------------------- + + private DataStreamLifecycle(Builder builder) { + + this.dataRetention = builder.dataRetention; + + } + + public static DataStreamLifecycle of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code data_retention} + */ + @Nullable + public final Time dataRetention() { + return this.dataRetention; + } + + /** + * 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 (this.dataRetention != null) { + generator.writeKey("data_retention"); + this.dataRetention.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DataStreamLifecycle}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Time dataRetention; + + /** + * API name: {@code data_retention} + */ + public final Builder dataRetention(@Nullable Time value) { + this.dataRetention = value; + return this; + } + + /** + * API name: {@code data_retention} + */ + public final Builder dataRetention(Function> fn) { + return this.dataRetention(fn.apply(new Time.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DataStreamLifecycle}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DataStreamLifecycle build() { + _checkSingleUse(); + + return new DataStreamLifecycle(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DataStreamLifecycle} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DataStreamLifecycle::setupDataStreamLifecycleDeserializer); + + protected static void setupDataStreamLifecycleDeserializer(ObjectDeserializer op) { + + op.add(Builder::dataRetention, Time._DESERIALIZER, "data_retention"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleRolloverConditions.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleRolloverConditions.java new file mode 100644 index 000000000..42e1ec3f5 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleRolloverConditions.java @@ -0,0 +1,423 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.Time; +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.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; + +// typedef: indices._types.DataStreamLifecycleRolloverConditions + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DataStreamLifecycleRolloverConditions implements JsonpSerializable { + @Nullable + private final Time minAge; + + @Nullable + private final String maxAge; + + @Nullable + private final Long minDocs; + + @Nullable + private final Long maxDocs; + + @Nullable + private final String minSize; + + @Nullable + private final String maxSize; + + @Nullable + private final String minPrimaryShardSize; + + @Nullable + private final String maxPrimaryShardSize; + + @Nullable + private final Long minPrimaryShardDocs; + + @Nullable + private final Long maxPrimaryShardDocs; + + // --------------------------------------------------------------------------------------------- + + private DataStreamLifecycleRolloverConditions(Builder builder) { + + this.minAge = builder.minAge; + this.maxAge = builder.maxAge; + this.minDocs = builder.minDocs; + this.maxDocs = builder.maxDocs; + this.minSize = builder.minSize; + this.maxSize = builder.maxSize; + this.minPrimaryShardSize = builder.minPrimaryShardSize; + this.maxPrimaryShardSize = builder.maxPrimaryShardSize; + this.minPrimaryShardDocs = builder.minPrimaryShardDocs; + this.maxPrimaryShardDocs = builder.maxPrimaryShardDocs; + + } + + public static DataStreamLifecycleRolloverConditions of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code min_age} + */ + @Nullable + public final Time minAge() { + return this.minAge; + } + + /** + * API name: {@code max_age} + */ + @Nullable + public final String maxAge() { + return this.maxAge; + } + + /** + * API name: {@code min_docs} + */ + @Nullable + public final Long minDocs() { + return this.minDocs; + } + + /** + * API name: {@code max_docs} + */ + @Nullable + public final Long maxDocs() { + return this.maxDocs; + } + + /** + * API name: {@code min_size} + */ + @Nullable + public final String minSize() { + return this.minSize; + } + + /** + * API name: {@code max_size} + */ + @Nullable + public final String maxSize() { + return this.maxSize; + } + + /** + * API name: {@code min_primary_shard_size} + */ + @Nullable + public final String minPrimaryShardSize() { + return this.minPrimaryShardSize; + } + + /** + * API name: {@code max_primary_shard_size} + */ + @Nullable + public final String maxPrimaryShardSize() { + return this.maxPrimaryShardSize; + } + + /** + * API name: {@code min_primary_shard_docs} + */ + @Nullable + public final Long minPrimaryShardDocs() { + return this.minPrimaryShardDocs; + } + + /** + * API name: {@code max_primary_shard_docs} + */ + @Nullable + public final Long maxPrimaryShardDocs() { + return this.maxPrimaryShardDocs; + } + + /** + * 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 (this.minAge != null) { + generator.writeKey("min_age"); + this.minAge.serialize(generator, mapper); + + } + if (this.maxAge != null) { + generator.writeKey("max_age"); + generator.write(this.maxAge); + + } + if (this.minDocs != null) { + generator.writeKey("min_docs"); + generator.write(this.minDocs); + + } + if (this.maxDocs != null) { + generator.writeKey("max_docs"); + generator.write(this.maxDocs); + + } + if (this.minSize != null) { + generator.writeKey("min_size"); + generator.write(this.minSize); + + } + if (this.maxSize != null) { + generator.writeKey("max_size"); + generator.write(this.maxSize); + + } + if (this.minPrimaryShardSize != null) { + generator.writeKey("min_primary_shard_size"); + generator.write(this.minPrimaryShardSize); + + } + if (this.maxPrimaryShardSize != null) { + generator.writeKey("max_primary_shard_size"); + generator.write(this.maxPrimaryShardSize); + + } + if (this.minPrimaryShardDocs != null) { + generator.writeKey("min_primary_shard_docs"); + generator.write(this.minPrimaryShardDocs); + + } + if (this.maxPrimaryShardDocs != null) { + generator.writeKey("max_primary_shard_docs"); + generator.write(this.maxPrimaryShardDocs); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DataStreamLifecycleRolloverConditions}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Time minAge; + + @Nullable + private String maxAge; + + @Nullable + private Long minDocs; + + @Nullable + private Long maxDocs; + + @Nullable + private String minSize; + + @Nullable + private String maxSize; + + @Nullable + private String minPrimaryShardSize; + + @Nullable + private String maxPrimaryShardSize; + + @Nullable + private Long minPrimaryShardDocs; + + @Nullable + private Long maxPrimaryShardDocs; + + /** + * API name: {@code min_age} + */ + public final Builder minAge(@Nullable Time value) { + this.minAge = value; + return this; + } + + /** + * API name: {@code min_age} + */ + public final Builder minAge(Function> fn) { + return this.minAge(fn.apply(new Time.Builder()).build()); + } + + /** + * API name: {@code max_age} + */ + public final Builder maxAge(@Nullable String value) { + this.maxAge = value; + return this; + } + + /** + * API name: {@code min_docs} + */ + public final Builder minDocs(@Nullable Long value) { + this.minDocs = value; + return this; + } + + /** + * API name: {@code max_docs} + */ + public final Builder maxDocs(@Nullable Long value) { + this.maxDocs = value; + return this; + } + + /** + * API name: {@code min_size} + */ + public final Builder minSize(@Nullable String value) { + this.minSize = value; + return this; + } + + /** + * API name: {@code max_size} + */ + public final Builder maxSize(@Nullable String value) { + this.maxSize = value; + return this; + } + + /** + * API name: {@code min_primary_shard_size} + */ + public final Builder minPrimaryShardSize(@Nullable String value) { + this.minPrimaryShardSize = value; + return this; + } + + /** + * API name: {@code max_primary_shard_size} + */ + public final Builder maxPrimaryShardSize(@Nullable String value) { + this.maxPrimaryShardSize = value; + return this; + } + + /** + * API name: {@code min_primary_shard_docs} + */ + public final Builder minPrimaryShardDocs(@Nullable Long value) { + this.minPrimaryShardDocs = value; + return this; + } + + /** + * API name: {@code max_primary_shard_docs} + */ + public final Builder maxPrimaryShardDocs(@Nullable Long value) { + this.maxPrimaryShardDocs = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DataStreamLifecycleRolloverConditions}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DataStreamLifecycleRolloverConditions build() { + _checkSingleUse(); + + return new DataStreamLifecycleRolloverConditions(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DataStreamLifecycleRolloverConditions} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, + DataStreamLifecycleRolloverConditions::setupDataStreamLifecycleRolloverConditionsDeserializer); + + protected static void setupDataStreamLifecycleRolloverConditionsDeserializer( + ObjectDeserializer op) { + + op.add(Builder::minAge, Time._DESERIALIZER, "min_age"); + op.add(Builder::maxAge, JsonpDeserializer.stringDeserializer(), "max_age"); + op.add(Builder::minDocs, JsonpDeserializer.longDeserializer(), "min_docs"); + op.add(Builder::maxDocs, JsonpDeserializer.longDeserializer(), "max_docs"); + op.add(Builder::minSize, JsonpDeserializer.stringDeserializer(), "min_size"); + op.add(Builder::maxSize, JsonpDeserializer.stringDeserializer(), "max_size"); + op.add(Builder::minPrimaryShardSize, JsonpDeserializer.stringDeserializer(), "min_primary_shard_size"); + op.add(Builder::maxPrimaryShardSize, JsonpDeserializer.stringDeserializer(), "max_primary_shard_size"); + op.add(Builder::minPrimaryShardDocs, JsonpDeserializer.longDeserializer(), "min_primary_shard_docs"); + op.add(Builder::maxPrimaryShardDocs, JsonpDeserializer.longDeserializer(), "max_primary_shard_docs"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleWithRollover.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleWithRollover.java new file mode 100644 index 000000000..4745512bf --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamLifecycleWithRollover.java @@ -0,0 +1,234 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.Time; +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.DataStreamLifecycleWithRollover + +/** + * Data lifecycle with rollover can be used to display the configuration + * including the default rollover conditions, if asked. + * + * @see API + * specification + */ +@JsonpDeserializable +public class DataStreamLifecycleWithRollover implements JsonpSerializable { + @Nullable + private final Time dataRetention; + + @Nullable + private final DataStreamLifecycleRolloverConditions rollover; + + // --------------------------------------------------------------------------------------------- + + private DataStreamLifecycleWithRollover(Builder builder) { + + this.dataRetention = builder.dataRetention; + this.rollover = builder.rollover; + + } + + public static DataStreamLifecycleWithRollover of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If defined, every document added to this data stream will be stored at least + * for this time frame. Any time after this duration the document could be + * deleted. When empty, every document in this data stream will be stored + * indefinitely. + *

+ * API name: {@code data_retention} + */ + @Nullable + public final Time dataRetention() { + return this.dataRetention; + } + + /** + * The conditions which will trigger the rollover of a backing index as + * configured by the cluster setting + * cluster.lifecycle.default.rollover. This property is an + * implementation detail and it will only be retrieved when the query param + * include_defaults is set to true. The contents of this field are + * subject to change. + *

+ * API name: {@code rollover} + */ + @Nullable + public final DataStreamLifecycleRolloverConditions rollover() { + return this.rollover; + } + + /** + * 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 (this.dataRetention != null) { + generator.writeKey("data_retention"); + this.dataRetention.serialize(generator, mapper); + + } + if (this.rollover != null) { + generator.writeKey("rollover"); + this.rollover.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DataStreamLifecycleWithRollover}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Time dataRetention; + + @Nullable + private DataStreamLifecycleRolloverConditions rollover; + + /** + * If defined, every document added to this data stream will be stored at least + * for this time frame. Any time after this duration the document could be + * deleted. When empty, every document in this data stream will be stored + * indefinitely. + *

+ * API name: {@code data_retention} + */ + public final Builder dataRetention(@Nullable Time value) { + this.dataRetention = value; + return this; + } + + /** + * If defined, every document added to this data stream will be stored at least + * for this time frame. Any time after this duration the document could be + * deleted. When empty, every document in this data stream will be stored + * indefinitely. + *

+ * API name: {@code data_retention} + */ + public final Builder dataRetention(Function> fn) { + return this.dataRetention(fn.apply(new Time.Builder()).build()); + } + + /** + * The conditions which will trigger the rollover of a backing index as + * configured by the cluster setting + * cluster.lifecycle.default.rollover. This property is an + * implementation detail and it will only be retrieved when the query param + * include_defaults is set to true. The contents of this field are + * subject to change. + *

+ * API name: {@code rollover} + */ + public final Builder rollover(@Nullable DataStreamLifecycleRolloverConditions value) { + this.rollover = value; + return this; + } + + /** + * The conditions which will trigger the rollover of a backing index as + * configured by the cluster setting + * cluster.lifecycle.default.rollover. This property is an + * implementation detail and it will only be retrieved when the query param + * include_defaults is set to true. The contents of this field are + * subject to change. + *

+ * API name: {@code rollover} + */ + public final Builder rollover( + Function> fn) { + return this.rollover(fn.apply(new DataStreamLifecycleRolloverConditions.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DataStreamLifecycleWithRollover}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DataStreamLifecycleWithRollover build() { + _checkSingleUse(); + + return new DataStreamLifecycleWithRollover(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DataStreamLifecycleWithRollover} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DataStreamLifecycleWithRollover::setupDataStreamLifecycleWithRolloverDeserializer); + + protected static void setupDataStreamLifecycleWithRolloverDeserializer( + ObjectDeserializer op) { + + op.add(Builder::dataRetention, Time._DESERIALIZER, "data_retention"); + op.add(Builder::rollover, DataStreamLifecycleRolloverConditions._DESERIALIZER, "rollover"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamTimestampField.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamTimestampField.java new file mode 100644 index 000000000..f1a1e2c40 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamTimestampField.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices._types.DataStreamTimestampField + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DataStreamTimestampField implements JsonpSerializable { + private final String name; + + // --------------------------------------------------------------------------------------------- + + private DataStreamTimestampField(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + + } + + public static DataStreamTimestampField of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Name of the timestamp field for the data stream, which must be + * @timestamp. The @timestamp field must be included + * in every document indexed to the data stream. + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * 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); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DataStreamTimestampField}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private String name; + + /** + * Required - Name of the timestamp field for the data stream, which must be + * @timestamp. The @timestamp field must be included + * in every document indexed to the data stream. + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DataStreamTimestampField}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DataStreamTimestampField build() { + _checkSingleUse(); + + return new DataStreamTimestampField(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DataStreamTimestampField} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DataStreamTimestampField::setupDataStreamTimestampFieldDeserializer); + + protected static void setupDataStreamTimestampFieldDeserializer( + ObjectDeserializer op) { + + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamVisibility.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamVisibility.java new file mode 100644 index 000000000..67c9a6b4c --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamVisibility.java @@ -0,0 +1,150 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.DataStreamVisibility + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DataStreamVisibility implements JsonpSerializable { + @Nullable + private final Boolean hidden; + + // --------------------------------------------------------------------------------------------- + + private DataStreamVisibility(Builder builder) { + + this.hidden = builder.hidden; + + } + + public static DataStreamVisibility of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code hidden} + */ + @Nullable + public final Boolean hidden() { + return this.hidden; + } + + /** + * 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 (this.hidden != null) { + generator.writeKey("hidden"); + generator.write(this.hidden); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DataStreamVisibility}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Boolean hidden; + + /** + * API name: {@code hidden} + */ + public final Builder hidden(@Nullable Boolean value) { + this.hidden = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DataStreamVisibility}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DataStreamVisibility build() { + _checkSingleUse(); + + return new DataStreamVisibility(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DataStreamVisibility} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DataStreamVisibility::setupDataStreamVisibilityDeserializer); + + protected static void setupDataStreamVisibilityDeserializer(ObjectDeserializer op) { + + op.add(Builder::hidden, JsonpDeserializer.booleanDeserializer(), "hidden"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsRequest.java new file mode 100644 index 000000000..678a91d9b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsRequest.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +import co.elastic.clients.elasticsearch._types.RequestBase; +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; + +// typedef: indices.data_streams_stats.Request + +/** + * Retrieves statistics for one or more data streams. + * + * @see API + * specification + */ + +public class DataStreamsStatsRequest extends RequestBase { + private final List expandWildcards; + + @Nullable + private final String name; + + // --------------------------------------------------------------------------------------------- + + private DataStreamsStatsRequest(Builder builder) { + + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.name = builder.name; + + } + + public static DataStreamsStatsRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values, such as open,hidden. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * Comma-separated list of data streams used to limit the request. Wildcard + * expressions (*) are supported. To target all data streams in a + * cluster, omit this parameter or use *. + *

+ * API name: {@code name} + */ + @Nullable + public final String name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DataStreamsStatsRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private List expandWildcards; + + @Nullable + private String name; + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values, such as open,hidden. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values, such as open,hidden. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * Comma-separated list of data streams used to limit the request. Wildcard + * expressions (*) are supported. To target all data streams in a + * cluster, omit this parameter or use *. + *

+ * API name: {@code name} + */ + public final Builder name(@Nullable String value) { + this.name = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DataStreamsStatsRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DataStreamsStatsRequest build() { + _checkSingleUse(); + + return new DataStreamsStatsRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.data_streams_stats}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.data_streams_stats", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + if (request.name() != null) + propsSet |= _name; + + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_data_stream"); + buf.append("/_stats"); + return buf.toString(); + } + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_data_stream"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + buf.append("/_stats"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + if (request.name() != null) + propsSet |= _name; + + if (propsSet == 0) { + } + if (propsSet == (_name)) { + params.put("name", request.name); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, DataStreamsStatsResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsResponse.java new file mode 100644 index 000000000..1ac433188 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DataStreamsStatsResponse.java @@ -0,0 +1,348 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ShardStatistics; +import co.elastic.clients.elasticsearch.indices.data_streams_stats.DataStreamsStatsItem; +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.Integer; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.data_streams_stats.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DataStreamsStatsResponse implements JsonpSerializable { + private final ShardStatistics shards; + + private final int backingIndices; + + private final int dataStreamCount; + + private final List dataStreams; + + @Nullable + private final String totalStoreSizes; + + private final int totalStoreSizeBytes; + + // --------------------------------------------------------------------------------------------- + + private DataStreamsStatsResponse(Builder builder) { + + this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards"); + this.backingIndices = ApiTypeHelper.requireNonNull(builder.backingIndices, this, "backingIndices"); + this.dataStreamCount = ApiTypeHelper.requireNonNull(builder.dataStreamCount, this, "dataStreamCount"); + this.dataStreams = ApiTypeHelper.unmodifiableRequired(builder.dataStreams, this, "dataStreams"); + this.totalStoreSizes = builder.totalStoreSizes; + this.totalStoreSizeBytes = ApiTypeHelper.requireNonNull(builder.totalStoreSizeBytes, this, + "totalStoreSizeBytes"); + + } + + public static DataStreamsStatsResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Contains information about shards that attempted to execute the + * request. + *

+ * API name: {@code _shards} + */ + public final ShardStatistics shards() { + return this.shards; + } + + /** + * Required - Total number of backing indices for the selected data streams. + *

+ * API name: {@code backing_indices} + */ + public final int backingIndices() { + return this.backingIndices; + } + + /** + * Required - Total number of selected data streams. + *

+ * API name: {@code data_stream_count} + */ + public final int dataStreamCount() { + return this.dataStreamCount; + } + + /** + * Required - Contains statistics for the selected data streams. + *

+ * API name: {@code data_streams} + */ + public final List dataStreams() { + return this.dataStreams; + } + + /** + * Total size of all shards for the selected data streams. This property is + * included only if the human query parameter is true + *

+ * API name: {@code total_store_sizes} + */ + @Nullable + public final String totalStoreSizes() { + return this.totalStoreSizes; + } + + /** + * Required - Total size, in bytes, of all shards for the selected data streams. + *

+ * API name: {@code total_store_size_bytes} + */ + public final int totalStoreSizeBytes() { + return this.totalStoreSizeBytes; + } + + /** + * 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("_shards"); + this.shards.serialize(generator, mapper); + + generator.writeKey("backing_indices"); + generator.write(this.backingIndices); + + generator.writeKey("data_stream_count"); + generator.write(this.dataStreamCount); + + if (ApiTypeHelper.isDefined(this.dataStreams)) { + generator.writeKey("data_streams"); + generator.writeStartArray(); + for (DataStreamsStatsItem item0 : this.dataStreams) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.totalStoreSizes != null) { + generator.writeKey("total_store_sizes"); + generator.write(this.totalStoreSizes); + + } + generator.writeKey("total_store_size_bytes"); + generator.write(this.totalStoreSizeBytes); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DataStreamsStatsResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private ShardStatistics shards; + + private Integer backingIndices; + + private Integer dataStreamCount; + + private List dataStreams; + + @Nullable + private String totalStoreSizes; + + private Integer totalStoreSizeBytes; + + /** + * Required - Contains information about shards that attempted to execute the + * request. + *

+ * API name: {@code _shards} + */ + public final Builder shards(ShardStatistics value) { + this.shards = value; + return this; + } + + /** + * Required - Contains information about shards that attempted to execute the + * request. + *

+ * API name: {@code _shards} + */ + public final Builder shards(Function> fn) { + return this.shards(fn.apply(new ShardStatistics.Builder()).build()); + } + + /** + * Required - Total number of backing indices for the selected data streams. + *

+ * API name: {@code backing_indices} + */ + public final Builder backingIndices(int value) { + this.backingIndices = value; + return this; + } + + /** + * Required - Total number of selected data streams. + *

+ * API name: {@code data_stream_count} + */ + public final Builder dataStreamCount(int value) { + this.dataStreamCount = value; + return this; + } + + /** + * Required - Contains statistics for the selected data streams. + *

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

+ * Adds all elements of list to dataStreams. + */ + public final Builder dataStreams(List list) { + this.dataStreams = _listAddAll(this.dataStreams, list); + return this; + } + + /** + * Required - Contains statistics for the selected data streams. + *

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

+ * Adds one or more values to dataStreams. + */ + public final Builder dataStreams(DataStreamsStatsItem value, DataStreamsStatsItem... values) { + this.dataStreams = _listAdd(this.dataStreams, value, values); + return this; + } + + /** + * Required - Contains statistics for the selected data streams. + *

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

+ * Adds a value to dataStreams using a builder lambda. + */ + public final Builder dataStreams( + Function> fn) { + return dataStreams(fn.apply(new DataStreamsStatsItem.Builder()).build()); + } + + /** + * Total size of all shards for the selected data streams. This property is + * included only if the human query parameter is true + *

+ * API name: {@code total_store_sizes} + */ + public final Builder totalStoreSizes(@Nullable String value) { + this.totalStoreSizes = value; + return this; + } + + /** + * Required - Total size, in bytes, of all shards for the selected data streams. + *

+ * API name: {@code total_store_size_bytes} + */ + public final Builder totalStoreSizeBytes(int value) { + this.totalStoreSizeBytes = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DataStreamsStatsResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DataStreamsStatsResponse build() { + _checkSingleUse(); + + return new DataStreamsStatsResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DataStreamsStatsResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DataStreamsStatsResponse::setupDataStreamsStatsResponseDeserializer); + + protected static void setupDataStreamsStatsResponseDeserializer( + ObjectDeserializer op) { + + op.add(Builder::shards, ShardStatistics._DESERIALIZER, "_shards"); + op.add(Builder::backingIndices, JsonpDeserializer.integerDeserializer(), "backing_indices"); + op.add(Builder::dataStreamCount, JsonpDeserializer.integerDeserializer(), "data_stream_count"); + op.add(Builder::dataStreams, JsonpDeserializer.arrayDeserializer(DataStreamsStatsItem._DESERIALIZER), + "data_streams"); + op.add(Builder::totalStoreSizes, JsonpDeserializer.stringDeserializer(), "total_store_sizes"); + op.add(Builder::totalStoreSizeBytes, JsonpDeserializer.integerDeserializer(), "total_store_size_bytes"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteAliasRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteAliasRequest.java new file mode 100644 index 000000000..4c9857640 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteAliasRequest.java @@ -0,0 +1,338 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.delete_alias.Request + +/** + * Removes a data stream or index from an alias. + * + * @see API + * specification + */ + +public class DeleteAliasRequest extends RequestBase { + private final List index; + + @Nullable + private final Time masterTimeout; + + private final List name; + + @Nullable + private final Time timeout; + + // --------------------------------------------------------------------------------------------- + + private DeleteAliasRequest(Builder builder) { + + this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); + this.masterTimeout = builder.masterTimeout; + this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); + this.timeout = builder.timeout; + + } + + public static DeleteAliasRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Comma-separated list of data streams or indices used to limit the + * request. Supports wildcards (*). + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * 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; + } + + /** + * Required - Comma-separated list of aliases to remove. Supports wildcards + * (*). To remove all aliases, use * or + * _all. + *

+ * API name: {@code name} + */ + public final List name() { + return this.name; + } + + /** + * 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 DeleteAliasRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + private List index; + + @Nullable + private Time masterTimeout; + + private List name; + + @Nullable + private Time timeout; + + /** + * Required - Comma-separated list of data streams or indices used to limit the + * request. Supports wildcards (*). + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Required - Comma-separated list of data streams or indices used to limit the + * request. Supports wildcards (*). + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, 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()); + } + + /** + * Required - Comma-separated list of aliases to remove. Supports wildcards + * (*). To remove all aliases, use * or + * _all. + *

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

+ * Adds all elements of list to name. + */ + public final Builder name(List list) { + this.name = _listAddAll(this.name, list); + return this; + } + + /** + * Required - Comma-separated list of aliases to remove. Supports wildcards + * (*). To remove all aliases, use * or + * _all. + *

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

+ * Adds one or more values to name. + */ + public final Builder name(String value, String... values) { + this.name = _listAdd(this.name, value, values); + 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(@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 DeleteAliasRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteAliasRequest build() { + _checkSingleUse(); + + return new DeleteAliasRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.delete_alias}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.delete_alias", + + // Request method + request -> { + return "DELETE"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + final int _index = 1 << 1; + + int propsSet = 0; + + propsSet |= _name; + propsSet |= _index; + + if (propsSet == (_index | _name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_alias"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + if (propsSet == (_index | _name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_aliases"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + final int _index = 1 << 1; + + int propsSet = 0; + + propsSet |= _name; + propsSet |= _index; + + if (propsSet == (_index | _name)) { + params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); + params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); + } + if (propsSet == (_index | _name)) { + params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); + params.put("name", request.name.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, DeleteAliasResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteAliasResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteAliasResponse.java new file mode 100644 index 000000000..56a56443b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteAliasResponse.java @@ -0,0 +1,96 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.delete_alias.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DeleteAliasResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private DeleteAliasResponse(Builder builder) { + super(builder); + + } + + public static DeleteAliasResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteAliasResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteAliasResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteAliasResponse build() { + _checkSingleUse(); + + return new DeleteAliasResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeleteAliasResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DeleteAliasResponse::setupDeleteAliasResponseDeserializer); + + protected static void setupDeleteAliasResponseDeserializer(ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataLifecycleRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataLifecycleRequest.java new file mode 100644 index 000000000..4ab9bbc36 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataLifecycleRequest.java @@ -0,0 +1,318 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +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; + +// typedef: indices.delete_data_lifecycle.Request + +/** + * Removes the data lifecycle from a data stream rendering it not managed by the + * data stream lifecycle + * + * @see API + * specification + */ + +public class DeleteDataLifecycleRequest extends RequestBase { + private final List expandWildcards; + + @Nullable + private final Time masterTimeout; + + private final List name; + + @Nullable + private final Time timeout; + + // --------------------------------------------------------------------------------------------- + + private DeleteDataLifecycleRequest(Builder builder) { + + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.masterTimeout = builder.masterTimeout; + this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); + this.timeout = builder.timeout; + + } + + public static DeleteDataLifecycleRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Whether wildcard expressions should get expanded to open or closed indices + * (default: open) + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * Specify timeout for connection to master + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * Required - A comma-separated list of data streams of which the data stream + * lifecycle will be deleted; use * to get all data streams + *

+ * API name: {@code name} + */ + public final List name() { + return this.name; + } + + /** + * Explicit timestamp for the document + *

+ * API name: {@code timeout} + */ + @Nullable + public final Time timeout() { + return this.timeout; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteDataLifecycleRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private List expandWildcards; + + @Nullable + private Time masterTimeout; + + private List name; + + @Nullable + private Time timeout; + + /** + * Whether wildcard expressions should get expanded to open or closed indices + * (default: open) + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Whether wildcard expressions should get expanded to open or closed indices + * (default: open) + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * Specify timeout for connection to master + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Specify timeout for connection to master + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Required - A comma-separated list of data streams of which the data stream + * lifecycle will be deleted; use * to get all data streams + *

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

+ * Adds all elements of list to name. + */ + public final Builder name(List list) { + this.name = _listAddAll(this.name, list); + return this; + } + + /** + * Required - A comma-separated list of data streams of which the data stream + * lifecycle will be deleted; use * to get all data streams + *

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

+ * Adds one or more values to name. + */ + public final Builder name(String value, String... values) { + this.name = _listAdd(this.name, value, values); + return this; + } + + /** + * Explicit timestamp for the document + *

+ * API name: {@code timeout} + */ + public final Builder timeout(@Nullable Time value) { + this.timeout = value; + return this; + } + + /** + * Explicit timestamp for the document + *

+ * 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 DeleteDataLifecycleRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteDataLifecycleRequest build() { + _checkSingleUse(); + + return new DeleteDataLifecycleRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.delete_data_lifecycle}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.delete_data_lifecycle", + + // Request method + request -> { + return "DELETE"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_data_stream"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_lifecycle"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name.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 (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, DeleteDataLifecycleResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataLifecycleResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataLifecycleResponse.java new file mode 100644 index 000000000..86ab655f3 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataLifecycleResponse.java @@ -0,0 +1,98 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.delete_data_lifecycle.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DeleteDataLifecycleResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private DeleteDataLifecycleResponse(Builder builder) { + super(builder); + + } + + public static DeleteDataLifecycleResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteDataLifecycleResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteDataLifecycleResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteDataLifecycleResponse build() { + _checkSingleUse(); + + return new DeleteDataLifecycleResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeleteDataLifecycleResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DeleteDataLifecycleResponse::setupDeleteDataLifecycleResponseDeserializer); + + protected static void setupDeleteDataLifecycleResponseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataStreamRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataStreamRequest.java new file mode 100644 index 000000000..1e5f101b3 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataStreamRequest.java @@ -0,0 +1,237 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +import co.elastic.clients.elasticsearch._types.RequestBase; +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; + +// typedef: indices.delete_data_stream.Request + +/** + * Deletes one or more data streams and their backing indices. + * + * @see API + * specification + */ + +public class DeleteDataStreamRequest extends RequestBase { + private final List expandWildcards; + + private final List name; + + // --------------------------------------------------------------------------------------------- + + private DeleteDataStreamRequest(Builder builder) { + + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); + + } + + public static DeleteDataStreamRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values,such as open,hidden. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * Required - Comma-separated list of data streams to delete. Wildcard + * (*) expressions are supported. + *

+ * API name: {@code name} + */ + public final List name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteDataStreamRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private List expandWildcards; + + private List name; + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values,such as open,hidden. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values,such as open,hidden. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * Required - Comma-separated list of data streams to delete. Wildcard + * (*) expressions are supported. + *

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

+ * Adds all elements of list to name. + */ + public final Builder name(List list) { + this.name = _listAddAll(this.name, list); + return this; + } + + /** + * Required - Comma-separated list of data streams to delete. Wildcard + * (*) expressions are supported. + *

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

+ * Adds one or more values to name. + */ + public final Builder name(String value, String... values) { + this.name = _listAdd(this.name, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteDataStreamRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteDataStreamRequest build() { + _checkSingleUse(); + + return new DeleteDataStreamRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.delete_data_stream}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.delete_data_stream", + + // Request method + request -> { + return "DELETE"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_data_stream"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, DeleteDataStreamResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataStreamResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataStreamResponse.java new file mode 100644 index 000000000..5429591b1 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteDataStreamResponse.java @@ -0,0 +1,98 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.delete_data_stream.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DeleteDataStreamResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private DeleteDataStreamResponse(Builder builder) { + super(builder); + + } + + public static DeleteDataStreamResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteDataStreamResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteDataStreamResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteDataStreamResponse build() { + _checkSingleUse(); + + return new DeleteDataStreamResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeleteDataStreamResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DeleteDataStreamResponse::setupDeleteDataStreamResponseDeserializer); + + protected static void setupDeleteDataStreamResponseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexRequest.java new file mode 100644 index 000000000..6247195db --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexRequest.java @@ -0,0 +1,410 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +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.Boolean; +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; + +// typedef: indices.delete.Request + +/** + * Deletes one or more indices. + * + * @see API + * specification + */ + +public class DeleteIndexRequest extends RequestBase { + @Nullable + private final Boolean allowNoIndices; + + private final List expandWildcards; + + @Nullable + private final Boolean ignoreUnavailable; + + private final List index; + + @Nullable + private final Time masterTimeout; + + @Nullable + private final Time timeout; + + // --------------------------------------------------------------------------------------------- + + private DeleteIndexRequest(Builder builder) { + + this.allowNoIndices = builder.allowNoIndices; + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.ignoreUnavailable = builder.ignoreUnavailable; + this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); + this.masterTimeout = builder.masterTimeout; + this.timeout = builder.timeout; + + } + + public static DeleteIndexRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. + *

+ * API name: {@code allow_no_indices} + */ + @Nullable + public final Boolean allowNoIndices() { + return this.allowNoIndices; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * If false, the request returns an error if it targets a missing + * or closed index. + *

+ * API name: {@code ignore_unavailable} + */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + + /** + * Required - Comma-separated list of indices to delete. You cannot specify + * index aliases. By default, this parameter does not support wildcards + * (*) or _all. To use wildcards or _all, + * set the action.destructive_requires_name cluster setting to + * false. + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * 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 DeleteIndexRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean allowNoIndices; + + @Nullable + private List expandWildcards; + + @Nullable + private Boolean ignoreUnavailable; + + private List index; + + @Nullable + private Time masterTimeout; + + @Nullable + private Time timeout; + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. + *

+ * API name: {@code allow_no_indices} + */ + public final Builder allowNoIndices(@Nullable Boolean value) { + this.allowNoIndices = value; + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * If false, the request returns an error if it targets a missing + * or closed index. + *

+ * API name: {@code ignore_unavailable} + */ + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + + /** + * Required - Comma-separated list of indices to delete. You cannot specify + * index aliases. By default, this parameter does not support wildcards + * (*) or _all. To use wildcards or _all, + * set the action.destructive_requires_name cluster setting to + * false. + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Required - Comma-separated list of indices to delete. You cannot specify + * index aliases. By default, this parameter does not support wildcards + * (*) or _all. To use wildcards or _all, + * set the action.destructive_requires_name cluster setting to + * false. + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, 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 DeleteIndexRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteIndexRequest build() { + _checkSingleUse(); + + return new DeleteIndexRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.delete}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.delete", + + // Request method + request -> { + return "DELETE"; + + }, + + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + params.put("index", request.index.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 (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); + } + if (request.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); + } + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, DeleteIndexResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexResponse.java new file mode 100644 index 000000000..3370b1d56 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexResponse.java @@ -0,0 +1,96 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.IndicesResponseBase; +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; + +// typedef: indices.delete.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DeleteIndexResponse extends IndicesResponseBase { + // --------------------------------------------------------------------------------------------- + + private DeleteIndexResponse(Builder builder) { + super(builder); + + } + + public static DeleteIndexResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteIndexResponse}. + */ + + public static class Builder extends IndicesResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteIndexResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteIndexResponse build() { + _checkSingleUse(); + + return new DeleteIndexResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeleteIndexResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DeleteIndexResponse::setupDeleteIndexResponseDeserializer); + + protected static void setupDeleteIndexResponseDeserializer(ObjectDeserializer op) { + IndicesResponseBase.setupIndicesResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexTemplateRequest.java new file mode 100644 index 000000000..6c3516d64 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexTemplateRequest.java @@ -0,0 +1,278 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.delete_index_template.Request + +/** + * The provided <index-template> may contain multiple template names + * separated by a comma. If multiple template names are specified then there is + * no wildcard support and the provided names should match completely with + * existing templates. + * + * @see API + * specification + */ + +public class DeleteIndexTemplateRequest extends RequestBase { + @Nullable + private final Time masterTimeout; + + private final List name; + + @Nullable + private final Time timeout; + + // --------------------------------------------------------------------------------------------- + + private DeleteIndexTemplateRequest(Builder builder) { + + this.masterTimeout = builder.masterTimeout; + this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); + this.timeout = builder.timeout; + + } + + public static DeleteIndexTemplateRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * 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; + } + + /** + * Required - Comma-separated list of index template names used to limit the + * request. Wildcard (*) expressions are supported. + *

+ * API name: {@code name} + */ + public final List name() { + return this.name; + } + + /** + * 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 DeleteIndexTemplateRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Time masterTimeout; + + private List name; + + @Nullable + private Time timeout; + + /** + * 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()); + } + + /** + * Required - Comma-separated list of index template names used to limit the + * request. Wildcard (*) expressions are supported. + *

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

+ * Adds all elements of list to name. + */ + public final Builder name(List list) { + this.name = _listAddAll(this.name, list); + return this; + } + + /** + * Required - Comma-separated list of index template names used to limit the + * request. Wildcard (*) expressions are supported. + *

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

+ * Adds one or more values to name. + */ + public final Builder name(String value, String... values) { + this.name = _listAdd(this.name, value, values); + 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(@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 DeleteIndexTemplateRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteIndexTemplateRequest build() { + _checkSingleUse(); + + return new DeleteIndexTemplateRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.delete_index_template}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.delete_index_template", + + // Request method + request -> { + return "DELETE"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_index_template"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name.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, DeleteIndexTemplateResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexTemplateResponse.java new file mode 100644 index 000000000..fada7580b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteIndexTemplateResponse.java @@ -0,0 +1,98 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.delete_index_template.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DeleteIndexTemplateResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private DeleteIndexTemplateResponse(Builder builder) { + super(builder); + + } + + public static DeleteIndexTemplateResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteIndexTemplateResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteIndexTemplateResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteIndexTemplateResponse build() { + _checkSingleUse(); + + return new DeleteIndexTemplateResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeleteIndexTemplateResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DeleteIndexTemplateResponse::setupDeleteIndexTemplateResponseDeserializer); + + protected static void setupDeleteIndexTemplateResponseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteTemplateRequest.java new file mode 100644 index 000000000..20971b748 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteTemplateRequest.java @@ -0,0 +1,257 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.delete_template.Request + +/** + * Deletes a legacy index template. + * + * @see API + * specification + */ + +public class DeleteTemplateRequest extends RequestBase { + @Nullable + private final Time masterTimeout; + + private final String name; + + @Nullable + private final Time timeout; + + // --------------------------------------------------------------------------------------------- + + private DeleteTemplateRequest(Builder builder) { + + this.masterTimeout = builder.masterTimeout; + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.timeout = builder.timeout; + + } + + public static DeleteTemplateRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * 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; + } + + /** + * Required - The name of the legacy index template to delete. Wildcard + * (*) expressions are supported. + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * 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 DeleteTemplateRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Time masterTimeout; + + private String name; + + @Nullable + private Time timeout; + + /** + * 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()); + } + + /** + * Required - The name of the legacy index template to delete. Wildcard + * (*) expressions are supported. + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = 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(@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 DeleteTemplateRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteTemplateRequest build() { + _checkSingleUse(); + + return new DeleteTemplateRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.delete_template}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.delete_template", + + // Request method + request -> { + return "DELETE"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_template"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name); + } + 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, DeleteTemplateResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteTemplateResponse.java new file mode 100644 index 000000000..4a5dbdb5f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DeleteTemplateResponse.java @@ -0,0 +1,98 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.delete_template.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DeleteTemplateResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private DeleteTemplateResponse(Builder builder) { + super(builder); + + } + + public static DeleteTemplateResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DeleteTemplateResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DeleteTemplateResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DeleteTemplateResponse build() { + _checkSingleUse(); + + return new DeleteTemplateResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DeleteTemplateResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DeleteTemplateResponse::setupDeleteTemplateResponseDeserializer); + + protected static void setupDeleteTemplateResponseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DiskUsageRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DiskUsageRequest.java new file mode 100644 index 000000000..c1ba4255c --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DiskUsageRequest.java @@ -0,0 +1,383 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +import co.elastic.clients.elasticsearch._types.RequestBase; +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.Boolean; +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; + +// typedef: indices.disk_usage.Request + +/** + * Analyzes the disk usage of each field of an index or data stream. + * + * @see API + * specification + */ + +public class DiskUsageRequest extends RequestBase { + @Nullable + private final Boolean allowNoIndices; + + private final List expandWildcards; + + @Nullable + private final Boolean flush; + + @Nullable + private final Boolean ignoreUnavailable; + + private final List index; + + @Nullable + private final Boolean runExpensiveTasks; + + // --------------------------------------------------------------------------------------------- + + private DiskUsageRequest(Builder builder) { + + this.allowNoIndices = builder.allowNoIndices; + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.flush = builder.flush; + this.ignoreUnavailable = builder.ignoreUnavailable; + this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); + this.runExpensiveTasks = builder.runExpensiveTasks; + + } + + public static DiskUsageRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If false, the request returns an error if any wildcard expression, index + * alias, or _all value targets only missing or closed indices. + * This behavior applies even if the request targets other open indices. For + * example, a request targeting foo*,bar* returns an error if an + * index starts with foo but no index starts with bar. + *

+ * API name: {@code allow_no_indices} + */ + @Nullable + public final Boolean allowNoIndices() { + return this.allowNoIndices; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * If true, the API performs a flush before analysis. If + * false, the response may not include uncommitted data. + *

+ * API name: {@code flush} + */ + @Nullable + public final Boolean flush() { + return this.flush; + } + + /** + * If true, missing or closed indices are not included in the + * response. + *

+ * API name: {@code ignore_unavailable} + */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + + /** + * Required - Comma-separated list of data streams, indices, and aliases used to + * limit the request. It’s recommended to execute this API with a single index + * (or the latest backing index of a data stream) as the API consumes resources + * significantly. + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * Analyzing field disk usage is resource-intensive. To use the API, this + * parameter must be set to true. + *

+ * API name: {@code run_expensive_tasks} + */ + @Nullable + public final Boolean runExpensiveTasks() { + return this.runExpensiveTasks; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DiskUsageRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean allowNoIndices; + + @Nullable + private List expandWildcards; + + @Nullable + private Boolean flush; + + @Nullable + private Boolean ignoreUnavailable; + + private List index; + + @Nullable + private Boolean runExpensiveTasks; + + /** + * If false, the request returns an error if any wildcard expression, index + * alias, or _all value targets only missing or closed indices. + * This behavior applies even if the request targets other open indices. For + * example, a request targeting foo*,bar* returns an error if an + * index starts with foo but no index starts with bar. + *

+ * API name: {@code allow_no_indices} + */ + public final Builder allowNoIndices(@Nullable Boolean value) { + this.allowNoIndices = value; + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * If true, the API performs a flush before analysis. If + * false, the response may not include uncommitted data. + *

+ * API name: {@code flush} + */ + public final Builder flush(@Nullable Boolean value) { + this.flush = value; + return this; + } + + /** + * If true, missing or closed indices are not included in the + * response. + *

+ * API name: {@code ignore_unavailable} + */ + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + + /** + * Required - Comma-separated list of data streams, indices, and aliases used to + * limit the request. It’s recommended to execute this API with a single index + * (or the latest backing index of a data stream) as the API consumes resources + * significantly. + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Required - Comma-separated list of data streams, indices, and aliases used to + * limit the request. It’s recommended to execute this API with a single index + * (or the latest backing index of a data stream) as the API consumes resources + * significantly. + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); + return this; + } + + /** + * Analyzing field disk usage is resource-intensive. To use the API, this + * parameter must be set to true. + *

+ * API name: {@code run_expensive_tasks} + */ + public final Builder runExpensiveTasks(@Nullable Boolean value) { + this.runExpensiveTasks = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DiskUsageRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DiskUsageRequest build() { + _checkSingleUse(); + + return new DiskUsageRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.disk_usage}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.disk_usage", + + // Request method + request -> { + return "POST"; + + }, + + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_disk_usage"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.flush != null) { + params.put("flush", String.valueOf(request.flush)); + } + if (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); + } + if (request.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); + } + if (request.runExpensiveTasks != null) { + params.put("run_expensive_tasks", String.valueOf(request.runExpensiveTasks)); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, DiskUsageResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DiskUsageResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DiskUsageResponse.java new file mode 100644 index 000000000..15e884ebb --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/DiskUsageResponse.java @@ -0,0 +1,138 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.json.JsonData; +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 jakarta.json.stream.JsonParser; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.disk_usage.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DiskUsageResponse implements JsonpSerializable { + private final JsonData valueBody; + + // --------------------------------------------------------------------------------------------- + + private DiskUsageResponse(Builder builder) { + + this.valueBody = ApiTypeHelper.requireNonNull(builder.valueBody, this, "valueBody"); + + } + + public static DiskUsageResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Response value. + */ + public final JsonData valueBody() { + return this.valueBody; + } + + /** + * Serialize this value to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + this.valueBody.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DiskUsageResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private JsonData valueBody; + + /** + * Required - Response value. + */ + public final Builder valueBody(JsonData value) { + this.valueBody = value; + return this; + } + + @Override + public Builder withJson(JsonParser parser, JsonpMapper mapper) { + + @SuppressWarnings("unchecked") + JsonData value = (JsonData) JsonData._DESERIALIZER.deserialize(parser, mapper); + return this.valueBody(value); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DiskUsageResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DiskUsageResponse build() { + _checkSingleUse(); + + return new DiskUsageResponse(this); + } + } + + public static final JsonpDeserializer _DESERIALIZER = createDiskUsageResponseDeserializer(); + protected static JsonpDeserializer createDiskUsageResponseDeserializer() { + + JsonpDeserializer valueDeserializer = JsonData._DESERIALIZER; + + return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() + .valueBody(valueDeserializer.deserialize(parser, mapper, event)).build()); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java new file mode 100644 index 000000000..e0689a0a5 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesAsyncClient.java @@ -0,0 +1,1480 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.ApiClient; +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.transport.ElasticsearchTransport; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.JsonEndpoint; +import co.elastic.clients.transport.Transport; +import co.elastic.clients.transport.TransportOptions; +import co.elastic.clients.transport.endpoints.BooleanResponse; +import co.elastic.clients.util.ObjectBuilder; +import java.util.concurrent.CompletableFuture; +import java.util.function.Function; +import javax.annotation.Nullable; + +/** + * Client for the indices namespace. + */ +public class ElasticsearchIndicesAsyncClient + extends + ApiClient { + + public ElasticsearchIndicesAsyncClient(ElasticsearchTransport transport) { + super(transport, null); + } + + public ElasticsearchIndicesAsyncClient(ElasticsearchTransport transport, + @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + @Override + public ElasticsearchIndicesAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) { + return new ElasticsearchIndicesAsyncClient(this.transport, transportOptions); + } + + // ----- Endpoint: indices.analyze + + /** + * Performs the analysis process on a text and return the tokens breakdown of + * the text. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture analyze(AnalyzeRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) AnalyzeRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Performs the analysis process on a text and return the tokens breakdown of + * the text. + * + * @param fn + * a function that initializes a builder to create the + * {@link AnalyzeRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture analyze( + Function> fn) { + return analyze(fn.apply(new AnalyzeRequest.Builder()).build()); + } + + /** + * Performs the analysis process on a text and return the tokens breakdown of + * the text. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture analyze() { + return this.transport.performRequestAsync(new AnalyzeRequest.Builder().build(), AnalyzeRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: indices.create + + /** + * Creates an index with optional settings and mappings. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture create(CreateIndexRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) CreateIndexRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Creates an index with optional settings and mappings. + * + * @param fn + * a function that initializes a builder to create the + * {@link CreateIndexRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture create( + Function> fn) { + return create(fn.apply(new CreateIndexRequest.Builder()).build()); + } + + // ----- Endpoint: indices.create_data_stream + + /** + * Creates a data stream + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture createDataStream(CreateDataStreamRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) CreateDataStreamRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Creates a data stream + * + * @param fn + * a function that initializes a builder to create the + * {@link CreateDataStreamRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture createDataStream( + Function> fn) { + return createDataStream(fn.apply(new CreateDataStreamRequest.Builder()).build()); + } + + // ----- Endpoint: indices.data_streams_stats + + /** + * Provides statistics on operations happening in a data stream. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture dataStreamsStats(DataStreamsStatsRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DataStreamsStatsRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Provides statistics on operations happening in a data stream. + * + * @param fn + * a function that initializes a builder to create the + * {@link DataStreamsStatsRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture dataStreamsStats( + Function> fn) { + return dataStreamsStats(fn.apply(new DataStreamsStatsRequest.Builder()).build()); + } + + /** + * Provides statistics on operations happening in a data stream. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture dataStreamsStats() { + return this.transport.performRequestAsync(new DataStreamsStatsRequest.Builder().build(), + DataStreamsStatsRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: indices.delete + + /** + * Deletes an index. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture delete(DeleteIndexRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteIndexRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Deletes an index. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteIndexRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture delete( + Function> fn) { + return delete(fn.apply(new DeleteIndexRequest.Builder()).build()); + } + + // ----- Endpoint: indices.delete_alias + + /** + * Deletes an alias. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture deleteAlias(DeleteAliasRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteAliasRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Deletes an alias. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteAliasRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture deleteAlias( + Function> fn) { + return deleteAlias(fn.apply(new DeleteAliasRequest.Builder()).build()); + } + + // ----- Endpoint: indices.delete_data_lifecycle + + /** + * Deletes the data stream lifecycle of the selected data streams. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture deleteDataLifecycle(DeleteDataLifecycleRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteDataLifecycleRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Deletes the data stream lifecycle of the selected data streams. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteDataLifecycleRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture deleteDataLifecycle( + Function> fn) { + return deleteDataLifecycle(fn.apply(new DeleteDataLifecycleRequest.Builder()).build()); + } + + // ----- Endpoint: indices.delete_data_stream + + /** + * Deletes a data stream. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture deleteDataStream(DeleteDataStreamRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteDataStreamRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Deletes a data stream. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteDataStreamRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture deleteDataStream( + Function> fn) { + return deleteDataStream(fn.apply(new DeleteDataStreamRequest.Builder()).build()); + } + + // ----- Endpoint: indices.delete_index_template + + /** + * Deletes an index template. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture deleteIndexTemplate(DeleteIndexTemplateRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteIndexTemplateRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Deletes an index template. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteIndexTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture deleteIndexTemplate( + Function> fn) { + return deleteIndexTemplate(fn.apply(new DeleteIndexTemplateRequest.Builder()).build()); + } + + // ----- Endpoint: indices.delete_template + + /** + * Deletes an index template. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture deleteTemplate(DeleteTemplateRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteTemplateRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Deletes an index template. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture deleteTemplate( + Function> fn) { + return deleteTemplate(fn.apply(new DeleteTemplateRequest.Builder()).build()); + } + + // ----- Endpoint: indices.disk_usage + + /** + * Analyzes the disk usage of each field of an index or data stream + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture diskUsage(DiskUsageRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DiskUsageRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Analyzes the disk usage of each field of an index or data stream + * + * @param fn + * a function that initializes a builder to create the + * {@link DiskUsageRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture diskUsage( + Function> fn) { + return diskUsage(fn.apply(new DiskUsageRequest.Builder()).build()); + } + + // ----- Endpoint: indices.exists + + /** + * Returns information about whether a particular index exists. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture exists(ExistsRequest request) { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) ExistsRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns information about whether a particular index exists. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExistsRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture exists( + Function> fn) { + return exists(fn.apply(new ExistsRequest.Builder()).build()); + } + + // ----- Endpoint: indices.exists_alias + + /** + * Returns information about whether a particular alias exists. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture existsAlias(ExistsAliasRequest request) { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) ExistsAliasRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns information about whether a particular alias exists. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExistsAliasRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture existsAlias( + Function> fn) { + return existsAlias(fn.apply(new ExistsAliasRequest.Builder()).build()); + } + + // ----- Endpoint: indices.exists_index_template + + /** + * Returns information about whether a particular index template exists. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture existsIndexTemplate(ExistsIndexTemplateRequest request) { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) ExistsIndexTemplateRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns information about whether a particular index template exists. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExistsIndexTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture existsIndexTemplate( + Function> fn) { + return existsIndexTemplate(fn.apply(new ExistsIndexTemplateRequest.Builder()).build()); + } + + // ----- Endpoint: indices.exists_template + + /** + * Returns information about whether a particular index template exists. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture existsTemplate(ExistsTemplateRequest request) { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) ExistsTemplateRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns information about whether a particular index template exists. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExistsTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture existsTemplate( + Function> fn) { + return existsTemplate(fn.apply(new ExistsTemplateRequest.Builder()).build()); + } + + // ----- Endpoint: indices.explain_data_lifecycle + + /** + * Retrieves information about the index's current data stream lifecycle, such + * as any potential encountered error, time since creation etc. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture explainDataLifecycle(ExplainDataLifecycleRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ExplainDataLifecycleRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Retrieves information about the index's current data stream lifecycle, such + * as any potential encountered error, time since creation etc. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExplainDataLifecycleRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture explainDataLifecycle( + Function> fn) { + return explainDataLifecycle(fn.apply(new ExplainDataLifecycleRequest.Builder()).build()); + } + + // ----- Endpoint: indices.get + + /** + * Returns information about one or more indices. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture get(GetIndexRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetIndexRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns information about one or more indices. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetIndexRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture get( + Function> fn) { + return get(fn.apply(new GetIndexRequest.Builder()).build()); + } + + // ----- Endpoint: indices.get_alias + + /** + * Returns an alias. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getAlias(GetAliasRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetAliasRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns an alias. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetAliasRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture getAlias( + Function> fn) { + return getAlias(fn.apply(new GetAliasRequest.Builder()).build()); + } + + /** + * Returns an alias. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getAlias() { + return this.transport.performRequestAsync(new GetAliasRequest.Builder().build(), GetAliasRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: indices.get_data_lifecycle + + /** + * Returns the data stream lifecycle of the selected data streams. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getDataLifecycle(GetDataLifecycleRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetDataLifecycleRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns the data stream lifecycle of the selected data streams. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetDataLifecycleRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture getDataLifecycle( + Function> fn) { + return getDataLifecycle(fn.apply(new GetDataLifecycleRequest.Builder()).build()); + } + + // ----- Endpoint: indices.get_data_stream + + /** + * Returns data streams. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getDataStream(GetDataStreamRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetDataStreamRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns data streams. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetDataStreamRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture getDataStream( + Function> fn) { + return getDataStream(fn.apply(new GetDataStreamRequest.Builder()).build()); + } + + /** + * Returns data streams. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getDataStream() { + return this.transport.performRequestAsync(new GetDataStreamRequest.Builder().build(), + GetDataStreamRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: indices.get_index_template + + /** + * Returns an index template. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getIndexTemplate(GetIndexTemplateRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetIndexTemplateRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns an index template. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetIndexTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture getIndexTemplate( + Function> fn) { + return getIndexTemplate(fn.apply(new GetIndexTemplateRequest.Builder()).build()); + } + + /** + * Returns an index template. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getIndexTemplate() { + return this.transport.performRequestAsync(new GetIndexTemplateRequest.Builder().build(), + GetIndexTemplateRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: indices.get_mapping + + /** + * Returns mappings for one or more indices. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getMapping(GetMappingRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetMappingRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns mappings for one or more indices. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetMappingRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture getMapping( + Function> fn) { + return getMapping(fn.apply(new GetMappingRequest.Builder()).build()); + } + + /** + * Returns mappings for one or more indices. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getMapping() { + return this.transport.performRequestAsync(new GetMappingRequest.Builder().build(), GetMappingRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: indices.get_settings + + /** + * Returns settings for one or more indices. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getSettings(GetIndicesSettingsRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetIndicesSettingsRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns settings for one or more indices. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetIndicesSettingsRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture getSettings( + Function> fn) { + return getSettings(fn.apply(new GetIndicesSettingsRequest.Builder()).build()); + } + + /** + * Returns settings for one or more indices. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getSettings() { + return this.transport.performRequestAsync(new GetIndicesSettingsRequest.Builder().build(), + GetIndicesSettingsRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: indices.get_template + + /** + * Returns an index template. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getTemplate(GetTemplateRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetTemplateRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns an index template. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture getTemplate( + Function> fn) { + return getTemplate(fn.apply(new GetTemplateRequest.Builder()).build()); + } + + /** + * Returns an index template. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture getTemplate() { + return this.transport.performRequestAsync(new GetTemplateRequest.Builder().build(), + GetTemplateRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: indices.migrate_to_data_stream + + /** + * Migrates an alias to a data stream + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture migrateToDataStream(MigrateToDataStreamRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) MigrateToDataStreamRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Migrates an alias to a data stream + * + * @param fn + * a function that initializes a builder to create the + * {@link MigrateToDataStreamRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture migrateToDataStream( + Function> fn) { + return migrateToDataStream(fn.apply(new MigrateToDataStreamRequest.Builder()).build()); + } + + // ----- Endpoint: indices.modify_data_stream + + /** + * Modifies a data stream + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture modifyDataStream(ModifyDataStreamRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ModifyDataStreamRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Modifies a data stream + * + * @param fn + * a function that initializes a builder to create the + * {@link ModifyDataStreamRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture modifyDataStream( + Function> fn) { + return modifyDataStream(fn.apply(new ModifyDataStreamRequest.Builder()).build()); + } + + // ----- Endpoint: indices.put_alias + + /** + * Creates or updates an alias. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture putAlias(PutAliasRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutAliasRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Creates or updates an alias. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutAliasRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture putAlias( + Function> fn) { + return putAlias(fn.apply(new PutAliasRequest.Builder()).build()); + } + + // ----- Endpoint: indices.put_data_lifecycle + + /** + * Updates the data stream lifecycle of the selected data streams. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture putDataLifecycle(PutDataLifecycleRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutDataLifecycleRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Updates the data stream lifecycle of the selected data streams. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutDataLifecycleRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture putDataLifecycle( + Function> fn) { + return putDataLifecycle(fn.apply(new PutDataLifecycleRequest.Builder()).build()); + } + + // ----- Endpoint: indices.put_index_template + + /** + * Creates or updates an index template. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture putIndexTemplate(PutIndexTemplateRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutIndexTemplateRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Creates or updates an index template. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutIndexTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture putIndexTemplate( + Function> fn) { + return putIndexTemplate(fn.apply(new PutIndexTemplateRequest.Builder()).build()); + } + + // ----- Endpoint: indices.put_mapping + + /** + * Updates the index mappings. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture putMapping(PutMappingRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutMappingRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Updates the index mappings. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutMappingRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture putMapping( + Function> fn) { + return putMapping(fn.apply(new PutMappingRequest.Builder()).build()); + } + + // ----- Endpoint: indices.put_settings + + /** + * Updates the index settings. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture putSettings(PutIndicesSettingsRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutIndicesSettingsRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Updates the index settings. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutIndicesSettingsRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture putSettings( + Function> fn) { + return putSettings(fn.apply(new PutIndicesSettingsRequest.Builder()).build()); + } + + /** + * Updates the index settings. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture putSettings() { + return this.transport.performRequestAsync(new PutIndicesSettingsRequest.Builder().build(), + PutIndicesSettingsRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: indices.put_template + + /** + * Creates or updates an index template. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture putTemplate(PutTemplateRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutTemplateRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Creates or updates an index template. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture putTemplate( + Function> fn) { + return putTemplate(fn.apply(new PutTemplateRequest.Builder()).build()); + } + + // ----- Endpoint: indices.resolve_index + + /** + * Returns information about any matching indices, aliases, and data streams + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture resolveIndex(ResolveIndexRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ResolveIndexRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Returns information about any matching indices, aliases, and data streams + * + * @param fn + * a function that initializes a builder to create the + * {@link ResolveIndexRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture resolveIndex( + Function> fn) { + return resolveIndex(fn.apply(new ResolveIndexRequest.Builder()).build()); + } + + // ----- Endpoint: indices.rollover + + /** + * Updates an alias to point to a new index when the existing index is + * considered to be too large or too old. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture rollover(RolloverRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) RolloverRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Updates an alias to point to a new index when the existing index is + * considered to be too large or too old. + * + * @param fn + * a function that initializes a builder to create the + * {@link RolloverRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture rollover( + Function> fn) { + return rollover(fn.apply(new RolloverRequest.Builder()).build()); + } + + // ----- Endpoint: indices.simulate_index_template + + /** + * Simulate matching the given index name against the index templates in the + * system + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture simulateIndexTemplate( + SimulateIndexTemplateRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) SimulateIndexTemplateRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Simulate matching the given index name against the index templates in the + * system + * + * @param fn + * a function that initializes a builder to create the + * {@link SimulateIndexTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture simulateIndexTemplate( + Function> fn) { + return simulateIndexTemplate(fn.apply(new SimulateIndexTemplateRequest.Builder()).build()); + } + + // ----- Endpoint: indices.simulate_template + + /** + * Simulate resolving the given template name or body + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture simulateTemplate(SimulateTemplateRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) SimulateTemplateRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Simulate resolving the given template name or body + * + * @param fn + * a function that initializes a builder to create the + * {@link SimulateTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture simulateTemplate( + Function> fn) { + return simulateTemplate(fn.apply(new SimulateTemplateRequest.Builder()).build()); + } + + /** + * Simulate resolving the given template name or body + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture simulateTemplate() { + return this.transport.performRequestAsync(new SimulateTemplateRequest.Builder().build(), + SimulateTemplateRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: indices.update_aliases + + /** + * Updates index aliases. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture updateAliases(UpdateAliasesRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) UpdateAliasesRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Updates index aliases. + * + * @param fn + * a function that initializes a builder to create the + * {@link UpdateAliasesRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture updateAliases( + Function> fn) { + return updateAliases(fn.apply(new UpdateAliasesRequest.Builder()).build()); + } + + /** + * Updates index aliases. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture updateAliases() { + return this.transport.performRequestAsync(new UpdateAliasesRequest.Builder().build(), + UpdateAliasesRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: indices.validate_query + + /** + * Allows a user to validate a potentially expensive query without executing it. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture validateQuery(ValidateQueryRequest request) { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ValidateQueryRequest._ENDPOINT; + + return this.transport.performRequestAsync(request, endpoint, this.transportOptions); + } + + /** + * Allows a user to validate a potentially expensive query without executing it. + * + * @param fn + * a function that initializes a builder to create the + * {@link ValidateQueryRequest} + * @see Documentation + * on elastic.co + */ + + public final CompletableFuture validateQuery( + Function> fn) { + return validateQuery(fn.apply(new ValidateQueryRequest.Builder()).build()); + } + + /** + * Allows a user to validate a potentially expensive query without executing it. + * + * @see Documentation + * on elastic.co + */ + + public CompletableFuture validateQuery() { + return this.transport.performRequestAsync(new ValidateQueryRequest.Builder().build(), + ValidateQueryRequest._ENDPOINT, this.transportOptions); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java new file mode 100644 index 000000000..b6b8e60e1 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ElasticsearchIndicesClient.java @@ -0,0 +1,1524 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.ApiClient; +import co.elastic.clients.elasticsearch._types.ElasticsearchException; +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.transport.ElasticsearchTransport; +import co.elastic.clients.transport.Endpoint; +import co.elastic.clients.transport.JsonEndpoint; +import co.elastic.clients.transport.Transport; +import co.elastic.clients.transport.TransportOptions; +import co.elastic.clients.transport.endpoints.BooleanResponse; +import co.elastic.clients.util.ObjectBuilder; +import java.io.IOException; +import java.util.function.Function; +import javax.annotation.Nullable; + +/** + * Client for the indices namespace. + */ +public class ElasticsearchIndicesClient extends ApiClient { + + public ElasticsearchIndicesClient(ElasticsearchTransport transport) { + super(transport, null); + } + + public ElasticsearchIndicesClient(ElasticsearchTransport transport, @Nullable TransportOptions transportOptions) { + super(transport, transportOptions); + } + + @Override + public ElasticsearchIndicesClient withTransportOptions(@Nullable TransportOptions transportOptions) { + return new ElasticsearchIndicesClient(this.transport, transportOptions); + } + + // ----- Endpoint: indices.analyze + + /** + * Performs the analysis process on a text and return the tokens breakdown of + * the text. + * + * @see Documentation + * on elastic.co + */ + + public AnalyzeResponse analyze(AnalyzeRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) AnalyzeRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Performs the analysis process on a text and return the tokens breakdown of + * the text. + * + * @param fn + * a function that initializes a builder to create the + * {@link AnalyzeRequest} + * @see Documentation + * on elastic.co + */ + + public final AnalyzeResponse analyze(Function> fn) + throws IOException, ElasticsearchException { + return analyze(fn.apply(new AnalyzeRequest.Builder()).build()); + } + + /** + * Performs the analysis process on a text and return the tokens breakdown of + * the text. + * + * @see Documentation + * on elastic.co + */ + + public AnalyzeResponse analyze() throws IOException, ElasticsearchException { + return this.transport.performRequest(new AnalyzeRequest.Builder().build(), AnalyzeRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: indices.create + + /** + * Creates an index with optional settings and mappings. + * + * @see Documentation + * on elastic.co + */ + + public CreateIndexResponse create(CreateIndexRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) CreateIndexRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Creates an index with optional settings and mappings. + * + * @param fn + * a function that initializes a builder to create the + * {@link CreateIndexRequest} + * @see Documentation + * on elastic.co + */ + + public final CreateIndexResponse create(Function> fn) + throws IOException, ElasticsearchException { + return create(fn.apply(new CreateIndexRequest.Builder()).build()); + } + + // ----- Endpoint: indices.create_data_stream + + /** + * Creates a data stream + * + * @see Documentation + * on elastic.co + */ + + public CreateDataStreamResponse createDataStream(CreateDataStreamRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) CreateDataStreamRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Creates a data stream + * + * @param fn + * a function that initializes a builder to create the + * {@link CreateDataStreamRequest} + * @see Documentation + * on elastic.co + */ + + public final CreateDataStreamResponse createDataStream( + Function> fn) + throws IOException, ElasticsearchException { + return createDataStream(fn.apply(new CreateDataStreamRequest.Builder()).build()); + } + + // ----- Endpoint: indices.data_streams_stats + + /** + * Provides statistics on operations happening in a data stream. + * + * @see Documentation + * on elastic.co + */ + + public DataStreamsStatsResponse dataStreamsStats(DataStreamsStatsRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DataStreamsStatsRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Provides statistics on operations happening in a data stream. + * + * @param fn + * a function that initializes a builder to create the + * {@link DataStreamsStatsRequest} + * @see Documentation + * on elastic.co + */ + + public final DataStreamsStatsResponse dataStreamsStats( + Function> fn) + throws IOException, ElasticsearchException { + return dataStreamsStats(fn.apply(new DataStreamsStatsRequest.Builder()).build()); + } + + /** + * Provides statistics on operations happening in a data stream. + * + * @see Documentation + * on elastic.co + */ + + public DataStreamsStatsResponse dataStreamsStats() throws IOException, ElasticsearchException { + return this.transport.performRequest(new DataStreamsStatsRequest.Builder().build(), + DataStreamsStatsRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: indices.delete + + /** + * Deletes an index. + * + * @see Documentation + * on elastic.co + */ + + public DeleteIndexResponse delete(DeleteIndexRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteIndexRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Deletes an index. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteIndexRequest} + * @see Documentation + * on elastic.co + */ + + public final DeleteIndexResponse delete(Function> fn) + throws IOException, ElasticsearchException { + return delete(fn.apply(new DeleteIndexRequest.Builder()).build()); + } + + // ----- Endpoint: indices.delete_alias + + /** + * Deletes an alias. + * + * @see Documentation + * on elastic.co + */ + + public DeleteAliasResponse deleteAlias(DeleteAliasRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteAliasRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Deletes an alias. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteAliasRequest} + * @see Documentation + * on elastic.co + */ + + public final DeleteAliasResponse deleteAlias( + Function> fn) + throws IOException, ElasticsearchException { + return deleteAlias(fn.apply(new DeleteAliasRequest.Builder()).build()); + } + + // ----- Endpoint: indices.delete_data_lifecycle + + /** + * Deletes the data stream lifecycle of the selected data streams. + * + * @see Documentation + * on elastic.co + */ + + public DeleteDataLifecycleResponse deleteDataLifecycle(DeleteDataLifecycleRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteDataLifecycleRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Deletes the data stream lifecycle of the selected data streams. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteDataLifecycleRequest} + * @see Documentation + * on elastic.co + */ + + public final DeleteDataLifecycleResponse deleteDataLifecycle( + Function> fn) + throws IOException, ElasticsearchException { + return deleteDataLifecycle(fn.apply(new DeleteDataLifecycleRequest.Builder()).build()); + } + + // ----- Endpoint: indices.delete_data_stream + + /** + * Deletes a data stream. + * + * @see Documentation + * on elastic.co + */ + + public DeleteDataStreamResponse deleteDataStream(DeleteDataStreamRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteDataStreamRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Deletes a data stream. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteDataStreamRequest} + * @see Documentation + * on elastic.co + */ + + public final DeleteDataStreamResponse deleteDataStream( + Function> fn) + throws IOException, ElasticsearchException { + return deleteDataStream(fn.apply(new DeleteDataStreamRequest.Builder()).build()); + } + + // ----- Endpoint: indices.delete_index_template + + /** + * Deletes an index template. + * + * @see Documentation + * on elastic.co + */ + + public DeleteIndexTemplateResponse deleteIndexTemplate(DeleteIndexTemplateRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteIndexTemplateRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Deletes an index template. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteIndexTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final DeleteIndexTemplateResponse deleteIndexTemplate( + Function> fn) + throws IOException, ElasticsearchException { + return deleteIndexTemplate(fn.apply(new DeleteIndexTemplateRequest.Builder()).build()); + } + + // ----- Endpoint: indices.delete_template + + /** + * Deletes an index template. + * + * @see Documentation + * on elastic.co + */ + + public DeleteTemplateResponse deleteTemplate(DeleteTemplateRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DeleteTemplateRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Deletes an index template. + * + * @param fn + * a function that initializes a builder to create the + * {@link DeleteTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final DeleteTemplateResponse deleteTemplate( + Function> fn) + throws IOException, ElasticsearchException { + return deleteTemplate(fn.apply(new DeleteTemplateRequest.Builder()).build()); + } + + // ----- Endpoint: indices.disk_usage + + /** + * Analyzes the disk usage of each field of an index or data stream + * + * @see Documentation + * on elastic.co + */ + + public DiskUsageResponse diskUsage(DiskUsageRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) DiskUsageRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Analyzes the disk usage of each field of an index or data stream + * + * @param fn + * a function that initializes a builder to create the + * {@link DiskUsageRequest} + * @see Documentation + * on elastic.co + */ + + public final DiskUsageResponse diskUsage(Function> fn) + throws IOException, ElasticsearchException { + return diskUsage(fn.apply(new DiskUsageRequest.Builder()).build()); + } + + // ----- Endpoint: indices.exists + + /** + * Returns information about whether a particular index exists. + * + * @see Documentation + * on elastic.co + */ + + public BooleanResponse exists(ExistsRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) ExistsRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns information about whether a particular index exists. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExistsRequest} + * @see Documentation + * on elastic.co + */ + + public final BooleanResponse exists(Function> fn) + throws IOException, ElasticsearchException { + return exists(fn.apply(new ExistsRequest.Builder()).build()); + } + + // ----- Endpoint: indices.exists_alias + + /** + * Returns information about whether a particular alias exists. + * + * @see Documentation + * on elastic.co + */ + + public BooleanResponse existsAlias(ExistsAliasRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) ExistsAliasRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns information about whether a particular alias exists. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExistsAliasRequest} + * @see Documentation + * on elastic.co + */ + + public final BooleanResponse existsAlias(Function> fn) + throws IOException, ElasticsearchException { + return existsAlias(fn.apply(new ExistsAliasRequest.Builder()).build()); + } + + // ----- Endpoint: indices.exists_index_template + + /** + * Returns information about whether a particular index template exists. + * + * @see Documentation + * on elastic.co + */ + + public BooleanResponse existsIndexTemplate(ExistsIndexTemplateRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) ExistsIndexTemplateRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns information about whether a particular index template exists. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExistsIndexTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final BooleanResponse existsIndexTemplate( + Function> fn) + throws IOException, ElasticsearchException { + return existsIndexTemplate(fn.apply(new ExistsIndexTemplateRequest.Builder()).build()); + } + + // ----- Endpoint: indices.exists_template + + /** + * Returns information about whether a particular index template exists. + * + * @see Documentation + * on elastic.co + */ + + public BooleanResponse existsTemplate(ExistsTemplateRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + Endpoint endpoint = (Endpoint) ExistsTemplateRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns information about whether a particular index template exists. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExistsTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final BooleanResponse existsTemplate( + Function> fn) + throws IOException, ElasticsearchException { + return existsTemplate(fn.apply(new ExistsTemplateRequest.Builder()).build()); + } + + // ----- Endpoint: indices.explain_data_lifecycle + + /** + * Retrieves information about the index's current data stream lifecycle, such + * as any potential encountered error, time since creation etc. + * + * @see Documentation + * on elastic.co + */ + + public ExplainDataLifecycleResponse explainDataLifecycle(ExplainDataLifecycleRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ExplainDataLifecycleRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Retrieves information about the index's current data stream lifecycle, such + * as any potential encountered error, time since creation etc. + * + * @param fn + * a function that initializes a builder to create the + * {@link ExplainDataLifecycleRequest} + * @see Documentation + * on elastic.co + */ + + public final ExplainDataLifecycleResponse explainDataLifecycle( + Function> fn) + throws IOException, ElasticsearchException { + return explainDataLifecycle(fn.apply(new ExplainDataLifecycleRequest.Builder()).build()); + } + + // ----- Endpoint: indices.get + + /** + * Returns information about one or more indices. + * + * @see Documentation + * on elastic.co + */ + + public GetIndexResponse get(GetIndexRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetIndexRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns information about one or more indices. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetIndexRequest} + * @see Documentation + * on elastic.co + */ + + public final GetIndexResponse get(Function> fn) + throws IOException, ElasticsearchException { + return get(fn.apply(new GetIndexRequest.Builder()).build()); + } + + // ----- Endpoint: indices.get_alias + + /** + * Returns an alias. + * + * @see Documentation + * on elastic.co + */ + + public GetAliasResponse getAlias(GetAliasRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetAliasRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns an alias. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetAliasRequest} + * @see Documentation + * on elastic.co + */ + + public final GetAliasResponse getAlias(Function> fn) + throws IOException, ElasticsearchException { + return getAlias(fn.apply(new GetAliasRequest.Builder()).build()); + } + + /** + * Returns an alias. + * + * @see Documentation + * on elastic.co + */ + + public GetAliasResponse getAlias() throws IOException, ElasticsearchException { + return this.transport.performRequest(new GetAliasRequest.Builder().build(), GetAliasRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: indices.get_data_lifecycle + + /** + * Returns the data stream lifecycle of the selected data streams. + * + * @see Documentation + * on elastic.co + */ + + public GetDataLifecycleResponse getDataLifecycle(GetDataLifecycleRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetDataLifecycleRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns the data stream lifecycle of the selected data streams. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetDataLifecycleRequest} + * @see Documentation + * on elastic.co + */ + + public final GetDataLifecycleResponse getDataLifecycle( + Function> fn) + throws IOException, ElasticsearchException { + return getDataLifecycle(fn.apply(new GetDataLifecycleRequest.Builder()).build()); + } + + // ----- Endpoint: indices.get_data_stream + + /** + * Returns data streams. + * + * @see Documentation + * on elastic.co + */ + + public GetDataStreamResponse getDataStream(GetDataStreamRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetDataStreamRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns data streams. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetDataStreamRequest} + * @see Documentation + * on elastic.co + */ + + public final GetDataStreamResponse getDataStream( + Function> fn) + throws IOException, ElasticsearchException { + return getDataStream(fn.apply(new GetDataStreamRequest.Builder()).build()); + } + + /** + * Returns data streams. + * + * @see Documentation + * on elastic.co + */ + + public GetDataStreamResponse getDataStream() throws IOException, ElasticsearchException { + return this.transport.performRequest(new GetDataStreamRequest.Builder().build(), GetDataStreamRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: indices.get_index_template + + /** + * Returns an index template. + * + * @see Documentation + * on elastic.co + */ + + public GetIndexTemplateResponse getIndexTemplate(GetIndexTemplateRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetIndexTemplateRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns an index template. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetIndexTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final GetIndexTemplateResponse getIndexTemplate( + Function> fn) + throws IOException, ElasticsearchException { + return getIndexTemplate(fn.apply(new GetIndexTemplateRequest.Builder()).build()); + } + + /** + * Returns an index template. + * + * @see Documentation + * on elastic.co + */ + + public GetIndexTemplateResponse getIndexTemplate() throws IOException, ElasticsearchException { + return this.transport.performRequest(new GetIndexTemplateRequest.Builder().build(), + GetIndexTemplateRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: indices.get_mapping + + /** + * Returns mappings for one or more indices. + * + * @see Documentation + * on elastic.co + */ + + public GetMappingResponse getMapping(GetMappingRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetMappingRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns mappings for one or more indices. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetMappingRequest} + * @see Documentation + * on elastic.co + */ + + public final GetMappingResponse getMapping(Function> fn) + throws IOException, ElasticsearchException { + return getMapping(fn.apply(new GetMappingRequest.Builder()).build()); + } + + /** + * Returns mappings for one or more indices. + * + * @see Documentation + * on elastic.co + */ + + public GetMappingResponse getMapping() throws IOException, ElasticsearchException { + return this.transport.performRequest(new GetMappingRequest.Builder().build(), GetMappingRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: indices.get_settings + + /** + * Returns settings for one or more indices. + * + * @see Documentation + * on elastic.co + */ + + public GetIndicesSettingsResponse getSettings(GetIndicesSettingsRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetIndicesSettingsRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns settings for one or more indices. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetIndicesSettingsRequest} + * @see Documentation + * on elastic.co + */ + + public final GetIndicesSettingsResponse getSettings( + Function> fn) + throws IOException, ElasticsearchException { + return getSettings(fn.apply(new GetIndicesSettingsRequest.Builder()).build()); + } + + /** + * Returns settings for one or more indices. + * + * @see Documentation + * on elastic.co + */ + + public GetIndicesSettingsResponse getSettings() throws IOException, ElasticsearchException { + return this.transport.performRequest(new GetIndicesSettingsRequest.Builder().build(), + GetIndicesSettingsRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: indices.get_template + + /** + * Returns an index template. + * + * @see Documentation + * on elastic.co + */ + + public GetTemplateResponse getTemplate(GetTemplateRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) GetTemplateRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns an index template. + * + * @param fn + * a function that initializes a builder to create the + * {@link GetTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final GetTemplateResponse getTemplate( + Function> fn) + throws IOException, ElasticsearchException { + return getTemplate(fn.apply(new GetTemplateRequest.Builder()).build()); + } + + /** + * Returns an index template. + * + * @see Documentation + * on elastic.co + */ + + public GetTemplateResponse getTemplate() throws IOException, ElasticsearchException { + return this.transport.performRequest(new GetTemplateRequest.Builder().build(), GetTemplateRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: indices.migrate_to_data_stream + + /** + * Migrates an alias to a data stream + * + * @see Documentation + * on elastic.co + */ + + public MigrateToDataStreamResponse migrateToDataStream(MigrateToDataStreamRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) MigrateToDataStreamRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Migrates an alias to a data stream + * + * @param fn + * a function that initializes a builder to create the + * {@link MigrateToDataStreamRequest} + * @see Documentation + * on elastic.co + */ + + public final MigrateToDataStreamResponse migrateToDataStream( + Function> fn) + throws IOException, ElasticsearchException { + return migrateToDataStream(fn.apply(new MigrateToDataStreamRequest.Builder()).build()); + } + + // ----- Endpoint: indices.modify_data_stream + + /** + * Modifies a data stream + * + * @see Documentation + * on elastic.co + */ + + public ModifyDataStreamResponse modifyDataStream(ModifyDataStreamRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ModifyDataStreamRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Modifies a data stream + * + * @param fn + * a function that initializes a builder to create the + * {@link ModifyDataStreamRequest} + * @see Documentation + * on elastic.co + */ + + public final ModifyDataStreamResponse modifyDataStream( + Function> fn) + throws IOException, ElasticsearchException { + return modifyDataStream(fn.apply(new ModifyDataStreamRequest.Builder()).build()); + } + + // ----- Endpoint: indices.put_alias + + /** + * Creates or updates an alias. + * + * @see Documentation + * on elastic.co + */ + + public PutAliasResponse putAlias(PutAliasRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutAliasRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Creates or updates an alias. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutAliasRequest} + * @see Documentation + * on elastic.co + */ + + public final PutAliasResponse putAlias(Function> fn) + throws IOException, ElasticsearchException { + return putAlias(fn.apply(new PutAliasRequest.Builder()).build()); + } + + // ----- Endpoint: indices.put_data_lifecycle + + /** + * Updates the data stream lifecycle of the selected data streams. + * + * @see Documentation + * on elastic.co + */ + + public PutDataLifecycleResponse putDataLifecycle(PutDataLifecycleRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutDataLifecycleRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Updates the data stream lifecycle of the selected data streams. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutDataLifecycleRequest} + * @see Documentation + * on elastic.co + */ + + public final PutDataLifecycleResponse putDataLifecycle( + Function> fn) + throws IOException, ElasticsearchException { + return putDataLifecycle(fn.apply(new PutDataLifecycleRequest.Builder()).build()); + } + + // ----- Endpoint: indices.put_index_template + + /** + * Creates or updates an index template. + * + * @see Documentation + * on elastic.co + */ + + public PutIndexTemplateResponse putIndexTemplate(PutIndexTemplateRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutIndexTemplateRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Creates or updates an index template. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutIndexTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final PutIndexTemplateResponse putIndexTemplate( + Function> fn) + throws IOException, ElasticsearchException { + return putIndexTemplate(fn.apply(new PutIndexTemplateRequest.Builder()).build()); + } + + // ----- Endpoint: indices.put_mapping + + /** + * Updates the index mappings. + * + * @see Documentation + * on elastic.co + */ + + public PutMappingResponse putMapping(PutMappingRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutMappingRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Updates the index mappings. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutMappingRequest} + * @see Documentation + * on elastic.co + */ + + public final PutMappingResponse putMapping(Function> fn) + throws IOException, ElasticsearchException { + return putMapping(fn.apply(new PutMappingRequest.Builder()).build()); + } + + // ----- Endpoint: indices.put_settings + + /** + * Updates the index settings. + * + * @see Documentation + * on elastic.co + */ + + public PutIndicesSettingsResponse putSettings(PutIndicesSettingsRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutIndicesSettingsRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Updates the index settings. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutIndicesSettingsRequest} + * @see Documentation + * on elastic.co + */ + + public final PutIndicesSettingsResponse putSettings( + Function> fn) + throws IOException, ElasticsearchException { + return putSettings(fn.apply(new PutIndicesSettingsRequest.Builder()).build()); + } + + /** + * Updates the index settings. + * + * @see Documentation + * on elastic.co + */ + + public PutIndicesSettingsResponse putSettings() throws IOException, ElasticsearchException { + return this.transport.performRequest(new PutIndicesSettingsRequest.Builder().build(), + PutIndicesSettingsRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: indices.put_template + + /** + * Creates or updates an index template. + * + * @see Documentation + * on elastic.co + */ + + public PutTemplateResponse putTemplate(PutTemplateRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) PutTemplateRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Creates or updates an index template. + * + * @param fn + * a function that initializes a builder to create the + * {@link PutTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final PutTemplateResponse putTemplate( + Function> fn) + throws IOException, ElasticsearchException { + return putTemplate(fn.apply(new PutTemplateRequest.Builder()).build()); + } + + // ----- Endpoint: indices.resolve_index + + /** + * Returns information about any matching indices, aliases, and data streams + * + * @see Documentation + * on elastic.co + */ + + public ResolveIndexResponse resolveIndex(ResolveIndexRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ResolveIndexRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Returns information about any matching indices, aliases, and data streams + * + * @param fn + * a function that initializes a builder to create the + * {@link ResolveIndexRequest} + * @see Documentation + * on elastic.co + */ + + public final ResolveIndexResponse resolveIndex( + Function> fn) + throws IOException, ElasticsearchException { + return resolveIndex(fn.apply(new ResolveIndexRequest.Builder()).build()); + } + + // ----- Endpoint: indices.rollover + + /** + * Updates an alias to point to a new index when the existing index is + * considered to be too large or too old. + * + * @see Documentation + * on elastic.co + */ + + public RolloverResponse rollover(RolloverRequest request) throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) RolloverRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Updates an alias to point to a new index when the existing index is + * considered to be too large or too old. + * + * @param fn + * a function that initializes a builder to create the + * {@link RolloverRequest} + * @see Documentation + * on elastic.co + */ + + public final RolloverResponse rollover(Function> fn) + throws IOException, ElasticsearchException { + return rollover(fn.apply(new RolloverRequest.Builder()).build()); + } + + // ----- Endpoint: indices.simulate_index_template + + /** + * Simulate matching the given index name against the index templates in the + * system + * + * @see Documentation + * on elastic.co + */ + + public SimulateIndexTemplateResponse simulateIndexTemplate(SimulateIndexTemplateRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) SimulateIndexTemplateRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Simulate matching the given index name against the index templates in the + * system + * + * @param fn + * a function that initializes a builder to create the + * {@link SimulateIndexTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final SimulateIndexTemplateResponse simulateIndexTemplate( + Function> fn) + throws IOException, ElasticsearchException { + return simulateIndexTemplate(fn.apply(new SimulateIndexTemplateRequest.Builder()).build()); + } + + // ----- Endpoint: indices.simulate_template + + /** + * Simulate resolving the given template name or body + * + * @see Documentation + * on elastic.co + */ + + public SimulateTemplateResponse simulateTemplate(SimulateTemplateRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) SimulateTemplateRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Simulate resolving the given template name or body + * + * @param fn + * a function that initializes a builder to create the + * {@link SimulateTemplateRequest} + * @see Documentation + * on elastic.co + */ + + public final SimulateTemplateResponse simulateTemplate( + Function> fn) + throws IOException, ElasticsearchException { + return simulateTemplate(fn.apply(new SimulateTemplateRequest.Builder()).build()); + } + + /** + * Simulate resolving the given template name or body + * + * @see Documentation + * on elastic.co + */ + + public SimulateTemplateResponse simulateTemplate() throws IOException, ElasticsearchException { + return this.transport.performRequest(new SimulateTemplateRequest.Builder().build(), + SimulateTemplateRequest._ENDPOINT, this.transportOptions); + } + + // ----- Endpoint: indices.update_aliases + + /** + * Updates index aliases. + * + * @see Documentation + * on elastic.co + */ + + public UpdateAliasesResponse updateAliases(UpdateAliasesRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) UpdateAliasesRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Updates index aliases. + * + * @param fn + * a function that initializes a builder to create the + * {@link UpdateAliasesRequest} + * @see Documentation + * on elastic.co + */ + + public final UpdateAliasesResponse updateAliases( + Function> fn) + throws IOException, ElasticsearchException { + return updateAliases(fn.apply(new UpdateAliasesRequest.Builder()).build()); + } + + /** + * Updates index aliases. + * + * @see Documentation + * on elastic.co + */ + + public UpdateAliasesResponse updateAliases() throws IOException, ElasticsearchException { + return this.transport.performRequest(new UpdateAliasesRequest.Builder().build(), UpdateAliasesRequest._ENDPOINT, + this.transportOptions); + } + + // ----- Endpoint: indices.validate_query + + /** + * Allows a user to validate a potentially expensive query without executing it. + * + * @see Documentation + * on elastic.co + */ + + public ValidateQueryResponse validateQuery(ValidateQueryRequest request) + throws IOException, ElasticsearchException { + @SuppressWarnings("unchecked") + JsonEndpoint endpoint = (JsonEndpoint) ValidateQueryRequest._ENDPOINT; + + return this.transport.performRequest(request, endpoint, this.transportOptions); + } + + /** + * Allows a user to validate a potentially expensive query without executing it. + * + * @param fn + * a function that initializes a builder to create the + * {@link ValidateQueryRequest} + * @see Documentation + * on elastic.co + */ + + public final ValidateQueryResponse validateQuery( + Function> fn) + throws IOException, ElasticsearchException { + return validateQuery(fn.apply(new ValidateQueryRequest.Builder()).build()); + } + + /** + * Allows a user to validate a potentially expensive query without executing it. + * + * @see Documentation + * on elastic.co + */ + + public ValidateQueryResponse validateQuery() throws IOException, ElasticsearchException { + return this.transport.performRequest(new ValidateQueryRequest.Builder().build(), ValidateQueryRequest._ENDPOINT, + this.transportOptions); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsAliasRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsAliasRequest.java new file mode 100644 index 000000000..f7da54657 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsAliasRequest.java @@ -0,0 +1,415 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +import co.elastic.clients.elasticsearch._types.RequestBase; +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.BooleanEndpoint; +import co.elastic.clients.transport.endpoints.BooleanResponse; +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.Boolean; +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; + +// typedef: indices.exists_alias.Request + +/** + * Checks if an alias exists. + * + * @see API + * specification + */ + +public class ExistsAliasRequest extends RequestBase { + @Nullable + private final Boolean allowNoIndices; + + private final List expandWildcards; + + @Nullable + private final Boolean ignoreUnavailable; + + private final List index; + + @Nullable + private final Boolean local; + + private final List name; + + // --------------------------------------------------------------------------------------------- + + private ExistsAliasRequest(Builder builder) { + + this.allowNoIndices = builder.allowNoIndices; + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.ignoreUnavailable = builder.ignoreUnavailable; + this.index = ApiTypeHelper.unmodifiable(builder.index); + this.local = builder.local; + this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); + + } + + public static ExistsAliasRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. + *

+ * API name: {@code allow_no_indices} + */ + @Nullable + public final Boolean allowNoIndices() { + return this.allowNoIndices; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * If false, requests that include a missing data stream or index + * in the target indices or data streams return an error. + *

+ * API name: {@code ignore_unavailable} + */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + + /** + * Comma-separated list of data streams or indices used to limit the request. + * Supports wildcards (*). To target all data streams and indices, + * omit this parameter or use * or _all. + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * If true, the request retrieves information from the local node + * only. + *

+ * API name: {@code local} + */ + @Nullable + public final Boolean local() { + return this.local; + } + + /** + * Required - Comma-separated list of aliases to check. Supports wildcards + * (*). + *

+ * API name: {@code name} + */ + public final List name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ExistsAliasRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean allowNoIndices; + + @Nullable + private List expandWildcards; + + @Nullable + private Boolean ignoreUnavailable; + + @Nullable + private List index; + + @Nullable + private Boolean local; + + private List name; + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. + *

+ * API name: {@code allow_no_indices} + */ + public final Builder allowNoIndices(@Nullable Boolean value) { + this.allowNoIndices = value; + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * If false, requests that include a missing data stream or index + * in the target indices or data streams return an error. + *

+ * API name: {@code ignore_unavailable} + */ + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + + /** + * Comma-separated list of data streams or indices used to limit the request. + * Supports wildcards (*). To target all data streams and indices, + * omit this parameter or use * or _all. + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Comma-separated list of data streams or indices used to limit the request. + * Supports wildcards (*). To target all data streams and indices, + * omit this parameter or use * or _all. + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); + return this; + } + + /** + * If true, the request retrieves information from the local node + * only. + *

+ * API name: {@code local} + */ + public final Builder local(@Nullable Boolean value) { + this.local = value; + return this; + } + + /** + * Required - Comma-separated list of aliases to check. Supports wildcards + * (*). + *

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

+ * Adds all elements of list to name. + */ + public final Builder name(List list) { + this.name = _listAddAll(this.name, list); + return this; + } + + /** + * Required - Comma-separated list of aliases to check. Supports wildcards + * (*). + *

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

+ * Adds one or more values to name. + */ + public final Builder name(String value, String... values) { + this.name = _listAdd(this.name, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ExistsAliasRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ExistsAliasRequest build() { + _checkSingleUse(); + + return new ExistsAliasRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.exists_alias}". + */ + public static final Endpoint _ENDPOINT = new BooleanEndpoint<>( + "es/indices.exists_alias", + + // Request method + request -> { + return "HEAD"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + final int _index = 1 << 1; + + int propsSet = 0; + + propsSet |= _name; + if (ApiTypeHelper.isDefined(request.index())) + propsSet |= _index; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_alias"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + if (propsSet == (_index | _name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_alias"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + final int _index = 1 << 1; + + int propsSet = 0; + + propsSet |= _name; + if (ApiTypeHelper.isDefined(request.index())) + propsSet |= _index; + + if (propsSet == (_name)) { + params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); + } + if (propsSet == (_index | _name)) { + params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); + params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); + } + if (request.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); + } + if (request.local != null) { + params.put("local", String.valueOf(request.local)); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, null); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsIndexTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsIndexTemplateRequest.java new file mode 100644 index 000000000..c8600fd8d --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsIndexTemplateRequest.java @@ -0,0 +1,218 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.BooleanEndpoint; +import co.elastic.clients.transport.endpoints.BooleanResponse; +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.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.exists_index_template.Request + +/** + * Returns information about whether a particular index template exists. + * + * @see API + * specification + */ + +public class ExistsIndexTemplateRequest extends RequestBase { + @Nullable + private final Time masterTimeout; + + private final String name; + + // --------------------------------------------------------------------------------------------- + + private ExistsIndexTemplateRequest(Builder builder) { + + this.masterTimeout = builder.masterTimeout; + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + + } + + public static ExistsIndexTemplateRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * 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; + } + + /** + * Required - Comma-separated list of index template names used to limit the + * request. Wildcard (*) expressions are supported. + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ExistsIndexTemplateRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Time masterTimeout; + + private String name; + + /** + * 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()); + } + + /** + * Required - Comma-separated list of index template names used to limit the + * request. Wildcard (*) expressions are supported. + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ExistsIndexTemplateRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ExistsIndexTemplateRequest build() { + _checkSingleUse(); + + return new ExistsIndexTemplateRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.exists_index_template}". + */ + public static final Endpoint _ENDPOINT = new BooleanEndpoint<>( + "es/indices.exists_index_template", + + // Request method + request -> { + return "HEAD"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_index_template"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name); + } + 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, null); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsRequest.java new file mode 100644 index 000000000..e49e82a04 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsRequest.java @@ -0,0 +1,408 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +import co.elastic.clients.elasticsearch._types.RequestBase; +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.BooleanEndpoint; +import co.elastic.clients.transport.endpoints.BooleanResponse; +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.Boolean; +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; + +// typedef: indices.exists.Request + +/** + * Checks if a data stream, index, or alias exists. + * + * @see API + * specification + */ + +public class ExistsRequest extends RequestBase { + @Nullable + private final Boolean allowNoIndices; + + private final List expandWildcards; + + @Nullable + private final Boolean flatSettings; + + @Nullable + private final Boolean ignoreUnavailable; + + @Nullable + private final Boolean includeDefaults; + + private final List index; + + @Nullable + private final Boolean local; + + // --------------------------------------------------------------------------------------------- + + private ExistsRequest(Builder builder) { + + this.allowNoIndices = builder.allowNoIndices; + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.flatSettings = builder.flatSettings; + this.ignoreUnavailable = builder.ignoreUnavailable; + this.includeDefaults = builder.includeDefaults; + this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); + this.local = builder.local; + + } + + public static ExistsRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. + *

+ * API name: {@code allow_no_indices} + */ + @Nullable + public final Boolean allowNoIndices() { + return this.allowNoIndices; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code flat_settings} + */ + @Nullable + public final Boolean flatSettings() { + return this.flatSettings; + } + + /** + * If false, the request returns an error if it targets a missing + * or closed index. + *

+ * API name: {@code ignore_unavailable} + */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + + /** + * If true, return all default settings in the response. + *

+ * API name: {@code include_defaults} + */ + @Nullable + public final Boolean includeDefaults() { + return this.includeDefaults; + } + + /** + * Required - Comma-separated list of data streams, indices, and aliases. + * Supports wildcards (*). + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * If true, the request retrieves information from the local node + * only. + *

+ * API name: {@code local} + */ + @Nullable + public final Boolean local() { + return this.local; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ExistsRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private Boolean allowNoIndices; + + @Nullable + private List expandWildcards; + + @Nullable + private Boolean flatSettings; + + @Nullable + private Boolean ignoreUnavailable; + + @Nullable + private Boolean includeDefaults; + + private List index; + + @Nullable + private Boolean local; + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. + *

+ * API name: {@code allow_no_indices} + */ + public final Builder allowNoIndices(@Nullable Boolean value) { + this.allowNoIndices = value; + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code flat_settings} + */ + public final Builder flatSettings(@Nullable Boolean value) { + this.flatSettings = value; + return this; + } + + /** + * If false, the request returns an error if it targets a missing + * or closed index. + *

+ * API name: {@code ignore_unavailable} + */ + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + + /** + * If true, return all default settings in the response. + *

+ * API name: {@code include_defaults} + */ + public final Builder includeDefaults(@Nullable Boolean value) { + this.includeDefaults = value; + return this; + } + + /** + * Required - Comma-separated list of data streams, indices, and aliases. + * Supports wildcards (*). + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Required - Comma-separated list of data streams, indices, and aliases. + * Supports wildcards (*). + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); + return this; + } + + /** + * If true, the request retrieves information from the local node + * only. + *

+ * API name: {@code local} + */ + public final Builder local(@Nullable Boolean value) { + this.local = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ExistsRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ExistsRequest build() { + _checkSingleUse(); + + return new ExistsRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.exists}". + */ + public static final Endpoint _ENDPOINT = new BooleanEndpoint<>( + "es/indices.exists", + + // Request method + request -> { + return "HEAD"; + + }, + + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.flatSettings != null) { + params.put("flat_settings", String.valueOf(request.flatSettings)); + } + if (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); + } + if (request.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); + } + if (request.includeDefaults != null) { + params.put("include_defaults", String.valueOf(request.includeDefaults)); + } + if (request.local != null) { + params.put("local", String.valueOf(request.local)); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, null); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsTemplateRequest.java new file mode 100644 index 000000000..380c4ebde --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExistsTemplateRequest.java @@ -0,0 +1,291 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.BooleanEndpoint; +import co.elastic.clients.transport.endpoints.BooleanResponse; +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.Boolean; +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; + +// typedef: indices.exists_template.Request + +/** + * Returns information about whether a particular index template exists. + * + * @see API + * specification + */ + +public class ExistsTemplateRequest extends RequestBase { + @Nullable + private final Boolean flatSettings; + + @Nullable + private final Boolean local; + + @Nullable + private final Time masterTimeout; + + private final List name; + + // --------------------------------------------------------------------------------------------- + + private ExistsTemplateRequest(Builder builder) { + + this.flatSettings = builder.flatSettings; + this.local = builder.local; + this.masterTimeout = builder.masterTimeout; + this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); + + } + + public static ExistsTemplateRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Return settings in flat format (default: false) + *

+ * API name: {@code flat_settings} + */ + @Nullable + public final Boolean flatSettings() { + return this.flatSettings; + } + + /** + * Return local information, do not retrieve the state from master node + * (default: false) + *

+ * API name: {@code local} + */ + @Nullable + public final Boolean local() { + return this.local; + } + + /** + * Explicit operation timeout for connection to master node + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + /** + * Required - The comma separated names of the index templates + *

+ * API name: {@code name} + */ + public final List name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ExistsTemplateRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean flatSettings; + + @Nullable + private Boolean local; + + @Nullable + private Time masterTimeout; + + private List name; + + /** + * Return settings in flat format (default: false) + *

+ * API name: {@code flat_settings} + */ + public final Builder flatSettings(@Nullable Boolean value) { + this.flatSettings = value; + return this; + } + + /** + * Return local information, do not retrieve the state from master node + * (default: false) + *

+ * API name: {@code local} + */ + public final Builder local(@Nullable Boolean value) { + this.local = value; + return this; + } + + /** + * Explicit operation timeout for connection to master node + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Explicit operation timeout for connection to master node + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(Function> fn) { + return this.masterTimeout(fn.apply(new Time.Builder()).build()); + } + + /** + * Required - The comma separated names of the index templates + *

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

+ * Adds all elements of list to name. + */ + public final Builder name(List list) { + this.name = _listAddAll(this.name, list); + return this; + } + + /** + * Required - The comma separated names of the index templates + *

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

+ * Adds one or more values to name. + */ + public final Builder name(String value, String... values) { + this.name = _listAdd(this.name, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ExistsTemplateRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ExistsTemplateRequest build() { + _checkSingleUse(); + + return new ExistsTemplateRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.exists_template}". + */ + public static final Endpoint _ENDPOINT = new BooleanEndpoint<>( + "es/indices.exists_template", + + // Request method + request -> { + return "HEAD"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_template"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name.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.flatSettings != null) { + params.put("flat_settings", String.valueOf(request.flatSettings)); + } + if (request.local != null) { + params.put("local", String.valueOf(request.local)); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, null); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExplainDataLifecycleRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExplainDataLifecycleRequest.java new file mode 100644 index 000000000..c9117b4e4 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExplainDataLifecycleRequest.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.Boolean; +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; + +// typedef: indices.explain_data_lifecycle.Request + +/** + * Retrieves information about the index's current data stream lifecycle, such + * as any potential encountered error, time since creation etc. + * + * @see API + * specification + */ + +public class ExplainDataLifecycleRequest extends RequestBase { + @Nullable + private final Boolean includeDefaults; + + private final List index; + + @Nullable + private final Time masterTimeout; + + // --------------------------------------------------------------------------------------------- + + private ExplainDataLifecycleRequest(Builder builder) { + + this.includeDefaults = builder.includeDefaults; + this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); + this.masterTimeout = builder.masterTimeout; + + } + + public static ExplainDataLifecycleRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * indicates if the API should return the default values the system uses for the + * index's lifecycle + *

+ * API name: {@code include_defaults} + */ + @Nullable + public final Boolean includeDefaults() { + return this.includeDefaults; + } + + /** + * Required - The name of the index to explain + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * Specify timeout for connection to master + *

+ * API name: {@code master_timeout} + */ + @Nullable + public final Time masterTimeout() { + return this.masterTimeout; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ExplainDataLifecycleRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean includeDefaults; + + private List index; + + @Nullable + private Time masterTimeout; + + /** + * indicates if the API should return the default values the system uses for the + * index's lifecycle + *

+ * API name: {@code include_defaults} + */ + public final Builder includeDefaults(@Nullable Boolean value) { + this.includeDefaults = value; + return this; + } + + /** + * Required - The name of the index to explain + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Required - The name of the index to explain + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); + return this; + } + + /** + * Specify timeout for connection to master + *

+ * API name: {@code master_timeout} + */ + public final Builder masterTimeout(@Nullable Time value) { + this.masterTimeout = value; + return this; + } + + /** + * Specify timeout for connection to master + *

+ * 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 ExplainDataLifecycleRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ExplainDataLifecycleRequest build() { + _checkSingleUse(); + + return new ExplainDataLifecycleRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.explain_data_lifecycle}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.explain_data_lifecycle", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_lifecycle"); + buf.append("/explain"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + params.put("index", request.index.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.includeDefaults != null) { + params.put("include_defaults", String.valueOf(request.includeDefaults)); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, ExplainDataLifecycleResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExplainDataLifecycleResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExplainDataLifecycleResponse.java new file mode 100644 index 000000000..422f772a8 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ExplainDataLifecycleResponse.java @@ -0,0 +1,180 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch.indices.explain_data_lifecycle.DataStreamLifecycleExplain; +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.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.explain_data_lifecycle.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ExplainDataLifecycleResponse implements JsonpSerializable { + private final Map indices; + + // --------------------------------------------------------------------------------------------- + + private ExplainDataLifecycleResponse(Builder builder) { + + this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); + + } + + public static ExplainDataLifecycleResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code indices} + */ + public final Map indices() { + return this.indices; + } + + /** + * 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.indices)) { + generator.writeKey("indices"); + generator.writeStartObject(); + for (Map.Entry item0 : this.indices.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ExplainDataLifecycleResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Map indices; + + /** + * Required - API name: {@code indices} + *

+ * Adds all entries of map to indices. + */ + public final Builder indices(Map map) { + this.indices = _mapPutAll(this.indices, map); + return this; + } + + /** + * Required - API name: {@code indices} + *

+ * Adds an entry to indices. + */ + public final Builder indices(String key, DataStreamLifecycleExplain value) { + this.indices = _mapPut(this.indices, key, value); + return this; + } + + /** + * Required - API name: {@code indices} + *

+ * Adds an entry to indices using a builder lambda. + */ + public final Builder indices(String key, + Function> fn) { + return indices(key, fn.apply(new DataStreamLifecycleExplain.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ExplainDataLifecycleResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ExplainDataLifecycleResponse build() { + _checkSingleUse(); + + return new ExplainDataLifecycleResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ExplainDataLifecycleResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ExplainDataLifecycleResponse::setupExplainDataLifecycleResponseDeserializer); + + protected static void setupExplainDataLifecycleResponseDeserializer( + ObjectDeserializer op) { + + op.add(Builder::indices, JsonpDeserializer.stringMapDeserializer(DataStreamLifecycleExplain._DESERIALIZER), + "indices"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/FielddataFrequencyFilter.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/FielddataFrequencyFilter.java new file mode 100644 index 000000000..0e783a701 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/FielddataFrequencyFilter.java @@ -0,0 +1,194 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.Double; +import java.lang.Integer; +import java.util.Objects; +import java.util.function.Function; + +// typedef: indices._types.FielddataFrequencyFilter + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class FielddataFrequencyFilter implements JsonpSerializable { + private final double max; + + private final double min; + + private final int minSegmentSize; + + // --------------------------------------------------------------------------------------------- + + private FielddataFrequencyFilter(Builder builder) { + + this.max = ApiTypeHelper.requireNonNull(builder.max, this, "max"); + this.min = ApiTypeHelper.requireNonNull(builder.min, this, "min"); + this.minSegmentSize = ApiTypeHelper.requireNonNull(builder.minSegmentSize, this, "minSegmentSize"); + + } + + public static FielddataFrequencyFilter of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code max} + */ + public final double max() { + return this.max; + } + + /** + * Required - API name: {@code min} + */ + public final double min() { + return this.min; + } + + /** + * Required - API name: {@code min_segment_size} + */ + public final int minSegmentSize() { + return this.minSegmentSize; + } + + /** + * 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("max"); + generator.write(this.max); + + generator.writeKey("min"); + generator.write(this.min); + + generator.writeKey("min_segment_size"); + generator.write(this.minSegmentSize); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link FielddataFrequencyFilter}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Double max; + + private Double min; + + private Integer minSegmentSize; + + /** + * Required - API name: {@code max} + */ + public final Builder max(double value) { + this.max = value; + return this; + } + + /** + * Required - API name: {@code min} + */ + public final Builder min(double value) { + this.min = value; + return this; + } + + /** + * Required - API name: {@code min_segment_size} + */ + public final Builder minSegmentSize(int value) { + this.minSegmentSize = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link FielddataFrequencyFilter}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public FielddataFrequencyFilter build() { + _checkSingleUse(); + + return new FielddataFrequencyFilter(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link FielddataFrequencyFilter} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, FielddataFrequencyFilter::setupFielddataFrequencyFilterDeserializer); + + protected static void setupFielddataFrequencyFilterDeserializer( + ObjectDeserializer op) { + + op.add(Builder::max, JsonpDeserializer.doubleDeserializer(), "max"); + op.add(Builder::min, JsonpDeserializer.doubleDeserializer(), "min"); + op.add(Builder::minSegmentSize, JsonpDeserializer.integerDeserializer(), "min_segment_size"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetAliasRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetAliasRequest.java new file mode 100644 index 000000000..d8b7b1f82 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetAliasRequest.java @@ -0,0 +1,434 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +import co.elastic.clients.elasticsearch._types.RequestBase; +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.Boolean; +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; + +// typedef: indices.get_alias.Request + +/** + * Retrieves information for one or more aliases. + * + * @see API + * specification + */ + +public class GetAliasRequest extends RequestBase { + @Nullable + private final Boolean allowNoIndices; + + private final List expandWildcards; + + @Nullable + private final Boolean ignoreUnavailable; + + private final List index; + + @Nullable + private final Boolean local; + + private final List name; + + // --------------------------------------------------------------------------------------------- + + private GetAliasRequest(Builder builder) { + + this.allowNoIndices = builder.allowNoIndices; + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.ignoreUnavailable = builder.ignoreUnavailable; + this.index = ApiTypeHelper.unmodifiable(builder.index); + this.local = builder.local; + this.name = ApiTypeHelper.unmodifiable(builder.name); + + } + + public static GetAliasRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. + *

+ * API name: {@code allow_no_indices} + */ + @Nullable + public final Boolean allowNoIndices() { + return this.allowNoIndices; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * If false, the request returns an error if it targets a missing + * or closed index. + *

+ * API name: {@code ignore_unavailable} + */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + + /** + * Comma-separated list of data streams or indices used to limit the request. + * Supports wildcards (*). To target all data streams and indices, + * omit this parameter or use * or _all. + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * If true, the request retrieves information from the local node + * only. + *

+ * API name: {@code local} + */ + @Nullable + public final Boolean local() { + return this.local; + } + + /** + * Comma-separated list of aliases to retrieve. Supports wildcards + * (*). To retrieve all aliases, omit this parameter or use + * * or _all. + *

+ * API name: {@code name} + */ + public final List name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetAliasRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private Boolean allowNoIndices; + + @Nullable + private List expandWildcards; + + @Nullable + private Boolean ignoreUnavailable; + + @Nullable + private List index; + + @Nullable + private Boolean local; + + @Nullable + private List name; + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. + *

+ * API name: {@code allow_no_indices} + */ + public final Builder allowNoIndices(@Nullable Boolean value) { + this.allowNoIndices = value; + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * If false, the request returns an error if it targets a missing + * or closed index. + *

+ * API name: {@code ignore_unavailable} + */ + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + + /** + * Comma-separated list of data streams or indices used to limit the request. + * Supports wildcards (*). To target all data streams and indices, + * omit this parameter or use * or _all. + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Comma-separated list of data streams or indices used to limit the request. + * Supports wildcards (*). To target all data streams and indices, + * omit this parameter or use * or _all. + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); + return this; + } + + /** + * If true, the request retrieves information from the local node + * only. + *

+ * API name: {@code local} + */ + public final Builder local(@Nullable Boolean value) { + this.local = value; + return this; + } + + /** + * Comma-separated list of aliases to retrieve. Supports wildcards + * (*). To retrieve all aliases, omit this parameter or use + * * or _all. + *

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

+ * Adds all elements of list to name. + */ + public final Builder name(List list) { + this.name = _listAddAll(this.name, list); + return this; + } + + /** + * Comma-separated list of aliases to retrieve. Supports wildcards + * (*). To retrieve all aliases, omit this parameter or use + * * or _all. + *

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

+ * Adds one or more values to name. + */ + public final Builder name(String value, String... values) { + this.name = _listAdd(this.name, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetAliasRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetAliasRequest build() { + _checkSingleUse(); + + return new GetAliasRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.get_alias}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.get_alias", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + final int _index = 1 << 1; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.name())) + propsSet |= _name; + if (ApiTypeHelper.isDefined(request.index())) + propsSet |= _index; + + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_alias"); + return buf.toString(); + } + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_alias"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + if (propsSet == (_index | _name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_alias"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_alias"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + final int _index = 1 << 1; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.name())) + propsSet |= _name; + if (ApiTypeHelper.isDefined(request.index())) + propsSet |= _index; + + if (propsSet == 0) { + } + if (propsSet == (_name)) { + params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); + } + if (propsSet == (_index | _name)) { + params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); + params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); + } + if (propsSet == (_index)) { + params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); + } + if (request.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); + } + if (request.local != null) { + params.put("local", String.valueOf(request.local)); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, GetAliasResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetAliasResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetAliasResponse.java new file mode 100644 index 000000000..e4516e3ff --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetAliasResponse.java @@ -0,0 +1,177 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch.indices.get_alias.IndexAliases; +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 jakarta.json.stream.JsonParser; +import java.lang.String; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.get_alias.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GetAliasResponse implements JsonpSerializable { + private final Map result; + + // --------------------------------------------------------------------------------------------- + + private GetAliasResponse(Builder builder) { + + this.result = ApiTypeHelper.unmodifiableRequired(builder.result, this, "result"); + + } + + public static GetAliasResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Response value. + */ + public final Map result() { + return this.result; + } + + /** + * Get an element of {@code result}. + */ + public final @Nullable IndexAliases get(String key) { + return this.result.get(key); + } + + /** + * Serialize this value to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + for (Map.Entry item0 : this.result.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetAliasResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Map result = new HashMap<>(); + + /** + * Required - Response value. + *

+ * Adds all entries of map to result. + */ + public final Builder result(Map map) { + this.result = _mapPutAll(this.result, map); + return this; + } + + /** + * Required - Response value. + *

+ * Adds an entry to result. + */ + public final Builder result(String key, IndexAliases value) { + this.result = _mapPut(this.result, key, value); + return this; + } + + /** + * Required - Response value. + *

+ * Adds an entry to result using a builder lambda. + */ + public final Builder result(String key, Function> fn) { + return result(key, fn.apply(new IndexAliases.Builder()).build()); + } + + @Override + public Builder withJson(JsonParser parser, JsonpMapper mapper) { + + @SuppressWarnings("unchecked") + Map value = (Map) JsonpDeserializer + .stringMapDeserializer(IndexAliases._DESERIALIZER).deserialize(parser, mapper); + return this.result(value); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetAliasResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetAliasResponse build() { + _checkSingleUse(); + + return new GetAliasResponse(this); + } + } + + public static final JsonpDeserializer _DESERIALIZER = createGetAliasResponseDeserializer(); + protected static JsonpDeserializer createGetAliasResponseDeserializer() { + + JsonpDeserializer> valueDeserializer = JsonpDeserializer + .stringMapDeserializer(IndexAliases._DESERIALIZER); + + return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() + .result(valueDeserializer.deserialize(parser, mapper, event)).build()); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataLifecycleRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataLifecycleRequest.java new file mode 100644 index 000000000..e76db1480 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataLifecycleRequest.java @@ -0,0 +1,279 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +import co.elastic.clients.elasticsearch._types.RequestBase; +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.Boolean; +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; + +// typedef: indices.get_data_lifecycle.Request + +/** + * Retrieves the data stream lifecycle configuration of one or more data + * streams. + * + * @see API + * specification + */ + +public class GetDataLifecycleRequest extends RequestBase { + private final List expandWildcards; + + @Nullable + private final Boolean includeDefaults; + + private final List name; + + // --------------------------------------------------------------------------------------------- + + private GetDataLifecycleRequest(Builder builder) { + + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.includeDefaults = builder.includeDefaults; + this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); + + } + + public static GetDataLifecycleRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values, such as open,hidden. Valid values are: + * all, open, closed, + * hidden, none. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * If true, return all default settings in the response. + *

+ * API name: {@code include_defaults} + */ + @Nullable + public final Boolean includeDefaults() { + return this.includeDefaults; + } + + /** + * Required - Comma-separated list of data streams to limit the request. + * Supports wildcards (*). To target all data streams, omit this + * parameter or use * or _all. + *

+ * API name: {@code name} + */ + public final List name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetDataLifecycleRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private List expandWildcards; + + @Nullable + private Boolean includeDefaults; + + private List name; + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values, such as open,hidden. Valid values are: + * all, open, closed, + * hidden, none. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values, such as open,hidden. Valid values are: + * all, open, closed, + * hidden, none. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * If true, return all default settings in the response. + *

+ * API name: {@code include_defaults} + */ + public final Builder includeDefaults(@Nullable Boolean value) { + this.includeDefaults = value; + return this; + } + + /** + * Required - Comma-separated list of data streams to limit the request. + * Supports wildcards (*). To target all data streams, omit this + * parameter or use * or _all. + *

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

+ * Adds all elements of list to name. + */ + public final Builder name(List list) { + this.name = _listAddAll(this.name, list); + return this; + } + + /** + * Required - Comma-separated list of data streams to limit the request. + * Supports wildcards (*). To target all data streams, omit this + * parameter or use * or _all. + *

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

+ * Adds one or more values to name. + */ + public final Builder name(String value, String... values) { + this.name = _listAdd(this.name, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetDataLifecycleRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetDataLifecycleRequest build() { + _checkSingleUse(); + + return new GetDataLifecycleRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.get_data_lifecycle}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.get_data_lifecycle", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_data_stream"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_lifecycle"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.includeDefaults != null) { + params.put("include_defaults", String.valueOf(request.includeDefaults)); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, GetDataLifecycleResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataLifecycleResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataLifecycleResponse.java new file mode 100644 index 000000000..bd87eaa4b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataLifecycleResponse.java @@ -0,0 +1,178 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch.indices.get_data_lifecycle.DataStreamWithLifecycle; +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; + +// typedef: indices.get_data_lifecycle.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GetDataLifecycleResponse implements JsonpSerializable { + private final List dataStreams; + + // --------------------------------------------------------------------------------------------- + + private GetDataLifecycleResponse(Builder builder) { + + this.dataStreams = ApiTypeHelper.unmodifiableRequired(builder.dataStreams, this, "dataStreams"); + + } + + public static GetDataLifecycleResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code data_streams} + */ + public final List dataStreams() { + return this.dataStreams; + } + + /** + * 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.dataStreams)) { + generator.writeKey("data_streams"); + generator.writeStartArray(); + for (DataStreamWithLifecycle item0 : this.dataStreams) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetDataLifecycleResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private List dataStreams; + + /** + * Required - API name: {@code data_streams} + *

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

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

+ * Adds a value to dataStreams using a builder lambda. + */ + public final Builder dataStreams( + Function> fn) { + return dataStreams(fn.apply(new DataStreamWithLifecycle.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetDataLifecycleResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetDataLifecycleResponse build() { + _checkSingleUse(); + + return new GetDataLifecycleResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GetDataLifecycleResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, GetDataLifecycleResponse::setupGetDataLifecycleResponseDeserializer); + + protected static void setupGetDataLifecycleResponseDeserializer( + ObjectDeserializer op) { + + op.add(Builder::dataStreams, JsonpDeserializer.arrayDeserializer(DataStreamWithLifecycle._DESERIALIZER), + "data_streams"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataStreamRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataStreamRequest.java new file mode 100644 index 000000000..1ba10dce6 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataStreamRequest.java @@ -0,0 +1,280 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +import co.elastic.clients.elasticsearch._types.RequestBase; +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.Boolean; +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; + +// typedef: indices.get_data_stream.Request + +/** + * Retrieves information about one or more data streams. + * + * @see API + * specification + */ + +public class GetDataStreamRequest extends RequestBase { + private final List expandWildcards; + + @Nullable + private final Boolean includeDefaults; + + private final List name; + + // --------------------------------------------------------------------------------------------- + + private GetDataStreamRequest(Builder builder) { + + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.includeDefaults = builder.includeDefaults; + this.name = ApiTypeHelper.unmodifiable(builder.name); + + } + + public static GetDataStreamRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values, such as open,hidden. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * If true, returns all relevant default configurations for the index template. + *

+ * API name: {@code include_defaults} + */ + @Nullable + public final Boolean includeDefaults() { + return this.includeDefaults; + } + + /** + * Comma-separated list of data stream names used to limit the request. Wildcard + * (*) expressions are supported. If omitted, all data streams are + * returned. + *

+ * API name: {@code name} + */ + public final List name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetDataStreamRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private List expandWildcards; + + @Nullable + private Boolean includeDefaults; + + @Nullable + private List name; + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values, such as open,hidden. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values, such as open,hidden. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * If true, returns all relevant default configurations for the index template. + *

+ * API name: {@code include_defaults} + */ + public final Builder includeDefaults(@Nullable Boolean value) { + this.includeDefaults = value; + return this; + } + + /** + * Comma-separated list of data stream names used to limit the request. Wildcard + * (*) expressions are supported. If omitted, all data streams are + * returned. + *

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

+ * Adds all elements of list to name. + */ + public final Builder name(List list) { + this.name = _listAddAll(this.name, list); + return this; + } + + /** + * Comma-separated list of data stream names used to limit the request. Wildcard + * (*) expressions are supported. If omitted, all data streams are + * returned. + *

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

+ * Adds one or more values to name. + */ + public final Builder name(String value, String... values) { + this.name = _listAdd(this.name, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetDataStreamRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetDataStreamRequest build() { + _checkSingleUse(); + + return new GetDataStreamRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.get_data_stream}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.get_data_stream", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.name())) + propsSet |= _name; + + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_data_stream"); + return buf.toString(); + } + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_data_stream"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.name())) + propsSet |= _name; + + if (propsSet == 0) { + } + if (propsSet == (_name)) { + params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.includeDefaults != null) { + params.put("include_defaults", String.valueOf(request.includeDefaults)); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, GetDataStreamResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataStreamResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataStreamResponse.java new file mode 100644 index 000000000..d52549e5e --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetDataStreamResponse.java @@ -0,0 +1,174 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.get_data_stream.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GetDataStreamResponse implements JsonpSerializable { + private final List dataStreams; + + // --------------------------------------------------------------------------------------------- + + private GetDataStreamResponse(Builder builder) { + + this.dataStreams = ApiTypeHelper.unmodifiableRequired(builder.dataStreams, this, "dataStreams"); + + } + + public static GetDataStreamResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code data_streams} + */ + public final List dataStreams() { + return this.dataStreams; + } + + /** + * 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.dataStreams)) { + generator.writeKey("data_streams"); + generator.writeStartArray(); + for (DataStream item0 : this.dataStreams) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetDataStreamResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private List dataStreams; + + /** + * Required - API name: {@code data_streams} + *

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

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

+ * Adds a value to dataStreams using a builder lambda. + */ + public final Builder dataStreams(Function> fn) { + return dataStreams(fn.apply(new DataStream.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetDataStreamResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetDataStreamResponse build() { + _checkSingleUse(); + + return new GetDataStreamResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GetDataStreamResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, GetDataStreamResponse::setupGetDataStreamResponseDeserializer); + + protected static void setupGetDataStreamResponseDeserializer(ObjectDeserializer op) { + + op.add(Builder::dataStreams, JsonpDeserializer.arrayDeserializer(DataStream._DESERIALIZER), "data_streams"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexRequest.java new file mode 100644 index 000000000..a664fdc1c --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexRequest.java @@ -0,0 +1,485 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.elasticsearch.indices.get.Feature; +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.Boolean; +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; + +// typedef: indices.get.Request + +/** + * Returns information about one or more indices. For data streams, the API + * returns information about the stream’s backing indices. + * + * @see API + * specification + */ + +public class GetIndexRequest extends RequestBase { + @Nullable + private final Boolean allowNoIndices; + + private final List expandWildcards; + + private final List features; + + @Nullable + private final Boolean flatSettings; + + @Nullable + private final Boolean ignoreUnavailable; + + @Nullable + private final Boolean includeDefaults; + + private final List index; + + @Nullable + private final Boolean local; + + @Nullable + private final Time masterTimeout; + + // --------------------------------------------------------------------------------------------- + + private GetIndexRequest(Builder builder) { + + this.allowNoIndices = builder.allowNoIndices; + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.features = ApiTypeHelper.unmodifiable(builder.features); + this.flatSettings = builder.flatSettings; + this.ignoreUnavailable = builder.ignoreUnavailable; + this.includeDefaults = builder.includeDefaults; + this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); + this.local = builder.local; + this.masterTimeout = builder.masterTimeout; + + } + + public static GetIndexRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If false, the request returns an error if any wildcard expression, index + * alias, or _all value targets only missing or closed indices. This behavior + * applies even if the request targets other open indices. For example, a + * request targeting foo*,bar* returns an error if an index starts with foo but + * no index starts with bar. + *

+ * API name: {@code allow_no_indices} + */ + @Nullable + public final Boolean allowNoIndices() { + return this.allowNoIndices; + } + + /** + * Type of index that wildcard expressions can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as open,hidden. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * Return only information on specified index features + *

+ * API name: {@code features} + */ + public final List features() { + return this.features; + } + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code flat_settings} + */ + @Nullable + public final Boolean flatSettings() { + return this.flatSettings; + } + + /** + * If false, requests that target a missing index return an error. + *

+ * API name: {@code ignore_unavailable} + */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + + /** + * If true, return all default settings in the response. + *

+ * API name: {@code include_defaults} + */ + @Nullable + public final Boolean includeDefaults() { + return this.includeDefaults; + } + + /** + * Required - Comma-separated list of data streams, indices, and index aliases + * used to limit the request. Wildcard expressions (*) are supported. + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * If true, the request retrieves information from the local node only. Defaults + * to false, which means information is retrieved from the master node. + *

+ * API name: {@code local} + */ + @Nullable + public final Boolean local() { + return this.local; + } + + /** + * 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 GetIndexRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private Boolean allowNoIndices; + + @Nullable + private List expandWildcards; + + @Nullable + private List features; + + @Nullable + private Boolean flatSettings; + + @Nullable + private Boolean ignoreUnavailable; + + @Nullable + private Boolean includeDefaults; + + private List index; + + @Nullable + private Boolean local; + + @Nullable + private Time masterTimeout; + + /** + * If false, the request returns an error if any wildcard expression, index + * alias, or _all value targets only missing or closed indices. This behavior + * applies even if the request targets other open indices. For example, a + * request targeting foo*,bar* returns an error if an index starts with foo but + * no index starts with bar. + *

+ * API name: {@code allow_no_indices} + */ + public final Builder allowNoIndices(@Nullable Boolean value) { + this.allowNoIndices = value; + return this; + } + + /** + * Type of index that wildcard expressions can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as open,hidden. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of index that wildcard expressions can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as open,hidden. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * Return only information on specified index features + *

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

+ * Adds all elements of list to features. + */ + public final Builder features(List list) { + this.features = _listAddAll(this.features, list); + return this; + } + + /** + * Return only information on specified index features + *

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

+ * Adds one or more values to features. + */ + public final Builder features(Feature value, Feature... values) { + this.features = _listAdd(this.features, value, values); + return this; + } + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code flat_settings} + */ + public final Builder flatSettings(@Nullable Boolean value) { + this.flatSettings = value; + return this; + } + + /** + * If false, requests that target a missing index return an error. + *

+ * API name: {@code ignore_unavailable} + */ + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + + /** + * If true, return all default settings in the response. + *

+ * API name: {@code include_defaults} + */ + public final Builder includeDefaults(@Nullable Boolean value) { + this.includeDefaults = value; + return this; + } + + /** + * Required - Comma-separated list of data streams, indices, and index aliases + * used to limit the request. Wildcard expressions (*) are supported. + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Required - Comma-separated list of data streams, indices, and index aliases + * used to limit the request. Wildcard expressions (*) are supported. + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); + return this; + } + + /** + * If true, the request retrieves information from the local node only. Defaults + * to false, which means information is retrieved from the master node. + *

+ * API name: {@code local} + */ + public final Builder local(@Nullable Boolean value) { + this.local = 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(@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 GetIndexRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetIndexRequest build() { + _checkSingleUse(); + + return new GetIndexRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.get}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.get", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + params.put("index", request.index.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 (ApiTypeHelper.isDefined(request.features)) { + params.put("features", + request.features.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.flatSettings != null) { + params.put("flat_settings", String.valueOf(request.flatSettings)); + } + if (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); + } + if (request.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); + } + if (request.includeDefaults != null) { + params.put("include_defaults", String.valueOf(request.includeDefaults)); + } + if (request.local != null) { + params.put("local", String.valueOf(request.local)); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, GetIndexResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexResponse.java new file mode 100644 index 000000000..1e313eded --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexResponse.java @@ -0,0 +1,176 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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 jakarta.json.stream.JsonParser; +import java.lang.String; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.get.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GetIndexResponse implements JsonpSerializable { + private final Map result; + + // --------------------------------------------------------------------------------------------- + + private GetIndexResponse(Builder builder) { + + this.result = ApiTypeHelper.unmodifiableRequired(builder.result, this, "result"); + + } + + public static GetIndexResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Response value. + */ + public final Map result() { + return this.result; + } + + /** + * Get an element of {@code result}. + */ + public final @Nullable IndexState get(String key) { + return this.result.get(key); + } + + /** + * Serialize this value to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + for (Map.Entry item0 : this.result.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetIndexResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Map result = new HashMap<>(); + + /** + * Required - Response value. + *

+ * Adds all entries of map to result. + */ + public final Builder result(Map map) { + this.result = _mapPutAll(this.result, map); + return this; + } + + /** + * Required - Response value. + *

+ * Adds an entry to result. + */ + public final Builder result(String key, IndexState value) { + this.result = _mapPut(this.result, key, value); + return this; + } + + /** + * Required - Response value. + *

+ * Adds an entry to result using a builder lambda. + */ + public final Builder result(String key, Function> fn) { + return result(key, fn.apply(new IndexState.Builder()).build()); + } + + @Override + public Builder withJson(JsonParser parser, JsonpMapper mapper) { + + @SuppressWarnings("unchecked") + Map value = (Map) JsonpDeserializer + .stringMapDeserializer(IndexState._DESERIALIZER).deserialize(parser, mapper); + return this.result(value); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetIndexResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetIndexResponse build() { + _checkSingleUse(); + + return new GetIndexResponse(this); + } + } + + public static final JsonpDeserializer _DESERIALIZER = createGetIndexResponseDeserializer(); + protected static JsonpDeserializer createGetIndexResponseDeserializer() { + + JsonpDeserializer> valueDeserializer = JsonpDeserializer + .stringMapDeserializer(IndexState._DESERIALIZER); + + return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() + .result(valueDeserializer.deserialize(parser, mapper, event)).build()); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexTemplateRequest.java new file mode 100644 index 000000000..68a2e269f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexTemplateRequest.java @@ -0,0 +1,320 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.String; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.get_index_template.Request + +/** + * Returns information about one or more index templates. + * + * @see API + * specification + */ + +public class GetIndexTemplateRequest extends RequestBase { + @Nullable + private final Boolean flatSettings; + + @Nullable + private final Boolean includeDefaults; + + @Nullable + private final Boolean local; + + @Nullable + private final Time masterTimeout; + + @Nullable + private final String name; + + // --------------------------------------------------------------------------------------------- + + private GetIndexTemplateRequest(Builder builder) { + + this.flatSettings = builder.flatSettings; + this.includeDefaults = builder.includeDefaults; + this.local = builder.local; + this.masterTimeout = builder.masterTimeout; + this.name = builder.name; + + } + + public static GetIndexTemplateRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code flat_settings} + */ + @Nullable + public final Boolean flatSettings() { + return this.flatSettings; + } + + /** + * If true, returns all relevant default configurations for the index template. + *

+ * API name: {@code include_defaults} + */ + @Nullable + public final Boolean includeDefaults() { + return this.includeDefaults; + } + + /** + * If true, the request retrieves information from the local node only. Defaults + * to false, which means information is retrieved from the master node. + *

+ * API name: {@code local} + */ + @Nullable + public final Boolean local() { + return this.local; + } + + /** + * 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; + } + + /** + * Comma-separated list of index template names used to limit the request. + * Wildcard (*) expressions are supported. + *

+ * API name: {@code name} + */ + @Nullable + public final String name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetIndexTemplateRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean flatSettings; + + @Nullable + private Boolean includeDefaults; + + @Nullable + private Boolean local; + + @Nullable + private Time masterTimeout; + + @Nullable + private String name; + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code flat_settings} + */ + public final Builder flatSettings(@Nullable Boolean value) { + this.flatSettings = value; + return this; + } + + /** + * If true, returns all relevant default configurations for the index template. + *

+ * API name: {@code include_defaults} + */ + public final Builder includeDefaults(@Nullable Boolean value) { + this.includeDefaults = value; + return this; + } + + /** + * If true, the request retrieves information from the local node only. Defaults + * to false, which means information is retrieved from the master node. + *

+ * API name: {@code local} + */ + public final Builder local(@Nullable Boolean value) { + this.local = 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(@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()); + } + + /** + * Comma-separated list of index template names used to limit the request. + * Wildcard (*) expressions are supported. + *

+ * API name: {@code name} + */ + public final Builder name(@Nullable String value) { + this.name = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetIndexTemplateRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetIndexTemplateRequest build() { + _checkSingleUse(); + + return new GetIndexTemplateRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.get_index_template}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.get_index_template", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + if (request.name() != null) + propsSet |= _name; + + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_index_template"); + return buf.toString(); + } + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_index_template"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + if (request.name() != null) + propsSet |= _name; + + if (propsSet == 0) { + } + if (propsSet == (_name)) { + params.put("name", request.name); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } + if (request.flatSettings != null) { + params.put("flat_settings", String.valueOf(request.flatSettings)); + } + if (request.includeDefaults != null) { + params.put("include_defaults", String.valueOf(request.includeDefaults)); + } + if (request.local != null) { + params.put("local", String.valueOf(request.local)); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, GetIndexTemplateResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexTemplateResponse.java new file mode 100644 index 000000000..080b73319 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndexTemplateResponse.java @@ -0,0 +1,177 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch.indices.get_index_template.IndexTemplateItem; +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; + +// typedef: indices.get_index_template.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GetIndexTemplateResponse implements JsonpSerializable { + private final List indexTemplates; + + // --------------------------------------------------------------------------------------------- + + private GetIndexTemplateResponse(Builder builder) { + + this.indexTemplates = ApiTypeHelper.unmodifiableRequired(builder.indexTemplates, this, "indexTemplates"); + + } + + public static GetIndexTemplateResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code index_templates} + */ + public final List indexTemplates() { + return this.indexTemplates; + } + + /** + * 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.indexTemplates)) { + generator.writeKey("index_templates"); + generator.writeStartArray(); + for (IndexTemplateItem item0 : this.indexTemplates) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetIndexTemplateResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private List indexTemplates; + + /** + * Required - API name: {@code index_templates} + *

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

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

+ * Adds a value to indexTemplates using a builder lambda. + */ + public final Builder indexTemplates(Function> fn) { + return indexTemplates(fn.apply(new IndexTemplateItem.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetIndexTemplateResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetIndexTemplateResponse build() { + _checkSingleUse(); + + return new GetIndexTemplateResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link GetIndexTemplateResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, GetIndexTemplateResponse::setupGetIndexTemplateResponseDeserializer); + + protected static void setupGetIndexTemplateResponseDeserializer( + ObjectDeserializer op) { + + op.add(Builder::indexTemplates, JsonpDeserializer.arrayDeserializer(IndexTemplateItem._DESERIALIZER), + "index_templates"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndicesSettingsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndicesSettingsRequest.java new file mode 100644 index 000000000..c07d5e8a3 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndicesSettingsRequest.java @@ -0,0 +1,530 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +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.Boolean; +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; + +// typedef: indices.get_settings.Request + +/** + * Returns setting information for one or more indices. For data streams, + * returns setting information for the stream’s backing indices. + * + * @see API + * specification + */ + +public class GetIndicesSettingsRequest extends RequestBase { + @Nullable + private final Boolean allowNoIndices; + + private final List expandWildcards; + + @Nullable + private final Boolean flatSettings; + + @Nullable + private final Boolean ignoreUnavailable; + + @Nullable + private final Boolean includeDefaults; + + private final List index; + + @Nullable + private final Boolean local; + + @Nullable + private final Time masterTimeout; + + private final List name; + + // --------------------------------------------------------------------------------------------- + + private GetIndicesSettingsRequest(Builder builder) { + + this.allowNoIndices = builder.allowNoIndices; + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.flatSettings = builder.flatSettings; + this.ignoreUnavailable = builder.ignoreUnavailable; + this.includeDefaults = builder.includeDefaults; + this.index = ApiTypeHelper.unmodifiable(builder.index); + this.local = builder.local; + this.masterTimeout = builder.masterTimeout; + this.name = ApiTypeHelper.unmodifiable(builder.name); + + } + + public static GetIndicesSettingsRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. For example, a request targeting foo*,bar* returns an + * error if an index starts with foo but no index starts with bar. + *

+ * API name: {@code allow_no_indices} + */ + @Nullable + public final Boolean allowNoIndices() { + return this.allowNoIndices; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code flat_settings} + */ + @Nullable + public final Boolean flatSettings() { + return this.flatSettings; + } + + /** + * If false, the request returns an error if it targets a missing + * or closed index. + *

+ * API name: {@code ignore_unavailable} + */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + + /** + * If true, return all default settings in the response. + *

+ * API name: {@code include_defaults} + */ + @Nullable + public final Boolean includeDefaults() { + return this.includeDefaults; + } + + /** + * Comma-separated list of data streams, indices, and aliases used to limit the + * request. Supports wildcards (*). To target all data streams and + * indices, omit this parameter or use * or _all. + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * If true, the request retrieves information from the local node + * only. If false, information is retrieved from the master node. + *

+ * API name: {@code local} + */ + @Nullable + public final Boolean local() { + return this.local; + } + + /** + * 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; + } + + /** + * Comma-separated list or wildcard expression of settings to retrieve. + *

+ * API name: {@code name} + */ + public final List name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetIndicesSettingsRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean allowNoIndices; + + @Nullable + private List expandWildcards; + + @Nullable + private Boolean flatSettings; + + @Nullable + private Boolean ignoreUnavailable; + + @Nullable + private Boolean includeDefaults; + + @Nullable + private List index; + + @Nullable + private Boolean local; + + @Nullable + private Time masterTimeout; + + @Nullable + private List name; + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. For example, a request targeting foo*,bar* returns an + * error if an index starts with foo but no index starts with bar. + *

+ * API name: {@code allow_no_indices} + */ + public final Builder allowNoIndices(@Nullable Boolean value) { + this.allowNoIndices = value; + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code flat_settings} + */ + public final Builder flatSettings(@Nullable Boolean value) { + this.flatSettings = value; + return this; + } + + /** + * If false, the request returns an error if it targets a missing + * or closed index. + *

+ * API name: {@code ignore_unavailable} + */ + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + + /** + * If true, return all default settings in the response. + *

+ * API name: {@code include_defaults} + */ + public final Builder includeDefaults(@Nullable Boolean value) { + this.includeDefaults = value; + return this; + } + + /** + * Comma-separated list of data streams, indices, and aliases used to limit the + * request. Supports wildcards (*). To target all data streams and + * indices, omit this parameter or use * or _all. + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Comma-separated list of data streams, indices, and aliases used to limit the + * request. Supports wildcards (*). To target all data streams and + * indices, omit this parameter or use * or _all. + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); + return this; + } + + /** + * If true, the request retrieves information from the local node + * only. If false, information is retrieved from the master node. + *

+ * API name: {@code local} + */ + public final Builder local(@Nullable Boolean value) { + this.local = 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(@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()); + } + + /** + * Comma-separated list or wildcard expression of settings to retrieve. + *

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

+ * Adds all elements of list to name. + */ + public final Builder name(List list) { + this.name = _listAddAll(this.name, list); + return this; + } + + /** + * Comma-separated list or wildcard expression of settings to retrieve. + *

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

+ * Adds one or more values to name. + */ + public final Builder name(String value, String... values) { + this.name = _listAdd(this.name, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetIndicesSettingsRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetIndicesSettingsRequest build() { + _checkSingleUse(); + + return new GetIndicesSettingsRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.get_settings}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.get_settings", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + final int _index = 1 << 1; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.name())) + propsSet |= _name; + if (ApiTypeHelper.isDefined(request.index())) + propsSet |= _index; + + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_settings"); + return buf.toString(); + } + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_settings"); + return buf.toString(); + } + if (propsSet == (_index | _name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_settings"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_settings"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + final int _index = 1 << 1; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.name())) + propsSet |= _name; + if (ApiTypeHelper.isDefined(request.index())) + propsSet |= _index; + + if (propsSet == 0) { + } + if (propsSet == (_index)) { + params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); + } + if (propsSet == (_index | _name)) { + params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); + params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); + } + if (propsSet == (_name)) { + params.put("name", request.name.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.flatSettings != null) { + params.put("flat_settings", String.valueOf(request.flatSettings)); + } + if (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); + } + if (request.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); + } + if (request.includeDefaults != null) { + params.put("include_defaults", String.valueOf(request.includeDefaults)); + } + if (request.local != null) { + params.put("local", String.valueOf(request.local)); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, GetIndicesSettingsResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndicesSettingsResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndicesSettingsResponse.java new file mode 100644 index 000000000..ba5c5682f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetIndicesSettingsResponse.java @@ -0,0 +1,178 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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 jakarta.json.stream.JsonParser; +import java.lang.String; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.get_settings.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GetIndicesSettingsResponse implements JsonpSerializable { + private final Map result; + + // --------------------------------------------------------------------------------------------- + + private GetIndicesSettingsResponse(Builder builder) { + + this.result = ApiTypeHelper.unmodifiableRequired(builder.result, this, "result"); + + } + + public static GetIndicesSettingsResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Response value. + */ + public final Map result() { + return this.result; + } + + /** + * Get an element of {@code result}. + */ + public final @Nullable IndexState get(String key) { + return this.result.get(key); + } + + /** + * Serialize this value to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + for (Map.Entry item0 : this.result.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetIndicesSettingsResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Map result = new HashMap<>(); + + /** + * Required - Response value. + *

+ * Adds all entries of map to result. + */ + public final Builder result(Map map) { + this.result = _mapPutAll(this.result, map); + return this; + } + + /** + * Required - Response value. + *

+ * Adds an entry to result. + */ + public final Builder result(String key, IndexState value) { + this.result = _mapPut(this.result, key, value); + return this; + } + + /** + * Required - Response value. + *

+ * Adds an entry to result using a builder lambda. + */ + public final Builder result(String key, Function> fn) { + return result(key, fn.apply(new IndexState.Builder()).build()); + } + + @Override + public Builder withJson(JsonParser parser, JsonpMapper mapper) { + + @SuppressWarnings("unchecked") + Map value = (Map) JsonpDeserializer + .stringMapDeserializer(IndexState._DESERIALIZER).deserialize(parser, mapper); + return this.result(value); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetIndicesSettingsResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetIndicesSettingsResponse build() { + _checkSingleUse(); + + return new GetIndicesSettingsResponse(this); + } + } + + public static final JsonpDeserializer _DESERIALIZER = createGetIndicesSettingsResponseDeserializer(); + protected static JsonpDeserializer createGetIndicesSettingsResponseDeserializer() { + + JsonpDeserializer> valueDeserializer = JsonpDeserializer + .stringMapDeserializer(IndexState._DESERIALIZER); + + return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() + .result(valueDeserializer.deserialize(parser, mapper, event)).build()); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetMappingRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetMappingRequest.java new file mode 100644 index 000000000..e25b1d52a --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetMappingRequest.java @@ -0,0 +1,406 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +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.Boolean; +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; + +// typedef: indices.get_mapping.Request + +/** + * Retrieves mapping definitions for one or more indices. For data streams, the + * API retrieves mappings for the stream’s backing indices. + * + * @see API + * specification + */ + +public class GetMappingRequest extends RequestBase { + @Nullable + private final Boolean allowNoIndices; + + private final List expandWildcards; + + @Nullable + private final Boolean ignoreUnavailable; + + private final List index; + + @Nullable + private final Boolean local; + + @Nullable + private final Time masterTimeout; + + // --------------------------------------------------------------------------------------------- + + private GetMappingRequest(Builder builder) { + + this.allowNoIndices = builder.allowNoIndices; + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.ignoreUnavailable = builder.ignoreUnavailable; + this.index = ApiTypeHelper.unmodifiable(builder.index); + this.local = builder.local; + this.masterTimeout = builder.masterTimeout; + + } + + public static GetMappingRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. + *

+ * API name: {@code allow_no_indices} + */ + @Nullable + public final Boolean allowNoIndices() { + return this.allowNoIndices; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * If false, the request returns an error if it targets a missing + * or closed index. + *

+ * API name: {@code ignore_unavailable} + */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + + /** + * Comma-separated list of data streams, indices, and aliases used to limit the + * request. Supports wildcards (*). To target all data streams and + * indices, omit this parameter or use * or _all. + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * If true, the request retrieves information from the local node + * only. + *

+ * API name: {@code local} + */ + @Nullable + public final Boolean local() { + return this.local; + } + + /** + * 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 GetMappingRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean allowNoIndices; + + @Nullable + private List expandWildcards; + + @Nullable + private Boolean ignoreUnavailable; + + @Nullable + private List index; + + @Nullable + private Boolean local; + + @Nullable + private Time masterTimeout; + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. + *

+ * API name: {@code allow_no_indices} + */ + public final Builder allowNoIndices(@Nullable Boolean value) { + this.allowNoIndices = value; + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * If false, the request returns an error if it targets a missing + * or closed index. + *

+ * API name: {@code ignore_unavailable} + */ + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + + /** + * Comma-separated list of data streams, indices, and aliases used to limit the + * request. Supports wildcards (*). To target all data streams and + * indices, omit this parameter or use * or _all. + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Comma-separated list of data streams, indices, and aliases used to limit the + * request. Supports wildcards (*). To target all data streams and + * indices, omit this parameter or use * or _all. + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); + return this; + } + + /** + * If true, the request retrieves information from the local node + * only. + *

+ * API name: {@code local} + */ + public final Builder local(@Nullable Boolean value) { + this.local = 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(@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 GetMappingRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetMappingRequest build() { + _checkSingleUse(); + + return new GetMappingRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.get_mapping}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.get_mapping", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.index())) + propsSet |= _index; + + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_mapping"); + return buf.toString(); + } + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_mapping"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _index = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.index())) + propsSet |= _index; + + if (propsSet == 0) { + } + if (propsSet == (_index)) { + params.put("index", request.index.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 (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); + } + if (request.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); + } + if (request.local != null) { + params.put("local", String.valueOf(request.local)); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, GetMappingResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetMappingResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetMappingResponse.java new file mode 100644 index 000000000..997c89694 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetMappingResponse.java @@ -0,0 +1,180 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch.indices.get_mapping.IndexMappingRecord; +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 jakarta.json.stream.JsonParser; +import java.lang.String; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.get_mapping.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GetMappingResponse implements JsonpSerializable { + private final Map result; + + // --------------------------------------------------------------------------------------------- + + private GetMappingResponse(Builder builder) { + + this.result = ApiTypeHelper.unmodifiableRequired(builder.result, this, "result"); + + } + + public static GetMappingResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Response value. + */ + public final Map result() { + return this.result; + } + + /** + * Get an element of {@code result}. + */ + public final @Nullable IndexMappingRecord get(String key) { + return this.result.get(key); + } + + /** + * Serialize this value to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + for (Map.Entry item0 : this.result.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetMappingResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Map result = new HashMap<>(); + + /** + * Required - Response value. + *

+ * Adds all entries of map to result. + */ + public final Builder result(Map map) { + this.result = _mapPutAll(this.result, map); + return this; + } + + /** + * Required - Response value. + *

+ * Adds an entry to result. + */ + public final Builder result(String key, IndexMappingRecord value) { + this.result = _mapPut(this.result, key, value); + return this; + } + + /** + * Required - Response value. + *

+ * Adds an entry to result using a builder lambda. + */ + public final Builder result(String key, + Function> fn) { + return result(key, fn.apply(new IndexMappingRecord.Builder()).build()); + } + + @Override + public Builder withJson(JsonParser parser, JsonpMapper mapper) { + + @SuppressWarnings("unchecked") + Map value = (Map) JsonpDeserializer + .stringMapDeserializer(IndexMappingRecord._DESERIALIZER).deserialize(parser, mapper); + return this.result(value); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetMappingResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetMappingResponse build() { + _checkSingleUse(); + + return new GetMappingResponse(this); + } + } + + public static final JsonpDeserializer _DESERIALIZER = createGetMappingResponseDeserializer(); + protected static JsonpDeserializer createGetMappingResponseDeserializer() { + + JsonpDeserializer> valueDeserializer = JsonpDeserializer + .stringMapDeserializer(IndexMappingRecord._DESERIALIZER); + + return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() + .result(valueDeserializer.deserialize(parser, mapper, event)).build()); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetTemplateRequest.java new file mode 100644 index 000000000..85ef8c5c5 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetTemplateRequest.java @@ -0,0 +1,311 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.Boolean; +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; + +// typedef: indices.get_template.Request + +/** + * Retrieves information about one or more index templates. + * + * @see API + * specification + */ + +public class GetTemplateRequest extends RequestBase { + @Nullable + private final Boolean flatSettings; + + @Nullable + private final Boolean local; + + @Nullable + private final Time masterTimeout; + + private final List name; + + // --------------------------------------------------------------------------------------------- + + private GetTemplateRequest(Builder builder) { + + this.flatSettings = builder.flatSettings; + this.local = builder.local; + this.masterTimeout = builder.masterTimeout; + this.name = ApiTypeHelper.unmodifiable(builder.name); + + } + + public static GetTemplateRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code flat_settings} + */ + @Nullable + public final Boolean flatSettings() { + return this.flatSettings; + } + + /** + * If true, the request retrieves information from the local node + * only. + *

+ * API name: {@code local} + */ + @Nullable + public final Boolean local() { + return this.local; + } + + /** + * 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; + } + + /** + * Comma-separated list of index template names used to limit the request. + * Wildcard (*) expressions are supported. To return all index + * templates, omit this parameter or use a value of _all or + * *. + *

+ * API name: {@code name} + */ + public final List name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetTemplateRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean flatSettings; + + @Nullable + private Boolean local; + + @Nullable + private Time masterTimeout; + + @Nullable + private List name; + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code flat_settings} + */ + public final Builder flatSettings(@Nullable Boolean value) { + this.flatSettings = value; + return this; + } + + /** + * If true, the request retrieves information from the local node + * only. + *

+ * API name: {@code local} + */ + public final Builder local(@Nullable Boolean value) { + this.local = 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(@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()); + } + + /** + * Comma-separated list of index template names used to limit the request. + * Wildcard (*) expressions are supported. To return all index + * templates, omit this parameter or use a value of _all or + * *. + *

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

+ * Adds all elements of list to name. + */ + public final Builder name(List list) { + this.name = _listAddAll(this.name, list); + return this; + } + + /** + * Comma-separated list of index template names used to limit the request. + * Wildcard (*) expressions are supported. To return all index + * templates, omit this parameter or use a value of _all or + * *. + *

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

+ * Adds one or more values to name. + */ + public final Builder name(String value, String... values) { + this.name = _listAdd(this.name, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetTemplateRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetTemplateRequest build() { + _checkSingleUse(); + + return new GetTemplateRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.get_template}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.get_template", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.name())) + propsSet |= _name; + + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_template"); + return buf.toString(); + } + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_template"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.name())) + propsSet |= _name; + + if (propsSet == 0) { + } + if (propsSet == (_name)) { + params.put("name", request.name.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.flatSettings != null) { + params.put("flat_settings", String.valueOf(request.flatSettings)); + } + if (request.local != null) { + params.put("local", String.valueOf(request.local)); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, GetTemplateResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetTemplateResponse.java new file mode 100644 index 000000000..71d677396 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/GetTemplateResponse.java @@ -0,0 +1,178 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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 jakarta.json.stream.JsonParser; +import java.lang.String; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.get_template.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class GetTemplateResponse implements JsonpSerializable { + private final Map result; + + // --------------------------------------------------------------------------------------------- + + private GetTemplateResponse(Builder builder) { + + this.result = ApiTypeHelper.unmodifiableRequired(builder.result, this, "result"); + + } + + public static GetTemplateResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Response value. + */ + public final Map result() { + return this.result; + } + + /** + * Get an element of {@code result}. + */ + public final @Nullable TemplateMapping get(String key) { + return this.result.get(key); + } + + /** + * Serialize this value to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + generator.writeStartObject(); + for (Map.Entry item0 : this.result.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link GetTemplateResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Map result = new HashMap<>(); + + /** + * Required - Response value. + *

+ * Adds all entries of map to result. + */ + public final Builder result(Map map) { + this.result = _mapPutAll(this.result, map); + return this; + } + + /** + * Required - Response value. + *

+ * Adds an entry to result. + */ + public final Builder result(String key, TemplateMapping value) { + this.result = _mapPut(this.result, key, value); + return this; + } + + /** + * Required - Response value. + *

+ * Adds an entry to result using a builder lambda. + */ + public final Builder result(String key, Function> fn) { + return result(key, fn.apply(new TemplateMapping.Builder()).build()); + } + + @Override + public Builder withJson(JsonParser parser, JsonpMapper mapper) { + + @SuppressWarnings("unchecked") + Map value = (Map) JsonpDeserializer + .stringMapDeserializer(TemplateMapping._DESERIALIZER).deserialize(parser, mapper); + return this.result(value); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link GetTemplateResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public GetTemplateResponse build() { + _checkSingleUse(); + + return new GetTemplateResponse(this); + } + } + + public static final JsonpDeserializer _DESERIALIZER = createGetTemplateResponseDeserializer(); + protected static JsonpDeserializer createGetTemplateResponseDeserializer() { + + JsonpDeserializer> valueDeserializer = JsonpDeserializer + .stringMapDeserializer(TemplateMapping._DESERIALIZER); + + return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() + .result(valueDeserializer.deserialize(parser, mapper, event)).build()); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexCheckOnStartup.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexCheckOnStartup.java new file mode 100644 index 000000000..79ee0cdb6 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexCheckOnStartup.java @@ -0,0 +1,58 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum IndexCheckOnStartup implements JsonEnum { + True("true"), + + False("false"), + + Checksum("checksum"), + + ; + + private final String jsonValue; + + IndexCheckOnStartup(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + IndexCheckOnStartup.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRouting.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRouting.java new file mode 100644 index 000000000..f820d1603 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRouting.java @@ -0,0 +1,191 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexRouting + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexRouting implements JsonpSerializable { + @Nullable + private final IndexRoutingAllocation allocation; + + @Nullable + private final IndexRoutingRebalance rebalance; + + // --------------------------------------------------------------------------------------------- + + private IndexRouting(Builder builder) { + + this.allocation = builder.allocation; + this.rebalance = builder.rebalance; + + } + + public static IndexRouting of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code allocation} + */ + @Nullable + public final IndexRoutingAllocation allocation() { + return this.allocation; + } + + /** + * API name: {@code rebalance} + */ + @Nullable + public final IndexRoutingRebalance rebalance() { + return this.rebalance; + } + + /** + * 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 (this.allocation != null) { + generator.writeKey("allocation"); + this.allocation.serialize(generator, mapper); + + } + if (this.rebalance != null) { + generator.writeKey("rebalance"); + this.rebalance.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexRouting}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private IndexRoutingAllocation allocation; + + @Nullable + private IndexRoutingRebalance rebalance; + + /** + * API name: {@code allocation} + */ + public final Builder allocation(@Nullable IndexRoutingAllocation value) { + this.allocation = value; + return this; + } + + /** + * API name: {@code allocation} + */ + public final Builder allocation( + Function> fn) { + return this.allocation(fn.apply(new IndexRoutingAllocation.Builder()).build()); + } + + /** + * API name: {@code rebalance} + */ + public final Builder rebalance(@Nullable IndexRoutingRebalance value) { + this.rebalance = value; + return this; + } + + /** + * API name: {@code rebalance} + */ + public final Builder rebalance( + Function> fn) { + return this.rebalance(fn.apply(new IndexRoutingRebalance.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexRouting}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexRouting build() { + _checkSingleUse(); + + return new IndexRouting(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexRouting} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + IndexRouting::setupIndexRoutingDeserializer); + + protected static void setupIndexRoutingDeserializer(ObjectDeserializer op) { + + op.add(Builder::allocation, IndexRoutingAllocation._DESERIALIZER, "allocation"); + op.add(Builder::rebalance, IndexRoutingRebalance._DESERIALIZER, "rebalance"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocation.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocation.java new file mode 100644 index 000000000..ed65cddc9 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocation.java @@ -0,0 +1,260 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexRoutingAllocation + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexRoutingAllocation implements JsonpSerializable { + @Nullable + private final IndexRoutingAllocationOptions enable; + + @Nullable + private final IndexRoutingAllocationInclude include; + + @Nullable + private final IndexRoutingAllocationInitialRecovery initialRecovery; + + @Nullable + private final IndexRoutingAllocationDisk disk; + + // --------------------------------------------------------------------------------------------- + + private IndexRoutingAllocation(Builder builder) { + + this.enable = builder.enable; + this.include = builder.include; + this.initialRecovery = builder.initialRecovery; + this.disk = builder.disk; + + } + + public static IndexRoutingAllocation of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code enable} + */ + @Nullable + public final IndexRoutingAllocationOptions enable() { + return this.enable; + } + + /** + * API name: {@code include} + */ + @Nullable + public final IndexRoutingAllocationInclude include() { + return this.include; + } + + /** + * API name: {@code initial_recovery} + */ + @Nullable + public final IndexRoutingAllocationInitialRecovery initialRecovery() { + return this.initialRecovery; + } + + /** + * API name: {@code disk} + */ + @Nullable + public final IndexRoutingAllocationDisk disk() { + return this.disk; + } + + /** + * 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 (this.enable != null) { + generator.writeKey("enable"); + this.enable.serialize(generator, mapper); + } + if (this.include != null) { + generator.writeKey("include"); + this.include.serialize(generator, mapper); + + } + if (this.initialRecovery != null) { + generator.writeKey("initial_recovery"); + this.initialRecovery.serialize(generator, mapper); + + } + if (this.disk != null) { + generator.writeKey("disk"); + this.disk.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexRoutingAllocation}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private IndexRoutingAllocationOptions enable; + + @Nullable + private IndexRoutingAllocationInclude include; + + @Nullable + private IndexRoutingAllocationInitialRecovery initialRecovery; + + @Nullable + private IndexRoutingAllocationDisk disk; + + /** + * API name: {@code enable} + */ + public final Builder enable(@Nullable IndexRoutingAllocationOptions value) { + this.enable = value; + return this; + } + + /** + * API name: {@code include} + */ + public final Builder include(@Nullable IndexRoutingAllocationInclude value) { + this.include = value; + return this; + } + + /** + * API name: {@code include} + */ + public final Builder include( + Function> fn) { + return this.include(fn.apply(new IndexRoutingAllocationInclude.Builder()).build()); + } + + /** + * API name: {@code initial_recovery} + */ + public final Builder initialRecovery(@Nullable IndexRoutingAllocationInitialRecovery value) { + this.initialRecovery = value; + return this; + } + + /** + * API name: {@code initial_recovery} + */ + public final Builder initialRecovery( + Function> fn) { + return this.initialRecovery(fn.apply(new IndexRoutingAllocationInitialRecovery.Builder()).build()); + } + + /** + * API name: {@code disk} + */ + public final Builder disk(@Nullable IndexRoutingAllocationDisk value) { + this.disk = value; + return this; + } + + /** + * API name: {@code disk} + */ + public final Builder disk( + Function> fn) { + return this.disk(fn.apply(new IndexRoutingAllocationDisk.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexRoutingAllocation}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexRoutingAllocation build() { + _checkSingleUse(); + + return new IndexRoutingAllocation(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexRoutingAllocation} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexRoutingAllocation::setupIndexRoutingAllocationDeserializer); + + protected static void setupIndexRoutingAllocationDeserializer( + ObjectDeserializer op) { + + op.add(Builder::enable, IndexRoutingAllocationOptions._DESERIALIZER, "enable"); + op.add(Builder::include, IndexRoutingAllocationInclude._DESERIALIZER, "include"); + op.add(Builder::initialRecovery, IndexRoutingAllocationInitialRecovery._DESERIALIZER, "initial_recovery"); + op.add(Builder::disk, IndexRoutingAllocationDisk._DESERIALIZER, "disk"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationDisk.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationDisk.java new file mode 100644 index 000000000..32520dc70 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationDisk.java @@ -0,0 +1,151 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexRoutingAllocationDisk + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexRoutingAllocationDisk implements JsonpSerializable { + @Nullable + private final Boolean thresholdEnabled; + + // --------------------------------------------------------------------------------------------- + + private IndexRoutingAllocationDisk(Builder builder) { + + this.thresholdEnabled = builder.thresholdEnabled; + + } + + public static IndexRoutingAllocationDisk of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code threshold_enabled} + */ + @Nullable + public final Boolean thresholdEnabled() { + return this.thresholdEnabled; + } + + /** + * 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 (this.thresholdEnabled != null) { + generator.writeKey("threshold_enabled"); + generator.write(this.thresholdEnabled); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexRoutingAllocationDisk}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Boolean thresholdEnabled; + + /** + * API name: {@code threshold_enabled} + */ + public final Builder thresholdEnabled(@Nullable Boolean value) { + this.thresholdEnabled = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexRoutingAllocationDisk}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexRoutingAllocationDisk build() { + _checkSingleUse(); + + return new IndexRoutingAllocationDisk(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexRoutingAllocationDisk} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexRoutingAllocationDisk::setupIndexRoutingAllocationDiskDeserializer); + + protected static void setupIndexRoutingAllocationDiskDeserializer( + ObjectDeserializer op) { + + op.add(Builder::thresholdEnabled, JsonpDeserializer.booleanDeserializer(), "threshold_enabled"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationInclude.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationInclude.java new file mode 100644 index 000000000..057026958 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationInclude.java @@ -0,0 +1,180 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.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; + +// typedef: indices._types.IndexRoutingAllocationInclude + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexRoutingAllocationInclude implements JsonpSerializable { + @Nullable + private final String tierPreference; + + @Nullable + private final String id; + + // --------------------------------------------------------------------------------------------- + + private IndexRoutingAllocationInclude(Builder builder) { + + this.tierPreference = builder.tierPreference; + this.id = builder.id; + + } + + public static IndexRoutingAllocationInclude of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code _tier_preference} + */ + @Nullable + public final String tierPreference() { + return this.tierPreference; + } + + /** + * API name: {@code _id} + */ + @Nullable + public final String id() { + return this.id; + } + + /** + * 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 (this.tierPreference != null) { + generator.writeKey("_tier_preference"); + generator.write(this.tierPreference); + + } + if (this.id != null) { + generator.writeKey("_id"); + generator.write(this.id); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexRoutingAllocationInclude}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private String tierPreference; + + @Nullable + private String id; + + /** + * API name: {@code _tier_preference} + */ + public final Builder tierPreference(@Nullable String value) { + this.tierPreference = value; + return this; + } + + /** + * API name: {@code _id} + */ + public final Builder id(@Nullable String value) { + this.id = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexRoutingAllocationInclude}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexRoutingAllocationInclude build() { + _checkSingleUse(); + + return new IndexRoutingAllocationInclude(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexRoutingAllocationInclude} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexRoutingAllocationInclude::setupIndexRoutingAllocationIncludeDeserializer); + + protected static void setupIndexRoutingAllocationIncludeDeserializer( + ObjectDeserializer op) { + + op.add(Builder::tierPreference, JsonpDeserializer.stringDeserializer(), "_tier_preference"); + op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "_id"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationInitialRecovery.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationInitialRecovery.java new file mode 100644 index 000000000..612534d9e --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationInitialRecovery.java @@ -0,0 +1,153 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.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; + +// typedef: indices._types.IndexRoutingAllocationInitialRecovery + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexRoutingAllocationInitialRecovery implements JsonpSerializable { + @Nullable + private final String id; + + // --------------------------------------------------------------------------------------------- + + private IndexRoutingAllocationInitialRecovery(Builder builder) { + + this.id = builder.id; + + } + + public static IndexRoutingAllocationInitialRecovery of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code _id} + */ + @Nullable + public final String id() { + return this.id; + } + + /** + * 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 (this.id != null) { + generator.writeKey("_id"); + generator.write(this.id); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexRoutingAllocationInitialRecovery}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private String id; + + /** + * API name: {@code _id} + */ + public final Builder id(@Nullable String value) { + this.id = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexRoutingAllocationInitialRecovery}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexRoutingAllocationInitialRecovery build() { + _checkSingleUse(); + + return new IndexRoutingAllocationInitialRecovery(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexRoutingAllocationInitialRecovery} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, + IndexRoutingAllocationInitialRecovery::setupIndexRoutingAllocationInitialRecoveryDeserializer); + + protected static void setupIndexRoutingAllocationInitialRecoveryDeserializer( + ObjectDeserializer op) { + + op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "_id"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationOptions.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationOptions.java new file mode 100644 index 000000000..4751471a2 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingAllocationOptions.java @@ -0,0 +1,60 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum IndexRoutingAllocationOptions implements JsonEnum { + All("all"), + + Primaries("primaries"), + + NewPrimaries("new_primaries"), + + None("none"), + + ; + + private final String jsonValue; + + IndexRoutingAllocationOptions(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + IndexRoutingAllocationOptions.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingRebalance.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingRebalance.java new file mode 100644 index 000000000..ec0a9b9ff --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingRebalance.java @@ -0,0 +1,144 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexRoutingRebalance + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexRoutingRebalance implements JsonpSerializable { + private final IndexRoutingRebalanceOptions enable; + + // --------------------------------------------------------------------------------------------- + + private IndexRoutingRebalance(Builder builder) { + + this.enable = ApiTypeHelper.requireNonNull(builder.enable, this, "enable"); + + } + + public static IndexRoutingRebalance of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code enable} + */ + public final IndexRoutingRebalanceOptions enable() { + return this.enable; + } + + /** + * 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("enable"); + this.enable.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexRoutingRebalance}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private IndexRoutingRebalanceOptions enable; + + /** + * Required - API name: {@code enable} + */ + public final Builder enable(IndexRoutingRebalanceOptions value) { + this.enable = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexRoutingRebalance}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexRoutingRebalance build() { + _checkSingleUse(); + + return new IndexRoutingRebalance(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexRoutingRebalance} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexRoutingRebalance::setupIndexRoutingRebalanceDeserializer); + + protected static void setupIndexRoutingRebalanceDeserializer(ObjectDeserializer op) { + + op.add(Builder::enable, IndexRoutingRebalanceOptions._DESERIALIZER, "enable"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingRebalanceOptions.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingRebalanceOptions.java new file mode 100644 index 000000000..9dc084631 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexRoutingRebalanceOptions.java @@ -0,0 +1,60 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum IndexRoutingRebalanceOptions implements JsonEnum { + All("all"), + + Primaries("primaries"), + + Replicas("replicas"), + + None("none"), + + ; + + private final String jsonValue; + + IndexRoutingRebalanceOptions(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + IndexRoutingRebalanceOptions.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSegmentSort.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSegmentSort.java new file mode 100644 index 000000000..bde6d251b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSegmentSort.java @@ -0,0 +1,293 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices._types.IndexSegmentSort + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexSegmentSort implements JsonpSerializable { + private final List field; + + private final List order; + + private final List mode; + + private final List missing; + + // --------------------------------------------------------------------------------------------- + + private IndexSegmentSort(Builder builder) { + + this.field = ApiTypeHelper.unmodifiable(builder.field); + this.order = ApiTypeHelper.unmodifiable(builder.order); + this.mode = ApiTypeHelper.unmodifiable(builder.mode); + this.missing = ApiTypeHelper.unmodifiable(builder.missing); + + } + + public static IndexSegmentSort of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code field} + */ + public final List field() { + return this.field; + } + + /** + * API name: {@code order} + */ + public final List order() { + return this.order; + } + + /** + * API name: {@code mode} + */ + public final List mode() { + return this.mode; + } + + /** + * API name: {@code missing} + */ + public final List missing() { + return this.missing; + } + + /** + * 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.field)) { + generator.writeKey("field"); + generator.writeStartArray(); + for (String item0 : this.field) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.order)) { + generator.writeKey("order"); + generator.writeStartArray(); + for (SegmentSortOrder item0 : this.order) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.mode)) { + generator.writeKey("mode"); + generator.writeStartArray(); + for (SegmentSortMode item0 : this.mode) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.missing)) { + generator.writeKey("missing"); + generator.writeStartArray(); + for (SegmentSortMissing item0 : this.missing) { + item0.serialize(generator, mapper); + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexSegmentSort}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private List field; + + @Nullable + private List order; + + @Nullable + private List mode; + + @Nullable + private List missing; + + /** + * API name: {@code field} + *

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

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

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

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

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

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

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

+ * Adds one or more values to missing. + */ + public final Builder missing(SegmentSortMissing value, SegmentSortMissing... values) { + this.missing = _listAdd(this.missing, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexSegmentSort}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexSegmentSort build() { + _checkSingleUse(); + + return new IndexSegmentSort(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSegmentSort} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + IndexSegmentSort::setupIndexSegmentSortDeserializer); + + protected static void setupIndexSegmentSortDeserializer(ObjectDeserializer op) { + + op.add(Builder::field, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "field"); + op.add(Builder::order, JsonpDeserializer.arrayDeserializer(SegmentSortOrder._DESERIALIZER), "order"); + op.add(Builder::mode, JsonpDeserializer.arrayDeserializer(SegmentSortMode._DESERIALIZER), "mode"); + op.add(Builder::missing, JsonpDeserializer.arrayDeserializer(SegmentSortMissing._DESERIALIZER), "missing"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingBlocks.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingBlocks.java new file mode 100644 index 000000000..260f5ffdc --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingBlocks.java @@ -0,0 +1,266 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexSettingBlocks + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexSettingBlocks implements JsonpSerializable { + @Nullable + private final Boolean readOnly; + + @Nullable + private final Boolean readOnlyAllowDelete; + + @Nullable + private final Boolean read; + + @Nullable + private final Boolean write; + + @Nullable + private final Boolean metadata; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingBlocks(Builder builder) { + + this.readOnly = builder.readOnly; + this.readOnlyAllowDelete = builder.readOnlyAllowDelete; + this.read = builder.read; + this.write = builder.write; + this.metadata = builder.metadata; + + } + + public static IndexSettingBlocks of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code read_only} + */ + @Nullable + public final Boolean readOnly() { + return this.readOnly; + } + + /** + * API name: {@code read_only_allow_delete} + */ + @Nullable + public final Boolean readOnlyAllowDelete() { + return this.readOnlyAllowDelete; + } + + /** + * API name: {@code read} + */ + @Nullable + public final Boolean read() { + return this.read; + } + + /** + * API name: {@code write} + */ + @Nullable + public final Boolean write() { + return this.write; + } + + /** + * API name: {@code metadata} + */ + @Nullable + public final Boolean metadata() { + return this.metadata; + } + + /** + * 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 (this.readOnly != null) { + generator.writeKey("read_only"); + generator.write(this.readOnly); + + } + if (this.readOnlyAllowDelete != null) { + generator.writeKey("read_only_allow_delete"); + generator.write(this.readOnlyAllowDelete); + + } + if (this.read != null) { + generator.writeKey("read"); + generator.write(this.read); + + } + if (this.write != null) { + generator.writeKey("write"); + generator.write(this.write); + + } + if (this.metadata != null) { + generator.writeKey("metadata"); + generator.write(this.metadata); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexSettingBlocks}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Boolean readOnly; + + @Nullable + private Boolean readOnlyAllowDelete; + + @Nullable + private Boolean read; + + @Nullable + private Boolean write; + + @Nullable + private Boolean metadata; + + /** + * API name: {@code read_only} + */ + public final Builder readOnly(@Nullable Boolean value) { + this.readOnly = value; + return this; + } + + /** + * API name: {@code read_only_allow_delete} + */ + public final Builder readOnlyAllowDelete(@Nullable Boolean value) { + this.readOnlyAllowDelete = value; + return this; + } + + /** + * API name: {@code read} + */ + public final Builder read(@Nullable Boolean value) { + this.read = value; + return this; + } + + /** + * API name: {@code write} + */ + public final Builder write(@Nullable Boolean value) { + this.write = value; + return this; + } + + /** + * API name: {@code metadata} + */ + public final Builder metadata(@Nullable Boolean value) { + this.metadata = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexSettingBlocks}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexSettingBlocks build() { + _checkSingleUse(); + + return new IndexSettingBlocks(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingBlocks} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexSettingBlocks::setupIndexSettingBlocksDeserializer); + + protected static void setupIndexSettingBlocksDeserializer(ObjectDeserializer op) { + + op.add(Builder::readOnly, JsonpDeserializer.booleanDeserializer(), "read_only"); + op.add(Builder::readOnlyAllowDelete, JsonpDeserializer.booleanDeserializer(), "read_only_allow_delete"); + op.add(Builder::read, JsonpDeserializer.booleanDeserializer(), "read"); + op.add(Builder::write, JsonpDeserializer.booleanDeserializer(), "write"); + op.add(Builder::metadata, JsonpDeserializer.booleanDeserializer(), "metadata"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java new file mode 100644 index 000000000..98884fc98 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettings.java @@ -0,0 +1,2063 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.json.JsonData; +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.DateTime; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.Integer; +import java.lang.Long; +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 javax.annotation.Nullable; + +// typedef: indices._types.IndexSettings + +/** + * + * @see Documentation + * on elastic.co + * @see API + * specification + */ +@JsonpDeserializable +public class IndexSettings implements JsonpSerializable { + private final Map otherSettings; + + @Nullable + private final IndexSettings index; + + @Nullable + private final String mode; + + private final List routingPath; + + @Nullable + private final SoftDeletes softDeletes; + + @Nullable + private final IndexSegmentSort sort; + + @Nullable + private final String numberOfShards; + + @Nullable + private final String numberOfReplicas; + + @Nullable + private final Integer numberOfRoutingShards; + + @Nullable + private final IndexCheckOnStartup checkOnStartup; + + @Nullable + private final String codec; + + @Nullable + private final Integer routingPartitionSize; + + @Nullable + private final Boolean loadFixedBitsetFiltersEagerly; + + @Nullable + private final Boolean hidden; + + @Nullable + private final String autoExpandReplicas; + + @Nullable + private final Merge merge; + + @Nullable + private final SettingsSearch search; + + @Nullable + private final Time refreshInterval; + + @Nullable + private final Integer maxResultWindow; + + @Nullable + private final Integer maxInnerResultWindow; + + @Nullable + private final Integer maxRescoreWindow; + + @Nullable + private final Integer maxDocvalueFieldsSearch; + + @Nullable + private final Integer maxScriptFields; + + @Nullable + private final Integer maxNgramDiff; + + @Nullable + private final Integer maxShingleDiff; + + @Nullable + private final IndexSettingBlocks blocks; + + @Nullable + private final Integer maxRefreshListeners; + + @Nullable + private final SettingsAnalyze analyze; + + @Nullable + private final SettingsHighlight highlight; + + @Nullable + private final Integer maxTermsCount; + + @Nullable + private final Integer maxRegexLength; + + @Nullable + private final IndexRouting routing; + + @Nullable + private final Time gcDeletes; + + @Nullable + private final String defaultPipeline; + + @Nullable + private final String finalPipeline; + + @Nullable + private final IndexSettingsLifecycle lifecycle; + + @Nullable + private final String providedName; + + @Nullable + private final Long creationDate; + + @Nullable + private final DateTime creationDateString; + + @Nullable + private final String uuid; + + @Nullable + private final IndexVersioning version; + + @Nullable + private final Boolean verifiedBeforeClose; + + @Nullable + private final String format; + + @Nullable + private final Integer maxSlicesPerScroll; + + @Nullable + private final Translog translog; + + @Nullable + private final SettingsQueryString queryString; + + @Nullable + private final String priority; + + @Nullable + private final Integer topMetricsMaxSize; + + @Nullable + private final IndexSettingsAnalysis analysis; + + @Nullable + private final IndexSettings settings; + + @Nullable + private final IndexSettingsTimeSeries timeSeries; + + @Nullable + private final Integer shards; + + @Nullable + private final Queries queries; + + @Nullable + private final SettingsSimilarity similarity; + + @Nullable + private final MappingLimitSettings mapping; + + @Nullable + private final IndexingSlowlogSettings indexingSlowlog; + + @Nullable + private final IndexingPressure indexingPressure; + + @Nullable + private final Storage store; + + // --------------------------------------------------------------------------------------------- + + private IndexSettings(Builder builder) { + + this.otherSettings = ApiTypeHelper.unmodifiable(builder.otherSettings); + + this.index = builder.index; + this.mode = builder.mode; + this.routingPath = ApiTypeHelper.unmodifiable(builder.routingPath); + this.softDeletes = builder.softDeletes; + this.sort = builder.sort; + this.numberOfShards = builder.numberOfShards; + this.numberOfReplicas = builder.numberOfReplicas; + this.numberOfRoutingShards = builder.numberOfRoutingShards; + this.checkOnStartup = builder.checkOnStartup; + this.codec = builder.codec; + this.routingPartitionSize = builder.routingPartitionSize; + this.loadFixedBitsetFiltersEagerly = builder.loadFixedBitsetFiltersEagerly; + this.hidden = builder.hidden; + this.autoExpandReplicas = builder.autoExpandReplicas; + this.merge = builder.merge; + this.search = builder.search; + this.refreshInterval = builder.refreshInterval; + this.maxResultWindow = builder.maxResultWindow; + this.maxInnerResultWindow = builder.maxInnerResultWindow; + this.maxRescoreWindow = builder.maxRescoreWindow; + this.maxDocvalueFieldsSearch = builder.maxDocvalueFieldsSearch; + this.maxScriptFields = builder.maxScriptFields; + this.maxNgramDiff = builder.maxNgramDiff; + this.maxShingleDiff = builder.maxShingleDiff; + this.blocks = builder.blocks; + this.maxRefreshListeners = builder.maxRefreshListeners; + this.analyze = builder.analyze; + this.highlight = builder.highlight; + this.maxTermsCount = builder.maxTermsCount; + this.maxRegexLength = builder.maxRegexLength; + this.routing = builder.routing; + this.gcDeletes = builder.gcDeletes; + this.defaultPipeline = builder.defaultPipeline; + this.finalPipeline = builder.finalPipeline; + this.lifecycle = builder.lifecycle; + this.providedName = builder.providedName; + this.creationDate = builder.creationDate; + this.creationDateString = builder.creationDateString; + this.uuid = builder.uuid; + this.version = builder.version; + this.verifiedBeforeClose = builder.verifiedBeforeClose; + this.format = builder.format; + this.maxSlicesPerScroll = builder.maxSlicesPerScroll; + this.translog = builder.translog; + this.queryString = builder.queryString; + this.priority = builder.priority; + this.topMetricsMaxSize = builder.topMetricsMaxSize; + this.analysis = builder.analysis; + this.settings = builder.settings; + this.timeSeries = builder.timeSeries; + this.shards = builder.shards; + this.queries = builder.queries; + this.similarity = builder.similarity; + this.mapping = builder.mapping; + this.indexingSlowlog = builder.indexingSlowlog; + this.indexingPressure = builder.indexingPressure; + this.store = builder.store; + + } + + public static IndexSettings of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Additional settings not covered in this type. Unless these settings are + * defined by a plugin, please open an issue on the Elasticsearch API + * specification so that they can be added in a future release. + */ + public final Map otherSettings() { + return this.otherSettings; + } + + /** + * API name: {@code index} + */ + @Nullable + public final IndexSettings index() { + return this.index; + } + + /** + * API name: {@code mode} + */ + @Nullable + public final String mode() { + return this.mode; + } + + /** + * API name: {@code routing_path} + */ + public final List routingPath() { + return this.routingPath; + } + + /** + * API name: {@code soft_deletes} + */ + @Nullable + public final SoftDeletes softDeletes() { + return this.softDeletes; + } + + /** + * API name: {@code sort} + */ + @Nullable + public final IndexSegmentSort sort() { + return this.sort; + } + + /** + * API name: {@code number_of_shards} + */ + @Nullable + public final String numberOfShards() { + return this.numberOfShards; + } + + /** + * API name: {@code number_of_replicas} + */ + @Nullable + public final String numberOfReplicas() { + return this.numberOfReplicas; + } + + /** + * API name: {@code number_of_routing_shards} + */ + @Nullable + public final Integer numberOfRoutingShards() { + return this.numberOfRoutingShards; + } + + /** + * API name: {@code check_on_startup} + */ + @Nullable + public final IndexCheckOnStartup checkOnStartup() { + return this.checkOnStartup; + } + + /** + * API name: {@code codec} + */ + @Nullable + public final String codec() { + return this.codec; + } + + /** + * API name: {@code routing_partition_size} + */ + @Nullable + public final Integer routingPartitionSize() { + return this.routingPartitionSize; + } + + /** + * API name: {@code load_fixed_bitset_filters_eagerly} + */ + @Nullable + public final Boolean loadFixedBitsetFiltersEagerly() { + return this.loadFixedBitsetFiltersEagerly; + } + + /** + * API name: {@code hidden} + */ + @Nullable + public final Boolean hidden() { + return this.hidden; + } + + /** + * API name: {@code auto_expand_replicas} + */ + @Nullable + public final String autoExpandReplicas() { + return this.autoExpandReplicas; + } + + /** + * API name: {@code merge} + */ + @Nullable + public final Merge merge() { + return this.merge; + } + + /** + * API name: {@code search} + */ + @Nullable + public final SettingsSearch search() { + return this.search; + } + + /** + * API name: {@code refresh_interval} + */ + @Nullable + public final Time refreshInterval() { + return this.refreshInterval; + } + + /** + * API name: {@code max_result_window} + */ + @Nullable + public final Integer maxResultWindow() { + return this.maxResultWindow; + } + + /** + * API name: {@code max_inner_result_window} + */ + @Nullable + public final Integer maxInnerResultWindow() { + return this.maxInnerResultWindow; + } + + /** + * API name: {@code max_rescore_window} + */ + @Nullable + public final Integer maxRescoreWindow() { + return this.maxRescoreWindow; + } + + /** + * API name: {@code max_docvalue_fields_search} + */ + @Nullable + public final Integer maxDocvalueFieldsSearch() { + return this.maxDocvalueFieldsSearch; + } + + /** + * API name: {@code max_script_fields} + */ + @Nullable + public final Integer maxScriptFields() { + return this.maxScriptFields; + } + + /** + * API name: {@code max_ngram_diff} + */ + @Nullable + public final Integer maxNgramDiff() { + return this.maxNgramDiff; + } + + /** + * API name: {@code max_shingle_diff} + */ + @Nullable + public final Integer maxShingleDiff() { + return this.maxShingleDiff; + } + + /** + * API name: {@code blocks} + */ + @Nullable + public final IndexSettingBlocks blocks() { + return this.blocks; + } + + /** + * API name: {@code max_refresh_listeners} + */ + @Nullable + public final Integer maxRefreshListeners() { + return this.maxRefreshListeners; + } + + /** + * Settings to define analyzers, tokenizers, token filters and character + * filters. + *

+ * API name: {@code analyze} + */ + @Nullable + public final SettingsAnalyze analyze() { + return this.analyze; + } + + /** + * API name: {@code highlight} + */ + @Nullable + public final SettingsHighlight highlight() { + return this.highlight; + } + + /** + * API name: {@code max_terms_count} + */ + @Nullable + public final Integer maxTermsCount() { + return this.maxTermsCount; + } + + /** + * API name: {@code max_regex_length} + */ + @Nullable + public final Integer maxRegexLength() { + return this.maxRegexLength; + } + + /** + * API name: {@code routing} + */ + @Nullable + public final IndexRouting routing() { + return this.routing; + } + + /** + * API name: {@code gc_deletes} + */ + @Nullable + public final Time gcDeletes() { + return this.gcDeletes; + } + + /** + * API name: {@code default_pipeline} + */ + @Nullable + public final String defaultPipeline() { + return this.defaultPipeline; + } + + /** + * API name: {@code final_pipeline} + */ + @Nullable + public final String finalPipeline() { + return this.finalPipeline; + } + + /** + * API name: {@code lifecycle} + */ + @Nullable + public final IndexSettingsLifecycle lifecycle() { + return this.lifecycle; + } + + /** + * API name: {@code provided_name} + */ + @Nullable + public final String providedName() { + return this.providedName; + } + + /** + * API name: {@code creation_date} + */ + @Nullable + public final Long creationDate() { + return this.creationDate; + } + + /** + * API name: {@code creation_date_string} + */ + @Nullable + public final DateTime creationDateString() { + return this.creationDateString; + } + + /** + * API name: {@code uuid} + */ + @Nullable + public final String uuid() { + return this.uuid; + } + + /** + * API name: {@code version} + */ + @Nullable + public final IndexVersioning version() { + return this.version; + } + + /** + * API name: {@code verified_before_close} + */ + @Nullable + public final Boolean verifiedBeforeClose() { + return this.verifiedBeforeClose; + } + + /** + * API name: {@code format} + */ + @Nullable + public final String format() { + return this.format; + } + + /** + * API name: {@code max_slices_per_scroll} + */ + @Nullable + public final Integer maxSlicesPerScroll() { + return this.maxSlicesPerScroll; + } + + /** + * API name: {@code translog} + */ + @Nullable + public final Translog translog() { + return this.translog; + } + + /** + * API name: {@code query_string} + */ + @Nullable + public final SettingsQueryString queryString() { + return this.queryString; + } + + /** + * API name: {@code priority} + */ + @Nullable + public final String priority() { + return this.priority; + } + + /** + * API name: {@code top_metrics_max_size} + */ + @Nullable + public final Integer topMetricsMaxSize() { + return this.topMetricsMaxSize; + } + + /** + * API name: {@code analysis} + */ + @Nullable + public final IndexSettingsAnalysis analysis() { + return this.analysis; + } + + /** + * API name: {@code settings} + */ + @Nullable + public final IndexSettings settings() { + return this.settings; + } + + /** + * API name: {@code time_series} + */ + @Nullable + public final IndexSettingsTimeSeries timeSeries() { + return this.timeSeries; + } + + /** + * API name: {@code shards} + */ + @Nullable + public final Integer shards() { + return this.shards; + } + + /** + * API name: {@code queries} + */ + @Nullable + public final Queries queries() { + return this.queries; + } + + /** + * Configure custom similarity settings to customize how search results are + * scored. + *

+ * API name: {@code similarity} + */ + @Nullable + public final SettingsSimilarity similarity() { + return this.similarity; + } + + /** + * Enable or disable dynamic mapping for an index. + *

+ * API name: {@code mapping} + */ + @Nullable + public final MappingLimitSettings mapping() { + return this.mapping; + } + + /** + * API name: {@code indexing.slowlog} + */ + @Nullable + public final IndexingSlowlogSettings indexingSlowlog() { + return this.indexingSlowlog; + } + + /** + * Configure indexing back pressure limits. + *

+ * API name: {@code indexing_pressure} + */ + @Nullable + public final IndexingPressure indexingPressure() { + return this.indexingPressure; + } + + /** + * The store module allows you to control how index data is stored and accessed + * on disk. + *

+ * API name: {@code store} + */ + @Nullable + public final Storage store() { + return this.store; + } + + /** + * 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) { + + for (Map.Entry item0 : this.otherSettings.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + + if (this.index != null) { + generator.writeKey("index"); + this.index.serialize(generator, mapper); + + } + if (this.mode != null) { + generator.writeKey("mode"); + generator.write(this.mode); + + } + if (ApiTypeHelper.isDefined(this.routingPath)) { + generator.writeKey("routing_path"); + generator.writeStartArray(); + for (String item0 : this.routingPath) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.softDeletes != null) { + generator.writeKey("soft_deletes"); + this.softDeletes.serialize(generator, mapper); + + } + if (this.sort != null) { + generator.writeKey("sort"); + this.sort.serialize(generator, mapper); + + } + if (this.numberOfShards != null) { + generator.writeKey("number_of_shards"); + generator.write(this.numberOfShards); + + } + if (this.numberOfReplicas != null) { + generator.writeKey("number_of_replicas"); + generator.write(this.numberOfReplicas); + + } + if (this.numberOfRoutingShards != null) { + generator.writeKey("number_of_routing_shards"); + generator.write(this.numberOfRoutingShards); + + } + if (this.checkOnStartup != null) { + generator.writeKey("check_on_startup"); + this.checkOnStartup.serialize(generator, mapper); + } + if (this.codec != null) { + generator.writeKey("codec"); + generator.write(this.codec); + + } + if (this.routingPartitionSize != null) { + generator.writeKey("routing_partition_size"); + generator.write(this.routingPartitionSize); + + } + if (this.loadFixedBitsetFiltersEagerly != null) { + generator.writeKey("load_fixed_bitset_filters_eagerly"); + generator.write(this.loadFixedBitsetFiltersEagerly); + + } + if (this.hidden != null) { + generator.writeKey("hidden"); + generator.write(this.hidden); + + } + if (this.autoExpandReplicas != null) { + generator.writeKey("auto_expand_replicas"); + generator.write(this.autoExpandReplicas); + + } + if (this.merge != null) { + generator.writeKey("merge"); + this.merge.serialize(generator, mapper); + + } + if (this.search != null) { + generator.writeKey("search"); + this.search.serialize(generator, mapper); + + } + if (this.refreshInterval != null) { + generator.writeKey("refresh_interval"); + this.refreshInterval.serialize(generator, mapper); + + } + if (this.maxResultWindow != null) { + generator.writeKey("max_result_window"); + generator.write(this.maxResultWindow); + + } + if (this.maxInnerResultWindow != null) { + generator.writeKey("max_inner_result_window"); + generator.write(this.maxInnerResultWindow); + + } + if (this.maxRescoreWindow != null) { + generator.writeKey("max_rescore_window"); + generator.write(this.maxRescoreWindow); + + } + if (this.maxDocvalueFieldsSearch != null) { + generator.writeKey("max_docvalue_fields_search"); + generator.write(this.maxDocvalueFieldsSearch); + + } + if (this.maxScriptFields != null) { + generator.writeKey("max_script_fields"); + generator.write(this.maxScriptFields); + + } + if (this.maxNgramDiff != null) { + generator.writeKey("max_ngram_diff"); + generator.write(this.maxNgramDiff); + + } + if (this.maxShingleDiff != null) { + generator.writeKey("max_shingle_diff"); + generator.write(this.maxShingleDiff); + + } + if (this.blocks != null) { + generator.writeKey("blocks"); + this.blocks.serialize(generator, mapper); + + } + if (this.maxRefreshListeners != null) { + generator.writeKey("max_refresh_listeners"); + generator.write(this.maxRefreshListeners); + + } + if (this.analyze != null) { + generator.writeKey("analyze"); + this.analyze.serialize(generator, mapper); + + } + if (this.highlight != null) { + generator.writeKey("highlight"); + this.highlight.serialize(generator, mapper); + + } + if (this.maxTermsCount != null) { + generator.writeKey("max_terms_count"); + generator.write(this.maxTermsCount); + + } + if (this.maxRegexLength != null) { + generator.writeKey("max_regex_length"); + generator.write(this.maxRegexLength); + + } + if (this.routing != null) { + generator.writeKey("routing"); + this.routing.serialize(generator, mapper); + + } + if (this.gcDeletes != null) { + generator.writeKey("gc_deletes"); + this.gcDeletes.serialize(generator, mapper); + + } + if (this.defaultPipeline != null) { + generator.writeKey("default_pipeline"); + generator.write(this.defaultPipeline); + + } + if (this.finalPipeline != null) { + generator.writeKey("final_pipeline"); + generator.write(this.finalPipeline); + + } + if (this.lifecycle != null) { + generator.writeKey("lifecycle"); + this.lifecycle.serialize(generator, mapper); + + } + if (this.providedName != null) { + generator.writeKey("provided_name"); + generator.write(this.providedName); + + } + if (this.creationDate != null) { + generator.writeKey("creation_date"); + generator.write(this.creationDate); + + } + if (this.creationDateString != null) { + generator.writeKey("creation_date_string"); + this.creationDateString.serialize(generator, mapper); + } + if (this.uuid != null) { + generator.writeKey("uuid"); + generator.write(this.uuid); + + } + if (this.version != null) { + generator.writeKey("version"); + this.version.serialize(generator, mapper); + + } + if (this.verifiedBeforeClose != null) { + generator.writeKey("verified_before_close"); + generator.write(this.verifiedBeforeClose); + + } + if (this.format != null) { + generator.writeKey("format"); + generator.write(this.format); + + } + if (this.maxSlicesPerScroll != null) { + generator.writeKey("max_slices_per_scroll"); + generator.write(this.maxSlicesPerScroll); + + } + if (this.translog != null) { + generator.writeKey("translog"); + this.translog.serialize(generator, mapper); + + } + if (this.queryString != null) { + generator.writeKey("query_string"); + this.queryString.serialize(generator, mapper); + + } + if (this.priority != null) { + generator.writeKey("priority"); + generator.write(this.priority); + + } + if (this.topMetricsMaxSize != null) { + generator.writeKey("top_metrics_max_size"); + generator.write(this.topMetricsMaxSize); + + } + if (this.analysis != null) { + generator.writeKey("analysis"); + this.analysis.serialize(generator, mapper); + + } + if (this.settings != null) { + generator.writeKey("settings"); + this.settings.serialize(generator, mapper); + + } + if (this.timeSeries != null) { + generator.writeKey("time_series"); + this.timeSeries.serialize(generator, mapper); + + } + if (this.shards != null) { + generator.writeKey("shards"); + generator.write(this.shards); + + } + if (this.queries != null) { + generator.writeKey("queries"); + this.queries.serialize(generator, mapper); + + } + if (this.similarity != null) { + generator.writeKey("similarity"); + this.similarity.serialize(generator, mapper); + + } + if (this.mapping != null) { + generator.writeKey("mapping"); + this.mapping.serialize(generator, mapper); + + } + if (this.indexingSlowlog != null) { + generator.writeKey("indexing.slowlog"); + this.indexingSlowlog.serialize(generator, mapper); + + } + if (this.indexingPressure != null) { + generator.writeKey("indexing_pressure"); + this.indexingPressure.serialize(generator, mapper); + + } + if (this.store != null) { + generator.writeKey("store"); + this.store.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexSettings}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Map otherSettings = new HashMap<>(); + + /** + * Additional settings not covered in this type. Unless these settings are + * defined by a plugin, please open an issue on the Elasticsearch API + * specification so that they can be added in a future release. + *

+ * Adds all entries of map to otherSettings. + */ + public final Builder otherSettings(Map map) { + this.otherSettings = _mapPutAll(this.otherSettings, map); + return this; + } + + /** + * Additional settings not covered in this type. Unless these settings are + * defined by a plugin, please open an issue on the Elasticsearch API + * specification so that they can be added in a future release. + *

+ * Adds an entry to otherSettings. + */ + public final Builder otherSettings(String key, JsonData value) { + this.otherSettings = _mapPut(this.otherSettings, key, value); + return this; + } + + @Nullable + private IndexSettings index; + + @Nullable + private String mode; + + @Nullable + private List routingPath; + + @Nullable + private SoftDeletes softDeletes; + + @Nullable + private IndexSegmentSort sort; + + @Nullable + private String numberOfShards; + + @Nullable + private String numberOfReplicas; + + @Nullable + private Integer numberOfRoutingShards; + + @Nullable + private IndexCheckOnStartup checkOnStartup; + + @Nullable + private String codec; + + @Nullable + private Integer routingPartitionSize; + + @Nullable + private Boolean loadFixedBitsetFiltersEagerly; + + @Nullable + private Boolean hidden; + + @Nullable + private String autoExpandReplicas; + + @Nullable + private Merge merge; + + @Nullable + private SettingsSearch search; + + @Nullable + private Time refreshInterval; + + @Nullable + private Integer maxResultWindow; + + @Nullable + private Integer maxInnerResultWindow; + + @Nullable + private Integer maxRescoreWindow; + + @Nullable + private Integer maxDocvalueFieldsSearch; + + @Nullable + private Integer maxScriptFields; + + @Nullable + private Integer maxNgramDiff; + + @Nullable + private Integer maxShingleDiff; + + @Nullable + private IndexSettingBlocks blocks; + + @Nullable + private Integer maxRefreshListeners; + + @Nullable + private SettingsAnalyze analyze; + + @Nullable + private SettingsHighlight highlight; + + @Nullable + private Integer maxTermsCount; + + @Nullable + private Integer maxRegexLength; + + @Nullable + private IndexRouting routing; + + @Nullable + private Time gcDeletes; + + @Nullable + private String defaultPipeline; + + @Nullable + private String finalPipeline; + + @Nullable + private IndexSettingsLifecycle lifecycle; + + @Nullable + private String providedName; + + @Nullable + private Long creationDate; + + @Nullable + private DateTime creationDateString; + + @Nullable + private String uuid; + + @Nullable + private IndexVersioning version; + + @Nullable + private Boolean verifiedBeforeClose; + + @Nullable + private String format; + + @Nullable + private Integer maxSlicesPerScroll; + + @Nullable + private Translog translog; + + @Nullable + private SettingsQueryString queryString; + + @Nullable + private String priority; + + @Nullable + private Integer topMetricsMaxSize; + + @Nullable + private IndexSettingsAnalysis analysis; + + @Nullable + private IndexSettings settings; + + @Nullable + private IndexSettingsTimeSeries timeSeries; + + @Nullable + private Integer shards; + + @Nullable + private Queries queries; + + @Nullable + private SettingsSimilarity similarity; + + @Nullable + private MappingLimitSettings mapping; + + @Nullable + private IndexingSlowlogSettings indexingSlowlog; + + @Nullable + private IndexingPressure indexingPressure; + + @Nullable + private Storage store; + + /** + * API name: {@code index} + */ + public final Builder index(@Nullable IndexSettings value) { + this.index = value; + return this; + } + + /** + * API name: {@code index} + */ + public final Builder index(Function> fn) { + return this.index(fn.apply(new IndexSettings.Builder()).build()); + } + + /** + * API name: {@code mode} + */ + public final Builder mode(@Nullable String value) { + this.mode = value; + return this; + } + + /** + * API name: {@code routing_path} + *

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

+ * Adds one or more values to routingPath. + */ + public final Builder routingPath(String value, String... values) { + this.routingPath = _listAdd(this.routingPath, value, values); + return this; + } + + /** + * API name: {@code soft_deletes} + */ + public final Builder softDeletes(@Nullable SoftDeletes value) { + this.softDeletes = value; + return this; + } + + /** + * API name: {@code soft_deletes} + */ + public final Builder softDeletes(Function> fn) { + return this.softDeletes(fn.apply(new SoftDeletes.Builder()).build()); + } + + /** + * API name: {@code sort} + */ + public final Builder sort(@Nullable IndexSegmentSort value) { + this.sort = value; + return this; + } + + /** + * API name: {@code sort} + */ + public final Builder sort(Function> fn) { + return this.sort(fn.apply(new IndexSegmentSort.Builder()).build()); + } + + /** + * API name: {@code number_of_shards} + */ + public final Builder numberOfShards(@Nullable String value) { + this.numberOfShards = value; + return this; + } + + /** + * API name: {@code number_of_replicas} + */ + public final Builder numberOfReplicas(@Nullable String value) { + this.numberOfReplicas = value; + return this; + } + + /** + * API name: {@code number_of_routing_shards} + */ + public final Builder numberOfRoutingShards(@Nullable Integer value) { + this.numberOfRoutingShards = value; + return this; + } + + /** + * API name: {@code check_on_startup} + */ + public final Builder checkOnStartup(@Nullable IndexCheckOnStartup value) { + this.checkOnStartup = value; + return this; + } + + /** + * API name: {@code codec} + */ + public final Builder codec(@Nullable String value) { + this.codec = value; + return this; + } + + /** + * API name: {@code routing_partition_size} + */ + public final Builder routingPartitionSize(@Nullable Integer value) { + this.routingPartitionSize = value; + return this; + } + + /** + * API name: {@code load_fixed_bitset_filters_eagerly} + */ + public final Builder loadFixedBitsetFiltersEagerly(@Nullable Boolean value) { + this.loadFixedBitsetFiltersEagerly = value; + return this; + } + + /** + * API name: {@code hidden} + */ + public final Builder hidden(@Nullable Boolean value) { + this.hidden = value; + return this; + } + + /** + * API name: {@code auto_expand_replicas} + */ + public final Builder autoExpandReplicas(@Nullable String value) { + this.autoExpandReplicas = value; + return this; + } + + /** + * API name: {@code merge} + */ + public final Builder merge(@Nullable Merge value) { + this.merge = value; + return this; + } + + /** + * API name: {@code merge} + */ + public final Builder merge(Function> fn) { + return this.merge(fn.apply(new Merge.Builder()).build()); + } + + /** + * API name: {@code search} + */ + public final Builder search(@Nullable SettingsSearch value) { + this.search = value; + return this; + } + + /** + * API name: {@code search} + */ + public final Builder search(Function> fn) { + return this.search(fn.apply(new SettingsSearch.Builder()).build()); + } + + /** + * API name: {@code refresh_interval} + */ + public final Builder refreshInterval(@Nullable Time value) { + this.refreshInterval = value; + return this; + } + + /** + * API name: {@code refresh_interval} + */ + public final Builder refreshInterval(Function> fn) { + return this.refreshInterval(fn.apply(new Time.Builder()).build()); + } + + /** + * API name: {@code max_result_window} + */ + public final Builder maxResultWindow(@Nullable Integer value) { + this.maxResultWindow = value; + return this; + } + + /** + * API name: {@code max_inner_result_window} + */ + public final Builder maxInnerResultWindow(@Nullable Integer value) { + this.maxInnerResultWindow = value; + return this; + } + + /** + * API name: {@code max_rescore_window} + */ + public final Builder maxRescoreWindow(@Nullable Integer value) { + this.maxRescoreWindow = value; + return this; + } + + /** + * API name: {@code max_docvalue_fields_search} + */ + public final Builder maxDocvalueFieldsSearch(@Nullable Integer value) { + this.maxDocvalueFieldsSearch = value; + return this; + } + + /** + * API name: {@code max_script_fields} + */ + public final Builder maxScriptFields(@Nullable Integer value) { + this.maxScriptFields = value; + return this; + } + + /** + * API name: {@code max_ngram_diff} + */ + public final Builder maxNgramDiff(@Nullable Integer value) { + this.maxNgramDiff = value; + return this; + } + + /** + * API name: {@code max_shingle_diff} + */ + public final Builder maxShingleDiff(@Nullable Integer value) { + this.maxShingleDiff = value; + return this; + } + + /** + * API name: {@code blocks} + */ + public final Builder blocks(@Nullable IndexSettingBlocks value) { + this.blocks = value; + return this; + } + + /** + * API name: {@code blocks} + */ + public final Builder blocks(Function> fn) { + return this.blocks(fn.apply(new IndexSettingBlocks.Builder()).build()); + } + + /** + * API name: {@code max_refresh_listeners} + */ + public final Builder maxRefreshListeners(@Nullable Integer value) { + this.maxRefreshListeners = value; + return this; + } + + /** + * Settings to define analyzers, tokenizers, token filters and character + * filters. + *

+ * API name: {@code analyze} + */ + public final Builder analyze(@Nullable SettingsAnalyze value) { + this.analyze = value; + return this; + } + + /** + * Settings to define analyzers, tokenizers, token filters and character + * filters. + *

+ * API name: {@code analyze} + */ + public final Builder analyze(Function> fn) { + return this.analyze(fn.apply(new SettingsAnalyze.Builder()).build()); + } + + /** + * API name: {@code highlight} + */ + public final Builder highlight(@Nullable SettingsHighlight value) { + this.highlight = value; + return this; + } + + /** + * API name: {@code highlight} + */ + public final Builder highlight(Function> fn) { + return this.highlight(fn.apply(new SettingsHighlight.Builder()).build()); + } + + /** + * API name: {@code max_terms_count} + */ + public final Builder maxTermsCount(@Nullable Integer value) { + this.maxTermsCount = value; + return this; + } + + /** + * API name: {@code max_regex_length} + */ + public final Builder maxRegexLength(@Nullable Integer value) { + this.maxRegexLength = value; + return this; + } + + /** + * API name: {@code routing} + */ + public final Builder routing(@Nullable IndexRouting value) { + this.routing = value; + return this; + } + + /** + * API name: {@code routing} + */ + public final Builder routing(Function> fn) { + return this.routing(fn.apply(new IndexRouting.Builder()).build()); + } + + /** + * API name: {@code gc_deletes} + */ + public final Builder gcDeletes(@Nullable Time value) { + this.gcDeletes = value; + return this; + } + + /** + * API name: {@code gc_deletes} + */ + public final Builder gcDeletes(Function> fn) { + return this.gcDeletes(fn.apply(new Time.Builder()).build()); + } + + /** + * API name: {@code default_pipeline} + */ + public final Builder defaultPipeline(@Nullable String value) { + this.defaultPipeline = value; + return this; + } + + /** + * API name: {@code final_pipeline} + */ + public final Builder finalPipeline(@Nullable String value) { + this.finalPipeline = value; + return this; + } + + /** + * API name: {@code lifecycle} + */ + public final Builder lifecycle(@Nullable IndexSettingsLifecycle value) { + this.lifecycle = value; + return this; + } + + /** + * API name: {@code lifecycle} + */ + public final Builder lifecycle( + Function> fn) { + return this.lifecycle(fn.apply(new IndexSettingsLifecycle.Builder()).build()); + } + + /** + * API name: {@code provided_name} + */ + public final Builder providedName(@Nullable String value) { + this.providedName = value; + return this; + } + + /** + * API name: {@code creation_date} + */ + public final Builder creationDate(@Nullable Long value) { + this.creationDate = value; + return this; + } + + /** + * API name: {@code creation_date_string} + */ + public final Builder creationDateString(@Nullable DateTime value) { + this.creationDateString = value; + return this; + } + + /** + * API name: {@code uuid} + */ + public final Builder uuid(@Nullable String value) { + this.uuid = value; + return this; + } + + /** + * API name: {@code version} + */ + public final Builder version(@Nullable IndexVersioning value) { + this.version = value; + return this; + } + + /** + * API name: {@code version} + */ + public final Builder version(Function> fn) { + return this.version(fn.apply(new IndexVersioning.Builder()).build()); + } + + /** + * API name: {@code verified_before_close} + */ + public final Builder verifiedBeforeClose(@Nullable Boolean value) { + this.verifiedBeforeClose = value; + return this; + } + + /** + * API name: {@code format} + */ + public final Builder format(@Nullable String value) { + this.format = value; + return this; + } + + /** + * API name: {@code max_slices_per_scroll} + */ + public final Builder maxSlicesPerScroll(@Nullable Integer value) { + this.maxSlicesPerScroll = value; + return this; + } + + /** + * API name: {@code translog} + */ + public final Builder translog(@Nullable Translog value) { + this.translog = value; + return this; + } + + /** + * API name: {@code translog} + */ + public final Builder translog(Function> fn) { + return this.translog(fn.apply(new Translog.Builder()).build()); + } + + /** + * API name: {@code query_string} + */ + public final Builder queryString(@Nullable SettingsQueryString value) { + this.queryString = value; + return this; + } + + /** + * API name: {@code query_string} + */ + public final Builder queryString(Function> fn) { + return this.queryString(fn.apply(new SettingsQueryString.Builder()).build()); + } + + /** + * API name: {@code priority} + */ + public final Builder priority(@Nullable String value) { + this.priority = value; + return this; + } + + /** + * API name: {@code top_metrics_max_size} + */ + public final Builder topMetricsMaxSize(@Nullable Integer value) { + this.topMetricsMaxSize = value; + return this; + } + + /** + * API name: {@code analysis} + */ + public final Builder analysis(@Nullable IndexSettingsAnalysis value) { + this.analysis = value; + return this; + } + + /** + * API name: {@code analysis} + */ + public final Builder analysis( + Function> fn) { + return this.analysis(fn.apply(new IndexSettingsAnalysis.Builder()).build()); + } + + /** + * API name: {@code settings} + */ + public final Builder settings(@Nullable IndexSettings value) { + this.settings = value; + return this; + } + + /** + * API name: {@code settings} + */ + public final Builder settings(Function> fn) { + return this.settings(fn.apply(new IndexSettings.Builder()).build()); + } + + /** + * API name: {@code time_series} + */ + public final Builder timeSeries(@Nullable IndexSettingsTimeSeries value) { + this.timeSeries = value; + return this; + } + + /** + * API name: {@code time_series} + */ + public final Builder timeSeries( + Function> fn) { + return this.timeSeries(fn.apply(new IndexSettingsTimeSeries.Builder()).build()); + } + + /** + * API name: {@code shards} + */ + public final Builder shards(@Nullable Integer value) { + this.shards = value; + return this; + } + + /** + * API name: {@code queries} + */ + public final Builder queries(@Nullable Queries value) { + this.queries = value; + return this; + } + + /** + * API name: {@code queries} + */ + public final Builder queries(Function> fn) { + return this.queries(fn.apply(new Queries.Builder()).build()); + } + + /** + * Configure custom similarity settings to customize how search results are + * scored. + *

+ * API name: {@code similarity} + */ + public final Builder similarity(@Nullable SettingsSimilarity value) { + this.similarity = value; + return this; + } + + /** + * Configure custom similarity settings to customize how search results are + * scored. + *

+ * API name: {@code similarity} + */ + public final Builder similarity(Function> fn) { + return this.similarity(fn.apply(new SettingsSimilarity.Builder()).build()); + } + + /** + * Enable or disable dynamic mapping for an index. + *

+ * API name: {@code mapping} + */ + public final Builder mapping(@Nullable MappingLimitSettings value) { + this.mapping = value; + return this; + } + + /** + * Enable or disable dynamic mapping for an index. + *

+ * API name: {@code mapping} + */ + public final Builder mapping(Function> fn) { + return this.mapping(fn.apply(new MappingLimitSettings.Builder()).build()); + } + + /** + * API name: {@code indexing.slowlog} + */ + public final Builder indexingSlowlog(@Nullable IndexingSlowlogSettings value) { + this.indexingSlowlog = value; + return this; + } + + /** + * API name: {@code indexing.slowlog} + */ + public final Builder indexingSlowlog( + Function> fn) { + return this.indexingSlowlog(fn.apply(new IndexingSlowlogSettings.Builder()).build()); + } + + /** + * Configure indexing back pressure limits. + *

+ * API name: {@code indexing_pressure} + */ + public final Builder indexingPressure(@Nullable IndexingPressure value) { + this.indexingPressure = value; + return this; + } + + /** + * Configure indexing back pressure limits. + *

+ * API name: {@code indexing_pressure} + */ + public final Builder indexingPressure(Function> fn) { + return this.indexingPressure(fn.apply(new IndexingPressure.Builder()).build()); + } + + /** + * The store module allows you to control how index data is stored and accessed + * on disk. + *

+ * API name: {@code store} + */ + public final Builder store(@Nullable Storage value) { + this.store = value; + return this; + } + + /** + * The store module allows you to control how index data is stored and accessed + * on disk. + *

+ * API name: {@code store} + */ + public final Builder store(Function> fn) { + return this.store(fn.apply(new Storage.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexSettings}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexSettings build() { + _checkSingleUse(); + + return new IndexSettings(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettings} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + IndexSettings::setupIndexSettingsDeserializer); + + protected static void setupIndexSettingsDeserializer(ObjectDeserializer op) { + + op.add(Builder::index, IndexSettings._DESERIALIZER, "index"); + op.add(Builder::mode, JsonpDeserializer.stringDeserializer(), "mode"); + op.add(Builder::routingPath, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "routing_path"); + op.add(Builder::softDeletes, SoftDeletes._DESERIALIZER, "soft_deletes"); + op.add(Builder::sort, IndexSegmentSort._DESERIALIZER, "sort"); + op.add(Builder::numberOfShards, JsonpDeserializer.stringDeserializer(), "number_of_shards"); + op.add(Builder::numberOfReplicas, JsonpDeserializer.stringDeserializer(), "number_of_replicas"); + op.add(Builder::numberOfRoutingShards, JsonpDeserializer.integerDeserializer(), "number_of_routing_shards"); + op.add(Builder::checkOnStartup, IndexCheckOnStartup._DESERIALIZER, "check_on_startup"); + op.add(Builder::codec, JsonpDeserializer.stringDeserializer(), "codec"); + op.add(Builder::routingPartitionSize, JsonpDeserializer.integerDeserializer(), "routing_partition_size"); + op.add(Builder::loadFixedBitsetFiltersEagerly, JsonpDeserializer.booleanDeserializer(), + "load_fixed_bitset_filters_eagerly"); + op.add(Builder::hidden, JsonpDeserializer.booleanDeserializer(), "hidden"); + op.add(Builder::autoExpandReplicas, JsonpDeserializer.stringDeserializer(), "auto_expand_replicas"); + op.add(Builder::merge, Merge._DESERIALIZER, "merge"); + op.add(Builder::search, SettingsSearch._DESERIALIZER, "search"); + op.add(Builder::refreshInterval, Time._DESERIALIZER, "refresh_interval"); + op.add(Builder::maxResultWindow, JsonpDeserializer.integerDeserializer(), "max_result_window"); + op.add(Builder::maxInnerResultWindow, JsonpDeserializer.integerDeserializer(), "max_inner_result_window"); + op.add(Builder::maxRescoreWindow, JsonpDeserializer.integerDeserializer(), "max_rescore_window"); + op.add(Builder::maxDocvalueFieldsSearch, JsonpDeserializer.integerDeserializer(), "max_docvalue_fields_search"); + op.add(Builder::maxScriptFields, JsonpDeserializer.integerDeserializer(), "max_script_fields"); + op.add(Builder::maxNgramDiff, JsonpDeserializer.integerDeserializer(), "max_ngram_diff"); + op.add(Builder::maxShingleDiff, JsonpDeserializer.integerDeserializer(), "max_shingle_diff"); + op.add(Builder::blocks, IndexSettingBlocks._DESERIALIZER, "blocks"); + op.add(Builder::maxRefreshListeners, JsonpDeserializer.integerDeserializer(), "max_refresh_listeners"); + op.add(Builder::analyze, SettingsAnalyze._DESERIALIZER, "analyze"); + op.add(Builder::highlight, SettingsHighlight._DESERIALIZER, "highlight"); + op.add(Builder::maxTermsCount, JsonpDeserializer.integerDeserializer(), "max_terms_count"); + op.add(Builder::maxRegexLength, JsonpDeserializer.integerDeserializer(), "max_regex_length"); + op.add(Builder::routing, IndexRouting._DESERIALIZER, "routing"); + op.add(Builder::gcDeletes, Time._DESERIALIZER, "gc_deletes"); + op.add(Builder::defaultPipeline, JsonpDeserializer.stringDeserializer(), "default_pipeline"); + op.add(Builder::finalPipeline, JsonpDeserializer.stringDeserializer(), "final_pipeline"); + op.add(Builder::lifecycle, IndexSettingsLifecycle._DESERIALIZER, "lifecycle"); + op.add(Builder::providedName, JsonpDeserializer.stringDeserializer(), "provided_name"); + op.add(Builder::creationDate, JsonpDeserializer.longDeserializer(), "creation_date"); + op.add(Builder::creationDateString, DateTime._DESERIALIZER, "creation_date_string"); + op.add(Builder::uuid, JsonpDeserializer.stringDeserializer(), "uuid"); + op.add(Builder::version, IndexVersioning._DESERIALIZER, "version"); + op.add(Builder::verifiedBeforeClose, JsonpDeserializer.booleanDeserializer(), "verified_before_close"); + op.add(Builder::format, JsonpDeserializer.stringDeserializer(), "format"); + op.add(Builder::maxSlicesPerScroll, JsonpDeserializer.integerDeserializer(), "max_slices_per_scroll"); + op.add(Builder::translog, Translog._DESERIALIZER, "translog"); + op.add(Builder::queryString, SettingsQueryString._DESERIALIZER, "query_string"); + op.add(Builder::priority, JsonpDeserializer.stringDeserializer(), "priority"); + op.add(Builder::topMetricsMaxSize, JsonpDeserializer.integerDeserializer(), "top_metrics_max_size"); + op.add(Builder::analysis, IndexSettingsAnalysis._DESERIALIZER, "analysis"); + op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings"); + op.add(Builder::timeSeries, IndexSettingsTimeSeries._DESERIALIZER, "time_series"); + op.add(Builder::shards, JsonpDeserializer.integerDeserializer(), "shards"); + op.add(Builder::queries, Queries._DESERIALIZER, "queries"); + op.add(Builder::similarity, SettingsSimilarity._DESERIALIZER, "similarity"); + op.add(Builder::mapping, MappingLimitSettings._DESERIALIZER, "mapping"); + op.add(Builder::indexingSlowlog, IndexingSlowlogSettings._DESERIALIZER, "indexing.slowlog"); + op.add(Builder::indexingPressure, IndexingPressure._DESERIALIZER, "indexing_pressure"); + op.add(Builder::store, Storage._DESERIALIZER, "store"); + + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + builder.otherSettings(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsAnalysis.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsAnalysis.java new file mode 100644 index 000000000..f3694818a --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsAnalysis.java @@ -0,0 +1,398 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.analysis.Analyzer; +import co.elastic.clients.elasticsearch._types.analysis.CharFilter; +import co.elastic.clients.elasticsearch._types.analysis.Normalizer; +import co.elastic.clients.elasticsearch._types.analysis.TokenFilter; +import co.elastic.clients.elasticsearch._types.analysis.Tokenizer; +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.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexSettingsAnalysis + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexSettingsAnalysis implements JsonpSerializable { + private final Map analyzer; + + private final Map charFilter; + + private final Map filter; + + private final Map normalizer; + + private final Map tokenizer; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsAnalysis(Builder builder) { + + this.analyzer = ApiTypeHelper.unmodifiable(builder.analyzer); + this.charFilter = ApiTypeHelper.unmodifiable(builder.charFilter); + this.filter = ApiTypeHelper.unmodifiable(builder.filter); + this.normalizer = ApiTypeHelper.unmodifiable(builder.normalizer); + this.tokenizer = ApiTypeHelper.unmodifiable(builder.tokenizer); + + } + + public static IndexSettingsAnalysis of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code analyzer} + */ + public final Map analyzer() { + return this.analyzer; + } + + /** + * API name: {@code char_filter} + */ + public final Map charFilter() { + return this.charFilter; + } + + /** + * API name: {@code filter} + */ + public final Map filter() { + return this.filter; + } + + /** + * API name: {@code normalizer} + */ + public final Map normalizer() { + return this.normalizer; + } + + /** + * API name: {@code tokenizer} + */ + public final Map tokenizer() { + return this.tokenizer; + } + + /** + * 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.analyzer)) { + generator.writeKey("analyzer"); + generator.writeStartObject(); + for (Map.Entry item0 : this.analyzer.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.charFilter)) { + generator.writeKey("char_filter"); + generator.writeStartObject(); + for (Map.Entry item0 : this.charFilter.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.filter)) { + generator.writeKey("filter"); + generator.writeStartObject(); + for (Map.Entry item0 : this.filter.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.normalizer)) { + generator.writeKey("normalizer"); + generator.writeStartObject(); + for (Map.Entry item0 : this.normalizer.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.tokenizer)) { + generator.writeKey("tokenizer"); + generator.writeStartObject(); + for (Map.Entry item0 : this.tokenizer.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexSettingsAnalysis}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Map analyzer; + + @Nullable + private Map charFilter; + + @Nullable + private Map filter; + + @Nullable + private Map normalizer; + + @Nullable + private Map tokenizer; + + /** + * API name: {@code analyzer} + *

+ * Adds all entries of map to analyzer. + */ + public final Builder analyzer(Map map) { + this.analyzer = _mapPutAll(this.analyzer, map); + return this; + } + + /** + * API name: {@code analyzer} + *

+ * Adds an entry to analyzer. + */ + public final Builder analyzer(String key, Analyzer value) { + this.analyzer = _mapPut(this.analyzer, key, value); + return this; + } + + /** + * API name: {@code analyzer} + *

+ * Adds an entry to analyzer using a builder lambda. + */ + public final Builder analyzer(String key, Function> fn) { + return analyzer(key, fn.apply(new Analyzer.Builder()).build()); + } + + /** + * API name: {@code char_filter} + *

+ * Adds all entries of map to charFilter. + */ + public final Builder charFilter(Map map) { + this.charFilter = _mapPutAll(this.charFilter, map); + return this; + } + + /** + * API name: {@code char_filter} + *

+ * Adds an entry to charFilter. + */ + public final Builder charFilter(String key, CharFilter value) { + this.charFilter = _mapPut(this.charFilter, key, value); + return this; + } + + /** + * API name: {@code char_filter} + *

+ * Adds an entry to charFilter using a builder lambda. + */ + public final Builder charFilter(String key, Function> fn) { + return charFilter(key, fn.apply(new CharFilter.Builder()).build()); + } + + /** + * API name: {@code filter} + *

+ * Adds all entries of map to filter. + */ + public final Builder filter(Map map) { + this.filter = _mapPutAll(this.filter, map); + return this; + } + + /** + * API name: {@code filter} + *

+ * Adds an entry to filter. + */ + public final Builder filter(String key, TokenFilter value) { + this.filter = _mapPut(this.filter, key, value); + return this; + } + + /** + * API name: {@code filter} + *

+ * Adds an entry to filter using a builder lambda. + */ + public final Builder filter(String key, Function> fn) { + return filter(key, fn.apply(new TokenFilter.Builder()).build()); + } + + /** + * API name: {@code normalizer} + *

+ * Adds all entries of map to normalizer. + */ + public final Builder normalizer(Map map) { + this.normalizer = _mapPutAll(this.normalizer, map); + return this; + } + + /** + * API name: {@code normalizer} + *

+ * Adds an entry to normalizer. + */ + public final Builder normalizer(String key, Normalizer value) { + this.normalizer = _mapPut(this.normalizer, key, value); + return this; + } + + /** + * API name: {@code normalizer} + *

+ * Adds an entry to normalizer using a builder lambda. + */ + public final Builder normalizer(String key, Function> fn) { + return normalizer(key, fn.apply(new Normalizer.Builder()).build()); + } + + /** + * API name: {@code tokenizer} + *

+ * Adds all entries of map to tokenizer. + */ + public final Builder tokenizer(Map map) { + this.tokenizer = _mapPutAll(this.tokenizer, map); + return this; + } + + /** + * API name: {@code tokenizer} + *

+ * Adds an entry to tokenizer. + */ + public final Builder tokenizer(String key, Tokenizer value) { + this.tokenizer = _mapPut(this.tokenizer, key, value); + return this; + } + + /** + * API name: {@code tokenizer} + *

+ * Adds an entry to tokenizer using a builder lambda. + */ + public final Builder tokenizer(String key, Function> fn) { + return tokenizer(key, fn.apply(new Tokenizer.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexSettingsAnalysis}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexSettingsAnalysis build() { + _checkSingleUse(); + + return new IndexSettingsAnalysis(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsAnalysis} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexSettingsAnalysis::setupIndexSettingsAnalysisDeserializer); + + protected static void setupIndexSettingsAnalysisDeserializer(ObjectDeserializer op) { + + op.add(Builder::analyzer, JsonpDeserializer.stringMapDeserializer(Analyzer._DESERIALIZER), "analyzer"); + op.add(Builder::charFilter, JsonpDeserializer.stringMapDeserializer(CharFilter._DESERIALIZER), "char_filter"); + op.add(Builder::filter, JsonpDeserializer.stringMapDeserializer(TokenFilter._DESERIALIZER), "filter"); + op.add(Builder::normalizer, JsonpDeserializer.stringMapDeserializer(Normalizer._DESERIALIZER), "normalizer"); + op.add(Builder::tokenizer, JsonpDeserializer.stringMapDeserializer(Tokenizer._DESERIALIZER), "tokenizer"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsLifecycle.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsLifecycle.java new file mode 100644 index 000000000..2f91e89ba --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsLifecycle.java @@ -0,0 +1,352 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.Boolean; +import java.lang.Long; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexSettingsLifecycle + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexSettingsLifecycle implements JsonpSerializable { + private final String name; + + @Nullable + private final Boolean indexingComplete; + + @Nullable + private final Long originationDate; + + @Nullable + private final Boolean parseOriginationDate; + + @Nullable + private final IndexSettingsLifecycleStep step; + + @Nullable + private final String rolloverAlias; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsLifecycle(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.indexingComplete = builder.indexingComplete; + this.originationDate = builder.originationDate; + this.parseOriginationDate = builder.parseOriginationDate; + this.step = builder.step; + this.rolloverAlias = builder.rolloverAlias; + + } + + public static IndexSettingsLifecycle of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - The name of the policy to use to manage the index. For information + * about how Elasticsearch applies policy changes, see Policy updates. + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * Indicates whether or not the index has been rolled over. Automatically set to + * true when ILM completes the rollover action. You can explicitly set it to + * skip rollover. + *

+ * API name: {@code indexing_complete} + */ + @Nullable + public final Boolean indexingComplete() { + return this.indexingComplete; + } + + /** + * If specified, this is the timestamp used to calculate the index age for its + * phase transitions. Use this setting if you create a new index that contains + * old data and want to use the original creation date to calculate the index + * age. Specified as a Unix epoch value in milliseconds. + *

+ * API name: {@code origination_date} + */ + @Nullable + public final Long originationDate() { + return this.originationDate; + } + + /** + * Set to true to parse the origination date from the index name. This + * origination date is used to calculate the index age for its phase + * transitions. The index name must match the pattern ^.*-{date_format}-\d+, + * where the date_format is yyyy.MM.dd and the trailing digits are optional. An + * index that was rolled over would normally match the full format, for example + * logs-2016.10.31-000002). If the index name doesn’t match the pattern, index + * creation fails. + *

+ * API name: {@code parse_origination_date} + */ + @Nullable + public final Boolean parseOriginationDate() { + return this.parseOriginationDate; + } + + /** + * API name: {@code step} + */ + @Nullable + public final IndexSettingsLifecycleStep step() { + return this.step; + } + + /** + * The index alias to update when the index rolls over. Specify when using a + * policy that contains a rollover action. When the index rolls over, the alias + * is updated to reflect that the index is no longer the write index. For more + * information about rolling indices, see Rollover. + *

+ * API name: {@code rollover_alias} + */ + @Nullable + public final String rolloverAlias() { + return this.rolloverAlias; + } + + /** + * 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); + + if (this.indexingComplete != null) { + generator.writeKey("indexing_complete"); + generator.write(this.indexingComplete); + + } + if (this.originationDate != null) { + generator.writeKey("origination_date"); + generator.write(this.originationDate); + + } + if (this.parseOriginationDate != null) { + generator.writeKey("parse_origination_date"); + generator.write(this.parseOriginationDate); + + } + if (this.step != null) { + generator.writeKey("step"); + this.step.serialize(generator, mapper); + + } + if (this.rolloverAlias != null) { + generator.writeKey("rollover_alias"); + generator.write(this.rolloverAlias); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexSettingsLifecycle}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private String name; + + @Nullable + private Boolean indexingComplete; + + @Nullable + private Long originationDate; + + @Nullable + private Boolean parseOriginationDate; + + @Nullable + private IndexSettingsLifecycleStep step; + + @Nullable + private String rolloverAlias; + + /** + * Required - The name of the policy to use to manage the index. For information + * about how Elasticsearch applies policy changes, see Policy updates. + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Indicates whether or not the index has been rolled over. Automatically set to + * true when ILM completes the rollover action. You can explicitly set it to + * skip rollover. + *

+ * API name: {@code indexing_complete} + */ + public final Builder indexingComplete(@Nullable Boolean value) { + this.indexingComplete = value; + return this; + } + + /** + * If specified, this is the timestamp used to calculate the index age for its + * phase transitions. Use this setting if you create a new index that contains + * old data and want to use the original creation date to calculate the index + * age. Specified as a Unix epoch value in milliseconds. + *

+ * API name: {@code origination_date} + */ + public final Builder originationDate(@Nullable Long value) { + this.originationDate = value; + return this; + } + + /** + * Set to true to parse the origination date from the index name. This + * origination date is used to calculate the index age for its phase + * transitions. The index name must match the pattern ^.*-{date_format}-\d+, + * where the date_format is yyyy.MM.dd and the trailing digits are optional. An + * index that was rolled over would normally match the full format, for example + * logs-2016.10.31-000002). If the index name doesn’t match the pattern, index + * creation fails. + *

+ * API name: {@code parse_origination_date} + */ + public final Builder parseOriginationDate(@Nullable Boolean value) { + this.parseOriginationDate = value; + return this; + } + + /** + * API name: {@code step} + */ + public final Builder step(@Nullable IndexSettingsLifecycleStep value) { + this.step = value; + return this; + } + + /** + * API name: {@code step} + */ + public final Builder step( + Function> fn) { + return this.step(fn.apply(new IndexSettingsLifecycleStep.Builder()).build()); + } + + /** + * The index alias to update when the index rolls over. Specify when using a + * policy that contains a rollover action. When the index rolls over, the alias + * is updated to reflect that the index is no longer the write index. For more + * information about rolling indices, see Rollover. + *

+ * API name: {@code rollover_alias} + */ + public final Builder rolloverAlias(@Nullable String value) { + this.rolloverAlias = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexSettingsLifecycle}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexSettingsLifecycle build() { + _checkSingleUse(); + + return new IndexSettingsLifecycle(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsLifecycle} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexSettingsLifecycle::setupIndexSettingsLifecycleDeserializer); + + protected static void setupIndexSettingsLifecycleDeserializer( + ObjectDeserializer op) { + + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::indexingComplete, JsonpDeserializer.booleanDeserializer(), "indexing_complete"); + op.add(Builder::originationDate, JsonpDeserializer.longDeserializer(), "origination_date"); + op.add(Builder::parseOriginationDate, JsonpDeserializer.booleanDeserializer(), "parse_origination_date"); + op.add(Builder::step, IndexSettingsLifecycleStep._DESERIALIZER, "step"); + op.add(Builder::rolloverAlias, JsonpDeserializer.stringDeserializer(), "rollover_alias"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsLifecycleStep.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsLifecycleStep.java new file mode 100644 index 000000000..5acbfef6a --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsLifecycleStep.java @@ -0,0 +1,170 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.Time; +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexSettingsLifecycleStep + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexSettingsLifecycleStep implements JsonpSerializable { + @Nullable + private final Time waitTimeThreshold; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsLifecycleStep(Builder builder) { + + this.waitTimeThreshold = builder.waitTimeThreshold; + + } + + public static IndexSettingsLifecycleStep of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Time to wait for the cluster to resolve allocation issues during an ILM + * shrink action. Must be greater than 1h (1 hour). See Shard allocation for + * shrink. + *

+ * API name: {@code wait_time_threshold} + */ + @Nullable + public final Time waitTimeThreshold() { + return this.waitTimeThreshold; + } + + /** + * 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 (this.waitTimeThreshold != null) { + generator.writeKey("wait_time_threshold"); + this.waitTimeThreshold.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexSettingsLifecycleStep}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Time waitTimeThreshold; + + /** + * Time to wait for the cluster to resolve allocation issues during an ILM + * shrink action. Must be greater than 1h (1 hour). See Shard allocation for + * shrink. + *

+ * API name: {@code wait_time_threshold} + */ + public final Builder waitTimeThreshold(@Nullable Time value) { + this.waitTimeThreshold = value; + return this; + } + + /** + * Time to wait for the cluster to resolve allocation issues during an ILM + * shrink action. Must be greater than 1h (1 hour). See Shard allocation for + * shrink. + *

+ * API name: {@code wait_time_threshold} + */ + public final Builder waitTimeThreshold(Function> fn) { + return this.waitTimeThreshold(fn.apply(new Time.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexSettingsLifecycleStep}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexSettingsLifecycleStep build() { + _checkSingleUse(); + + return new IndexSettingsLifecycleStep(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsLifecycleStep} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexSettingsLifecycleStep::setupIndexSettingsLifecycleStepDeserializer); + + protected static void setupIndexSettingsLifecycleStepDeserializer( + ObjectDeserializer op) { + + op.add(Builder::waitTimeThreshold, Time._DESERIALIZER, "wait_time_threshold"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsTimeSeries.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsTimeSeries.java new file mode 100644 index 000000000..31c579986 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexSettingsTimeSeries.java @@ -0,0 +1,178 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.DateTime; +import co.elastic.clients.util.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexSettingsTimeSeries + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexSettingsTimeSeries implements JsonpSerializable { + @Nullable + private final DateTime endTime; + + @Nullable + private final DateTime startTime; + + // --------------------------------------------------------------------------------------------- + + private IndexSettingsTimeSeries(Builder builder) { + + this.endTime = builder.endTime; + this.startTime = builder.startTime; + + } + + public static IndexSettingsTimeSeries of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code end_time} + */ + @Nullable + public final DateTime endTime() { + return this.endTime; + } + + /** + * API name: {@code start_time} + */ + @Nullable + public final DateTime startTime() { + return this.startTime; + } + + /** + * 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 (this.endTime != null) { + generator.writeKey("end_time"); + this.endTime.serialize(generator, mapper); + } + if (this.startTime != null) { + generator.writeKey("start_time"); + this.startTime.serialize(generator, mapper); + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexSettingsTimeSeries}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private DateTime endTime; + + @Nullable + private DateTime startTime; + + /** + * API name: {@code end_time} + */ + public final Builder endTime(@Nullable DateTime value) { + this.endTime = value; + return this; + } + + /** + * API name: {@code start_time} + */ + public final Builder startTime(@Nullable DateTime value) { + this.startTime = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexSettingsTimeSeries}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexSettingsTimeSeries build() { + _checkSingleUse(); + + return new IndexSettingsTimeSeries(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexSettingsTimeSeries} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexSettingsTimeSeries::setupIndexSettingsTimeSeriesDeserializer); + + protected static void setupIndexSettingsTimeSeriesDeserializer( + ObjectDeserializer op) { + + op.add(Builder::endTime, DateTime._DESERIALIZER, "end_time"); + op.add(Builder::startTime, DateTime._DESERIALIZER, "start_time"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexState.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexState.java new file mode 100644 index 000000000..0f16ed357 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexState.java @@ -0,0 +1,363 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; +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.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexState + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexState implements JsonpSerializable { + private final Map aliases; + + @Nullable + private final TypeMapping mappings; + + @Nullable + private final IndexSettings settings; + + @Nullable + private final IndexSettings defaults; + + @Nullable + private final String dataStream; + + @Nullable + private final DataStreamLifecycle lifecycle; + + // --------------------------------------------------------------------------------------------- + + private IndexState(Builder builder) { + + this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); + this.mappings = builder.mappings; + this.settings = builder.settings; + this.defaults = builder.defaults; + this.dataStream = builder.dataStream; + this.lifecycle = builder.lifecycle; + + } + + public static IndexState of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code aliases} + */ + public final Map aliases() { + return this.aliases; + } + + /** + * API name: {@code mappings} + */ + @Nullable + public final TypeMapping mappings() { + return this.mappings; + } + + /** + * API name: {@code settings} + */ + @Nullable + public final IndexSettings settings() { + return this.settings; + } + + /** + * Default settings, included when the request's include_default is + * true. + *

+ * API name: {@code defaults} + */ + @Nullable + public final IndexSettings defaults() { + return this.defaults; + } + + /** + * API name: {@code data_stream} + */ + @Nullable + public final String dataStream() { + return this.dataStream; + } + + /** + * Data lifecycle applicable if this is a data stream. + *

+ * API name: {@code lifecycle} + */ + @Nullable + public final DataStreamLifecycle lifecycle() { + return this.lifecycle; + } + + /** + * 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.aliases)) { + generator.writeKey("aliases"); + generator.writeStartObject(); + for (Map.Entry item0 : this.aliases.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.mappings != null) { + generator.writeKey("mappings"); + this.mappings.serialize(generator, mapper); + + } + if (this.settings != null) { + generator.writeKey("settings"); + this.settings.serialize(generator, mapper); + + } + if (this.defaults != null) { + generator.writeKey("defaults"); + this.defaults.serialize(generator, mapper); + + } + if (this.dataStream != null) { + generator.writeKey("data_stream"); + generator.write(this.dataStream); + + } + if (this.lifecycle != null) { + generator.writeKey("lifecycle"); + this.lifecycle.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexState}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Map aliases; + + @Nullable + private TypeMapping mappings; + + @Nullable + private IndexSettings settings; + + @Nullable + private IndexSettings defaults; + + @Nullable + private String dataStream; + + @Nullable + private DataStreamLifecycle lifecycle; + + /** + * API name: {@code aliases} + *

+ * Adds all entries of map to aliases. + */ + public final Builder aliases(Map map) { + this.aliases = _mapPutAll(this.aliases, map); + return this; + } + + /** + * API name: {@code aliases} + *

+ * Adds an entry to aliases. + */ + public final Builder aliases(String key, Alias value) { + this.aliases = _mapPut(this.aliases, key, value); + return this; + } + + /** + * API name: {@code aliases} + *

+ * Adds an entry to aliases using a builder lambda. + */ + public final Builder aliases(String key, Function> fn) { + return aliases(key, fn.apply(new Alias.Builder()).build()); + } + + /** + * API name: {@code mappings} + */ + public final Builder mappings(@Nullable TypeMapping value) { + this.mappings = value; + return this; + } + + /** + * API name: {@code mappings} + */ + public final Builder mappings(Function> fn) { + return this.mappings(fn.apply(new TypeMapping.Builder()).build()); + } + + /** + * API name: {@code settings} + */ + public final Builder settings(@Nullable IndexSettings value) { + this.settings = value; + return this; + } + + /** + * API name: {@code settings} + */ + public final Builder settings(Function> fn) { + return this.settings(fn.apply(new IndexSettings.Builder()).build()); + } + + /** + * Default settings, included when the request's include_default is + * true. + *

+ * API name: {@code defaults} + */ + public final Builder defaults(@Nullable IndexSettings value) { + this.defaults = value; + return this; + } + + /** + * Default settings, included when the request's include_default is + * true. + *

+ * API name: {@code defaults} + */ + public final Builder defaults(Function> fn) { + return this.defaults(fn.apply(new IndexSettings.Builder()).build()); + } + + /** + * API name: {@code data_stream} + */ + public final Builder dataStream(@Nullable String value) { + this.dataStream = value; + return this; + } + + /** + * Data lifecycle applicable if this is a data stream. + *

+ * API name: {@code lifecycle} + */ + public final Builder lifecycle(@Nullable DataStreamLifecycle value) { + this.lifecycle = value; + return this; + } + + /** + * Data lifecycle applicable if this is a data stream. + *

+ * API name: {@code lifecycle} + */ + public final Builder lifecycle(Function> fn) { + return this.lifecycle(fn.apply(new DataStreamLifecycle.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexState}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexState build() { + _checkSingleUse(); + + return new IndexState(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexState} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + IndexState::setupIndexStateDeserializer); + + protected static void setupIndexStateDeserializer(ObjectDeserializer op) { + + op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(Alias._DESERIALIZER), "aliases"); + op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); + op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings"); + op.add(Builder::defaults, IndexSettings._DESERIALIZER, "defaults"); + op.add(Builder::dataStream, JsonpDeserializer.stringDeserializer(), "data_stream"); + op.add(Builder::lifecycle, DataStreamLifecycle._DESERIALIZER, "lifecycle"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplate.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplate.java new file mode 100644 index 000000000..e69ef5bca --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplate.java @@ -0,0 +1,483 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.json.JsonData; +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.Boolean; +import java.lang.Long; +import java.lang.String; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexTemplate + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexTemplate implements JsonpSerializable { + private final List indexPatterns; + + private final List composedOf; + + @Nullable + private final IndexTemplateSummary template; + + @Nullable + private final Long version; + + @Nullable + private final Long priority; + + private final Map meta; + + @Nullable + private final Boolean allowAutoCreate; + + @Nullable + private final IndexTemplateDataStreamConfiguration dataStream; + + // --------------------------------------------------------------------------------------------- + + private IndexTemplate(Builder builder) { + + this.indexPatterns = ApiTypeHelper.unmodifiableRequired(builder.indexPatterns, this, "indexPatterns"); + this.composedOf = ApiTypeHelper.unmodifiableRequired(builder.composedOf, this, "composedOf"); + this.template = builder.template; + this.version = builder.version; + this.priority = builder.priority; + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.allowAutoCreate = builder.allowAutoCreate; + this.dataStream = builder.dataStream; + + } + + public static IndexTemplate of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Name of the index template. + *

+ * API name: {@code index_patterns} + */ + public final List indexPatterns() { + return this.indexPatterns; + } + + /** + * Required - An ordered list of component template names. Component templates + * are merged in the order specified, meaning that the last component template + * specified has the highest precedence. + *

+ * API name: {@code composed_of} + */ + public final List composedOf() { + return this.composedOf; + } + + /** + * Template to be applied. It may optionally include an aliases, + * mappings, or settings configuration. + *

+ * API name: {@code template} + */ + @Nullable + public final IndexTemplateSummary template() { + return this.template; + } + + /** + * Version number used to manage index templates externally. This number is not + * automatically generated by Elasticsearch. + *

+ * API name: {@code version} + */ + @Nullable + public final Long version() { + return this.version; + } + + /** + * Priority to determine index template precedence when a new data stream or + * index is created. The index template with the highest priority is chosen. If + * no priority is specified the template is treated as though it is of priority + * 0 (lowest priority). This number is not automatically generated by + * Elasticsearch. + *

+ * API name: {@code priority} + */ + @Nullable + public final Long priority() { + return this.priority; + } + + /** + * Optional user metadata about the index template. May have any contents. This + * map is not automatically generated by Elasticsearch. + *

+ * API name: {@code _meta} + */ + public final Map meta() { + return this.meta; + } + + /** + * API name: {@code allow_auto_create} + */ + @Nullable + public final Boolean allowAutoCreate() { + return this.allowAutoCreate; + } + + /** + * If this object is included, the template is used to create data streams and + * their backing indices. Supports an empty object. Data streams require a + * matching index template with a data_stream object. + *

+ * API name: {@code data_stream} + */ + @Nullable + public final IndexTemplateDataStreamConfiguration dataStream() { + return this.dataStream; + } + + /** + * 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.indexPatterns)) { + generator.writeKey("index_patterns"); + generator.writeStartArray(); + for (String item0 : this.indexPatterns) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.composedOf)) { + generator.writeKey("composed_of"); + generator.writeStartArray(); + for (String item0 : this.composedOf) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.template != null) { + generator.writeKey("template"); + this.template.serialize(generator, mapper); + + } + if (this.version != null) { + generator.writeKey("version"); + generator.write(this.version); + + } + if (this.priority != null) { + generator.writeKey("priority"); + generator.write(this.priority); + + } + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("_meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.allowAutoCreate != null) { + generator.writeKey("allow_auto_create"); + generator.write(this.allowAutoCreate); + + } + if (this.dataStream != null) { + generator.writeKey("data_stream"); + this.dataStream.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexTemplate}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private List indexPatterns; + + private List composedOf; + + @Nullable + private IndexTemplateSummary template; + + @Nullable + private Long version; + + @Nullable + private Long priority; + + @Nullable + private Map meta; + + @Nullable + private Boolean allowAutoCreate; + + @Nullable + private IndexTemplateDataStreamConfiguration dataStream; + + /** + * Required - Name of the index template. + *

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

+ * Adds all elements of list to indexPatterns. + */ + public final Builder indexPatterns(List list) { + this.indexPatterns = _listAddAll(this.indexPatterns, list); + return this; + } + + /** + * Required - Name of the index template. + *

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

+ * Adds one or more values to indexPatterns. + */ + public final Builder indexPatterns(String value, String... values) { + this.indexPatterns = _listAdd(this.indexPatterns, value, values); + return this; + } + + /** + * Required - An ordered list of component template names. Component templates + * are merged in the order specified, meaning that the last component template + * specified has the highest precedence. + *

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

+ * Adds all elements of list to composedOf. + */ + public final Builder composedOf(List list) { + this.composedOf = _listAddAll(this.composedOf, list); + return this; + } + + /** + * Required - An ordered list of component template names. Component templates + * are merged in the order specified, meaning that the last component template + * specified has the highest precedence. + *

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

+ * Adds one or more values to composedOf. + */ + public final Builder composedOf(String value, String... values) { + this.composedOf = _listAdd(this.composedOf, value, values); + return this; + } + + /** + * Template to be applied. It may optionally include an aliases, + * mappings, or settings configuration. + *

+ * API name: {@code template} + */ + public final Builder template(@Nullable IndexTemplateSummary value) { + this.template = value; + return this; + } + + /** + * Template to be applied. It may optionally include an aliases, + * mappings, or settings configuration. + *

+ * API name: {@code template} + */ + public final Builder template(Function> fn) { + return this.template(fn.apply(new IndexTemplateSummary.Builder()).build()); + } + + /** + * Version number used to manage index templates externally. This number is not + * automatically generated by Elasticsearch. + *

+ * API name: {@code version} + */ + public final Builder version(@Nullable Long value) { + this.version = value; + return this; + } + + /** + * Priority to determine index template precedence when a new data stream or + * index is created. The index template with the highest priority is chosen. If + * no priority is specified the template is treated as though it is of priority + * 0 (lowest priority). This number is not automatically generated by + * Elasticsearch. + *

+ * API name: {@code priority} + */ + public final Builder priority(@Nullable Long value) { + this.priority = value; + return this; + } + + /** + * Optional user metadata about the index template. May have any contents. This + * map is not automatically generated by Elasticsearch. + *

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

+ * Adds all entries of map to meta. + */ + public final Builder meta(Map map) { + this.meta = _mapPutAll(this.meta, map); + return this; + } + + /** + * Optional user metadata about the index template. May have any contents. This + * map is not automatically generated by Elasticsearch. + *

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

+ * Adds an entry to meta. + */ + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); + return this; + } + + /** + * API name: {@code allow_auto_create} + */ + public final Builder allowAutoCreate(@Nullable Boolean value) { + this.allowAutoCreate = value; + return this; + } + + /** + * If this object is included, the template is used to create data streams and + * their backing indices. Supports an empty object. Data streams require a + * matching index template with a data_stream object. + *

+ * API name: {@code data_stream} + */ + public final Builder dataStream(@Nullable IndexTemplateDataStreamConfiguration value) { + this.dataStream = value; + return this; + } + + /** + * If this object is included, the template is used to create data streams and + * their backing indices. Supports an empty object. Data streams require a + * matching index template with a data_stream object. + *

+ * API name: {@code data_stream} + */ + public final Builder dataStream( + Function> fn) { + return this.dataStream(fn.apply(new IndexTemplateDataStreamConfiguration.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexTemplate}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexTemplate build() { + _checkSingleUse(); + + return new IndexTemplate(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexTemplate} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + IndexTemplate::setupIndexTemplateDeserializer); + + protected static void setupIndexTemplateDeserializer(ObjectDeserializer op) { + + op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "index_patterns"); + op.add(Builder::composedOf, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "composed_of"); + op.add(Builder::template, IndexTemplateSummary._DESERIALIZER, "template"); + op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); + op.add(Builder::priority, JsonpDeserializer.longDeserializer(), "priority"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); + op.add(Builder::allowAutoCreate, JsonpDeserializer.booleanDeserializer(), "allow_auto_create"); + op.add(Builder::dataStream, IndexTemplateDataStreamConfiguration._DESERIALIZER, "data_stream"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplateDataStreamConfiguration.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplateDataStreamConfiguration.java new file mode 100644 index 000000000..b479c6c57 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplateDataStreamConfiguration.java @@ -0,0 +1,190 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexTemplateDataStreamConfiguration + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexTemplateDataStreamConfiguration implements JsonpSerializable { + @Nullable + private final Boolean hidden; + + @Nullable + private final Boolean allowCustomRouting; + + // --------------------------------------------------------------------------------------------- + + private IndexTemplateDataStreamConfiguration(Builder builder) { + + this.hidden = builder.hidden; + this.allowCustomRouting = builder.allowCustomRouting; + + } + + public static IndexTemplateDataStreamConfiguration of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If true, the data stream is hidden. + *

+ * API name: {@code hidden} + */ + @Nullable + public final Boolean hidden() { + return this.hidden; + } + + /** + * If true, the data stream supports custom routing. + *

+ * API name: {@code allow_custom_routing} + */ + @Nullable + public final Boolean allowCustomRouting() { + return this.allowCustomRouting; + } + + /** + * 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 (this.hidden != null) { + generator.writeKey("hidden"); + generator.write(this.hidden); + + } + if (this.allowCustomRouting != null) { + generator.writeKey("allow_custom_routing"); + generator.write(this.allowCustomRouting); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexTemplateDataStreamConfiguration}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Boolean hidden; + + @Nullable + private Boolean allowCustomRouting; + + /** + * If true, the data stream is hidden. + *

+ * API name: {@code hidden} + */ + public final Builder hidden(@Nullable Boolean value) { + this.hidden = value; + return this; + } + + /** + * If true, the data stream supports custom routing. + *

+ * API name: {@code allow_custom_routing} + */ + public final Builder allowCustomRouting(@Nullable Boolean value) { + this.allowCustomRouting = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexTemplateDataStreamConfiguration}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexTemplateDataStreamConfiguration build() { + _checkSingleUse(); + + return new IndexTemplateDataStreamConfiguration(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexTemplateDataStreamConfiguration} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, + IndexTemplateDataStreamConfiguration::setupIndexTemplateDataStreamConfigurationDeserializer); + + protected static void setupIndexTemplateDataStreamConfigurationDeserializer( + ObjectDeserializer op) { + + op.add(Builder::hidden, JsonpDeserializer.booleanDeserializer(), "hidden"); + op.add(Builder::allowCustomRouting, JsonpDeserializer.booleanDeserializer(), "allow_custom_routing"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplateSummary.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplateSummary.java new file mode 100644 index 000000000..390c781dc --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexTemplateSummary.java @@ -0,0 +1,322 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; +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.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexTemplateSummary + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexTemplateSummary implements JsonpSerializable { + private final Map aliases; + + @Nullable + private final TypeMapping mappings; + + @Nullable + private final IndexSettings settings; + + @Nullable + private final DataStreamLifecycleWithRollover lifecycle; + + // --------------------------------------------------------------------------------------------- + + private IndexTemplateSummary(Builder builder) { + + this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); + this.mappings = builder.mappings; + this.settings = builder.settings; + this.lifecycle = builder.lifecycle; + + } + + public static IndexTemplateSummary of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Aliases to add. If the index template includes a data_stream + * object, these are data stream aliases. Otherwise, these are index aliases. + * Data stream aliases ignore the index_routing, + * routing, and search_routing options. + *

+ * API name: {@code aliases} + */ + public final Map aliases() { + return this.aliases; + } + + /** + * Mapping for fields in the index. If specified, this mapping can include field + * names, field data types, and mapping parameters. + *

+ * API name: {@code mappings} + */ + @Nullable + public final TypeMapping mappings() { + return this.mappings; + } + + /** + * Configuration options for the index. + *

+ * API name: {@code settings} + */ + @Nullable + public final IndexSettings settings() { + return this.settings; + } + + /** + * API name: {@code lifecycle} + */ + @Nullable + public final DataStreamLifecycleWithRollover lifecycle() { + return this.lifecycle; + } + + /** + * 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.aliases)) { + generator.writeKey("aliases"); + generator.writeStartObject(); + for (Map.Entry item0 : this.aliases.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.mappings != null) { + generator.writeKey("mappings"); + this.mappings.serialize(generator, mapper); + + } + if (this.settings != null) { + generator.writeKey("settings"); + this.settings.serialize(generator, mapper); + + } + if (this.lifecycle != null) { + generator.writeKey("lifecycle"); + this.lifecycle.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexTemplateSummary}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Map aliases; + + @Nullable + private TypeMapping mappings; + + @Nullable + private IndexSettings settings; + + @Nullable + private DataStreamLifecycleWithRollover lifecycle; + + /** + * Aliases to add. If the index template includes a data_stream + * object, these are data stream aliases. Otherwise, these are index aliases. + * Data stream aliases ignore the index_routing, + * routing, and search_routing options. + *

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

+ * Adds all entries of map to aliases. + */ + public final Builder aliases(Map map) { + this.aliases = _mapPutAll(this.aliases, map); + return this; + } + + /** + * Aliases to add. If the index template includes a data_stream + * object, these are data stream aliases. Otherwise, these are index aliases. + * Data stream aliases ignore the index_routing, + * routing, and search_routing options. + *

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

+ * Adds an entry to aliases. + */ + public final Builder aliases(String key, Alias value) { + this.aliases = _mapPut(this.aliases, key, value); + return this; + } + + /** + * Aliases to add. If the index template includes a data_stream + * object, these are data stream aliases. Otherwise, these are index aliases. + * Data stream aliases ignore the index_routing, + * routing, and search_routing options. + *

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

+ * Adds an entry to aliases using a builder lambda. + */ + public final Builder aliases(String key, Function> fn) { + return aliases(key, fn.apply(new Alias.Builder()).build()); + } + + /** + * Mapping for fields in the index. If specified, this mapping can include field + * names, field data types, and mapping parameters. + *

+ * API name: {@code mappings} + */ + public final Builder mappings(@Nullable TypeMapping value) { + this.mappings = value; + return this; + } + + /** + * Mapping for fields in the index. If specified, this mapping can include field + * names, field data types, and mapping parameters. + *

+ * API name: {@code mappings} + */ + public final Builder mappings(Function> fn) { + return this.mappings(fn.apply(new TypeMapping.Builder()).build()); + } + + /** + * Configuration options for the index. + *

+ * API name: {@code settings} + */ + public final Builder settings(@Nullable IndexSettings value) { + this.settings = value; + return this; + } + + /** + * Configuration options for the index. + *

+ * API name: {@code settings} + */ + public final Builder settings(Function> fn) { + return this.settings(fn.apply(new IndexSettings.Builder()).build()); + } + + /** + * API name: {@code lifecycle} + */ + public final Builder lifecycle(@Nullable DataStreamLifecycleWithRollover value) { + this.lifecycle = value; + return this; + } + + /** + * API name: {@code lifecycle} + */ + public final Builder lifecycle( + Function> fn) { + return this.lifecycle(fn.apply(new DataStreamLifecycleWithRollover.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexTemplateSummary}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexTemplateSummary build() { + _checkSingleUse(); + + return new IndexTemplateSummary(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexTemplateSummary} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexTemplateSummary::setupIndexTemplateSummaryDeserializer); + + protected static void setupIndexTemplateSummaryDeserializer(ObjectDeserializer op) { + + op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(Alias._DESERIALIZER), "aliases"); + op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); + op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings"); + op.add(Builder::lifecycle, DataStreamLifecycleWithRollover._DESERIALIZER, "lifecycle"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexVersioning.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexVersioning.java new file mode 100644 index 000000000..6fcf145d8 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexVersioning.java @@ -0,0 +1,176 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.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; + +// typedef: indices._types.IndexVersioning + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexVersioning implements JsonpSerializable { + @Nullable + private final String created; + + @Nullable + private final String createdString; + + // --------------------------------------------------------------------------------------------- + + private IndexVersioning(Builder builder) { + + this.created = builder.created; + this.createdString = builder.createdString; + + } + + public static IndexVersioning of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code created} + */ + @Nullable + public final String created() { + return this.created; + } + + /** + * API name: {@code created_string} + */ + @Nullable + public final String createdString() { + return this.createdString; + } + + /** + * 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 (this.created != null) { + generator.writeKey("created"); + generator.write(this.created); + + } + if (this.createdString != null) { + generator.writeKey("created_string"); + generator.write(this.createdString); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexVersioning}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private String created; + + @Nullable + private String createdString; + + /** + * API name: {@code created} + */ + public final Builder created(@Nullable String value) { + this.created = value; + return this; + } + + /** + * API name: {@code created_string} + */ + public final Builder createdString(@Nullable String value) { + this.createdString = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexVersioning}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexVersioning build() { + _checkSingleUse(); + + return new IndexVersioning(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexVersioning} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + IndexVersioning::setupIndexVersioningDeserializer); + + protected static void setupIndexVersioningDeserializer(ObjectDeserializer op) { + + op.add(Builder::created, JsonpDeserializer.stringDeserializer(), "created"); + op.add(Builder::createdString, JsonpDeserializer.stringDeserializer(), "created_string"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingPressure.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingPressure.java new file mode 100644 index 000000000..bf46b0aa4 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingPressure.java @@ -0,0 +1,149 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexingPressure + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexingPressure implements JsonpSerializable { + private final IndexingPressureMemory memory; + + // --------------------------------------------------------------------------------------------- + + private IndexingPressure(Builder builder) { + + this.memory = ApiTypeHelper.requireNonNull(builder.memory, this, "memory"); + + } + + public static IndexingPressure of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code memory} + */ + public final IndexingPressureMemory memory() { + return this.memory; + } + + /** + * 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("memory"); + this.memory.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexingPressure}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private IndexingPressureMemory memory; + + /** + * Required - API name: {@code memory} + */ + public final Builder memory(IndexingPressureMemory value) { + this.memory = value; + return this; + } + + /** + * Required - API name: {@code memory} + */ + public final Builder memory( + Function> fn) { + return this.memory(fn.apply(new IndexingPressureMemory.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexingPressure}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexingPressure build() { + _checkSingleUse(); + + return new IndexingPressure(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexingPressure} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + IndexingPressure::setupIndexingPressureDeserializer); + + protected static void setupIndexingPressureDeserializer(ObjectDeserializer op) { + + op.add(Builder::memory, IndexingPressureMemory._DESERIALIZER, "memory"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingPressureMemory.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingPressureMemory.java new file mode 100644 index 000000000..322222f44 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingPressureMemory.java @@ -0,0 +1,161 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Integer; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexingPressureMemory + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexingPressureMemory implements JsonpSerializable { + @Nullable + private final Integer limit; + + // --------------------------------------------------------------------------------------------- + + private IndexingPressureMemory(Builder builder) { + + this.limit = builder.limit; + + } + + public static IndexingPressureMemory of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Number of outstanding bytes that may be consumed by indexing requests. When + * this limit is reached or exceeded, the node will reject new coordinating and + * primary operations. When replica operations consume 1.5x this limit, the node + * will reject new replica operations. Defaults to 10% of the heap. + *

+ * API name: {@code limit} + */ + @Nullable + public final Integer limit() { + return this.limit; + } + + /** + * 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 (this.limit != null) { + generator.writeKey("limit"); + generator.write(this.limit); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexingPressureMemory}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Integer limit; + + /** + * Number of outstanding bytes that may be consumed by indexing requests. When + * this limit is reached or exceeded, the node will reject new coordinating and + * primary operations. When replica operations consume 1.5x this limit, the node + * will reject new replica operations. Defaults to 10% of the heap. + *

+ * API name: {@code limit} + */ + public final Builder limit(@Nullable Integer value) { + this.limit = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexingPressureMemory}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexingPressureMemory build() { + _checkSingleUse(); + + return new IndexingPressureMemory(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexingPressureMemory} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexingPressureMemory::setupIndexingPressureMemoryDeserializer); + + protected static void setupIndexingPressureMemoryDeserializer( + ObjectDeserializer op) { + + op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingSlowlogSettings.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingSlowlogSettings.java new file mode 100644 index 000000000..7d13c6c4f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingSlowlogSettings.java @@ -0,0 +1,248 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.Integer; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexingSlowlogSettings + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexingSlowlogSettings implements JsonpSerializable { + @Nullable + private final String level; + + @Nullable + private final Integer source; + + @Nullable + private final Boolean reformat; + + @Nullable + private final IndexingSlowlogTresholds threshold; + + // --------------------------------------------------------------------------------------------- + + private IndexingSlowlogSettings(Builder builder) { + + this.level = builder.level; + this.source = builder.source; + this.reformat = builder.reformat; + this.threshold = builder.threshold; + + } + + public static IndexingSlowlogSettings of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code level} + */ + @Nullable + public final String level() { + return this.level; + } + + /** + * API name: {@code source} + */ + @Nullable + public final Integer source() { + return this.source; + } + + /** + * API name: {@code reformat} + */ + @Nullable + public final Boolean reformat() { + return this.reformat; + } + + /** + * API name: {@code threshold} + */ + @Nullable + public final IndexingSlowlogTresholds threshold() { + return this.threshold; + } + + /** + * 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 (this.level != null) { + generator.writeKey("level"); + generator.write(this.level); + + } + if (this.source != null) { + generator.writeKey("source"); + generator.write(this.source); + + } + if (this.reformat != null) { + generator.writeKey("reformat"); + generator.write(this.reformat); + + } + if (this.threshold != null) { + generator.writeKey("threshold"); + this.threshold.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexingSlowlogSettings}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private String level; + + @Nullable + private Integer source; + + @Nullable + private Boolean reformat; + + @Nullable + private IndexingSlowlogTresholds threshold; + + /** + * API name: {@code level} + */ + public final Builder level(@Nullable String value) { + this.level = value; + return this; + } + + /** + * API name: {@code source} + */ + public final Builder source(@Nullable Integer value) { + this.source = value; + return this; + } + + /** + * API name: {@code reformat} + */ + public final Builder reformat(@Nullable Boolean value) { + this.reformat = value; + return this; + } + + /** + * API name: {@code threshold} + */ + public final Builder threshold(@Nullable IndexingSlowlogTresholds value) { + this.threshold = value; + return this; + } + + /** + * API name: {@code threshold} + */ + public final Builder threshold( + Function> fn) { + return this.threshold(fn.apply(new IndexingSlowlogTresholds.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexingSlowlogSettings}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexingSlowlogSettings build() { + _checkSingleUse(); + + return new IndexingSlowlogSettings(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexingSlowlogSettings} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexingSlowlogSettings::setupIndexingSlowlogSettingsDeserializer); + + protected static void setupIndexingSlowlogSettingsDeserializer( + ObjectDeserializer op) { + + op.add(Builder::level, JsonpDeserializer.stringDeserializer(), "level"); + op.add(Builder::source, JsonpDeserializer.integerDeserializer(), "source"); + op.add(Builder::reformat, JsonpDeserializer.booleanDeserializer(), "reformat"); + op.add(Builder::threshold, IndexingSlowlogTresholds._DESERIALIZER, "threshold"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingSlowlogTresholds.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingSlowlogTresholds.java new file mode 100644 index 000000000..13f9defbc --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/IndexingSlowlogTresholds.java @@ -0,0 +1,169 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.IndexingSlowlogTresholds + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexingSlowlogTresholds implements JsonpSerializable { + @Nullable + private final SlowlogTresholdLevels index; + + // --------------------------------------------------------------------------------------------- + + private IndexingSlowlogTresholds(Builder builder) { + + this.index = builder.index; + + } + + public static IndexingSlowlogTresholds of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The indexing slow log, similar in functionality to the search slow log. The + * log file name ends with _index_indexing_slowlog.json. Log and + * the thresholds are configured in the same way as the search slowlog. + *

+ * API name: {@code index} + */ + @Nullable + public final SlowlogTresholdLevels index() { + return this.index; + } + + /** + * 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 (this.index != null) { + generator.writeKey("index"); + this.index.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexingSlowlogTresholds}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private SlowlogTresholdLevels index; + + /** + * The indexing slow log, similar in functionality to the search slow log. The + * log file name ends with _index_indexing_slowlog.json. Log and + * the thresholds are configured in the same way as the search slowlog. + *

+ * API name: {@code index} + */ + public final Builder index(@Nullable SlowlogTresholdLevels value) { + this.index = value; + return this; + } + + /** + * The indexing slow log, similar in functionality to the search slow log. The + * log file name ends with _index_indexing_slowlog.json. Log and + * the thresholds are configured in the same way as the search slowlog. + *

+ * API name: {@code index} + */ + public final Builder index(Function> fn) { + return this.index(fn.apply(new SlowlogTresholdLevels.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexingSlowlogTresholds}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexingSlowlogTresholds build() { + _checkSingleUse(); + + return new IndexingSlowlogTresholds(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexingSlowlogTresholds} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexingSlowlogTresholds::setupIndexingSlowlogTresholdsDeserializer); + + protected static void setupIndexingSlowlogTresholdsDeserializer( + ObjectDeserializer op) { + + op.add(Builder::index, SlowlogTresholdLevels._DESERIALIZER, "index"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettings.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettings.java new file mode 100644 index 000000000..72b04ff98 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettings.java @@ -0,0 +1,405 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.MappingLimitSettings + +/** + * Mapping Limit Settings + * + * @see Documentation + * on elastic.co + * @see API + * specification + */ +@JsonpDeserializable +public class MappingLimitSettings implements JsonpSerializable { + @Nullable + private final Boolean coerce; + + @Nullable + private final MappingLimitSettingsTotalFields totalFields; + + @Nullable + private final MappingLimitSettingsDepth depth; + + @Nullable + private final MappingLimitSettingsNestedFields nestedFields; + + @Nullable + private final MappingLimitSettingsNestedObjects nestedObjects; + + @Nullable + private final MappingLimitSettingsFieldNameLength fieldNameLength; + + @Nullable + private final MappingLimitSettingsDimensionFields dimensionFields; + + @Nullable + private final Boolean ignoreMalformed; + + // --------------------------------------------------------------------------------------------- + + private MappingLimitSettings(Builder builder) { + + this.coerce = builder.coerce; + this.totalFields = builder.totalFields; + this.depth = builder.depth; + this.nestedFields = builder.nestedFields; + this.nestedObjects = builder.nestedObjects; + this.fieldNameLength = builder.fieldNameLength; + this.dimensionFields = builder.dimensionFields; + this.ignoreMalformed = builder.ignoreMalformed; + + } + + public static MappingLimitSettings of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code coerce} + */ + @Nullable + public final Boolean coerce() { + return this.coerce; + } + + /** + * API name: {@code total_fields} + */ + @Nullable + public final MappingLimitSettingsTotalFields totalFields() { + return this.totalFields; + } + + /** + * API name: {@code depth} + */ + @Nullable + public final MappingLimitSettingsDepth depth() { + return this.depth; + } + + /** + * API name: {@code nested_fields} + */ + @Nullable + public final MappingLimitSettingsNestedFields nestedFields() { + return this.nestedFields; + } + + /** + * API name: {@code nested_objects} + */ + @Nullable + public final MappingLimitSettingsNestedObjects nestedObjects() { + return this.nestedObjects; + } + + /** + * API name: {@code field_name_length} + */ + @Nullable + public final MappingLimitSettingsFieldNameLength fieldNameLength() { + return this.fieldNameLength; + } + + /** + * API name: {@code dimension_fields} + */ + @Nullable + public final MappingLimitSettingsDimensionFields dimensionFields() { + return this.dimensionFields; + } + + /** + * API name: {@code ignore_malformed} + */ + @Nullable + public final Boolean ignoreMalformed() { + return this.ignoreMalformed; + } + + /** + * 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 (this.coerce != null) { + generator.writeKey("coerce"); + generator.write(this.coerce); + + } + if (this.totalFields != null) { + generator.writeKey("total_fields"); + this.totalFields.serialize(generator, mapper); + + } + if (this.depth != null) { + generator.writeKey("depth"); + this.depth.serialize(generator, mapper); + + } + if (this.nestedFields != null) { + generator.writeKey("nested_fields"); + this.nestedFields.serialize(generator, mapper); + + } + if (this.nestedObjects != null) { + generator.writeKey("nested_objects"); + this.nestedObjects.serialize(generator, mapper); + + } + if (this.fieldNameLength != null) { + generator.writeKey("field_name_length"); + this.fieldNameLength.serialize(generator, mapper); + + } + if (this.dimensionFields != null) { + generator.writeKey("dimension_fields"); + this.dimensionFields.serialize(generator, mapper); + + } + if (this.ignoreMalformed != null) { + generator.writeKey("ignore_malformed"); + generator.write(this.ignoreMalformed); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link MappingLimitSettings}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Boolean coerce; + + @Nullable + private MappingLimitSettingsTotalFields totalFields; + + @Nullable + private MappingLimitSettingsDepth depth; + + @Nullable + private MappingLimitSettingsNestedFields nestedFields; + + @Nullable + private MappingLimitSettingsNestedObjects nestedObjects; + + @Nullable + private MappingLimitSettingsFieldNameLength fieldNameLength; + + @Nullable + private MappingLimitSettingsDimensionFields dimensionFields; + + @Nullable + private Boolean ignoreMalformed; + + /** + * API name: {@code coerce} + */ + public final Builder coerce(@Nullable Boolean value) { + this.coerce = value; + return this; + } + + /** + * API name: {@code total_fields} + */ + public final Builder totalFields(@Nullable MappingLimitSettingsTotalFields value) { + this.totalFields = value; + return this; + } + + /** + * API name: {@code total_fields} + */ + public final Builder totalFields( + Function> fn) { + return this.totalFields(fn.apply(new MappingLimitSettingsTotalFields.Builder()).build()); + } + + /** + * API name: {@code depth} + */ + public final Builder depth(@Nullable MappingLimitSettingsDepth value) { + this.depth = value; + return this; + } + + /** + * API name: {@code depth} + */ + public final Builder depth( + Function> fn) { + return this.depth(fn.apply(new MappingLimitSettingsDepth.Builder()).build()); + } + + /** + * API name: {@code nested_fields} + */ + public final Builder nestedFields(@Nullable MappingLimitSettingsNestedFields value) { + this.nestedFields = value; + return this; + } + + /** + * API name: {@code nested_fields} + */ + public final Builder nestedFields( + Function> fn) { + return this.nestedFields(fn.apply(new MappingLimitSettingsNestedFields.Builder()).build()); + } + + /** + * API name: {@code nested_objects} + */ + public final Builder nestedObjects(@Nullable MappingLimitSettingsNestedObjects value) { + this.nestedObjects = value; + return this; + } + + /** + * API name: {@code nested_objects} + */ + public final Builder nestedObjects( + Function> fn) { + return this.nestedObjects(fn.apply(new MappingLimitSettingsNestedObjects.Builder()).build()); + } + + /** + * API name: {@code field_name_length} + */ + public final Builder fieldNameLength(@Nullable MappingLimitSettingsFieldNameLength value) { + this.fieldNameLength = value; + return this; + } + + /** + * API name: {@code field_name_length} + */ + public final Builder fieldNameLength( + Function> fn) { + return this.fieldNameLength(fn.apply(new MappingLimitSettingsFieldNameLength.Builder()).build()); + } + + /** + * API name: {@code dimension_fields} + */ + public final Builder dimensionFields(@Nullable MappingLimitSettingsDimensionFields value) { + this.dimensionFields = value; + return this; + } + + /** + * API name: {@code dimension_fields} + */ + public final Builder dimensionFields( + Function> fn) { + return this.dimensionFields(fn.apply(new MappingLimitSettingsDimensionFields.Builder()).build()); + } + + /** + * API name: {@code ignore_malformed} + */ + public final Builder ignoreMalformed(@Nullable Boolean value) { + this.ignoreMalformed = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link MappingLimitSettings}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public MappingLimitSettings build() { + _checkSingleUse(); + + return new MappingLimitSettings(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link MappingLimitSettings} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, MappingLimitSettings::setupMappingLimitSettingsDeserializer); + + protected static void setupMappingLimitSettingsDeserializer(ObjectDeserializer op) { + + op.add(Builder::coerce, JsonpDeserializer.booleanDeserializer(), "coerce"); + op.add(Builder::totalFields, MappingLimitSettingsTotalFields._DESERIALIZER, "total_fields"); + op.add(Builder::depth, MappingLimitSettingsDepth._DESERIALIZER, "depth"); + op.add(Builder::nestedFields, MappingLimitSettingsNestedFields._DESERIALIZER, "nested_fields"); + op.add(Builder::nestedObjects, MappingLimitSettingsNestedObjects._DESERIALIZER, "nested_objects"); + op.add(Builder::fieldNameLength, MappingLimitSettingsFieldNameLength._DESERIALIZER, "field_name_length"); + op.add(Builder::dimensionFields, MappingLimitSettingsDimensionFields._DESERIALIZER, "dimension_fields"); + op.add(Builder::ignoreMalformed, JsonpDeserializer.booleanDeserializer(), "ignore_malformed"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDepth.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDepth.java new file mode 100644 index 000000000..ff6e3b778 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDepth.java @@ -0,0 +1,161 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Integer; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.MappingLimitSettingsDepth + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class MappingLimitSettingsDepth implements JsonpSerializable { + @Nullable + private final Integer limit; + + // --------------------------------------------------------------------------------------------- + + private MappingLimitSettingsDepth(Builder builder) { + + this.limit = builder.limit; + + } + + public static MappingLimitSettingsDepth of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The maximum depth for a field, which is measured as the number of inner + * objects. For instance, if all fields are defined at the root object level, + * then the depth is 1. If there is one object mapping, then the depth is 2, + * etc. + *

+ * API name: {@code limit} + */ + @Nullable + public final Integer limit() { + return this.limit; + } + + /** + * 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 (this.limit != null) { + generator.writeKey("limit"); + generator.write(this.limit); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link MappingLimitSettingsDepth}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Integer limit; + + /** + * The maximum depth for a field, which is measured as the number of inner + * objects. For instance, if all fields are defined at the root object level, + * then the depth is 1. If there is one object mapping, then the depth is 2, + * etc. + *

+ * API name: {@code limit} + */ + public final Builder limit(@Nullable Integer value) { + this.limit = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link MappingLimitSettingsDepth}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public MappingLimitSettingsDepth build() { + _checkSingleUse(); + + return new MappingLimitSettingsDepth(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link MappingLimitSettingsDepth} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, MappingLimitSettingsDepth::setupMappingLimitSettingsDepthDeserializer); + + protected static void setupMappingLimitSettingsDepthDeserializer( + ObjectDeserializer op) { + + op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDimensionFields.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDimensionFields.java new file mode 100644 index 000000000..2015ec80c --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsDimensionFields.java @@ -0,0 +1,163 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Integer; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.MappingLimitSettingsDimensionFields + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class MappingLimitSettingsDimensionFields implements JsonpSerializable { + @Nullable + private final Integer limit; + + // --------------------------------------------------------------------------------------------- + + private MappingLimitSettingsDimensionFields(Builder builder) { + + this.limit = builder.limit; + + } + + public static MappingLimitSettingsDimensionFields of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * [preview] This functionality is in technical preview and may be changed or + * removed in a future release. Elastic will apply best effort to fix any + * issues, but features in technical preview are not subject to the support SLA + * of official GA features. + *

+ * API name: {@code limit} + */ + @Nullable + public final Integer limit() { + return this.limit; + } + + /** + * 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 (this.limit != null) { + generator.writeKey("limit"); + generator.write(this.limit); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link MappingLimitSettingsDimensionFields}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Integer limit; + + /** + * [preview] This functionality is in technical preview and may be changed or + * removed in a future release. Elastic will apply best effort to fix any + * issues, but features in technical preview are not subject to the support SLA + * of official GA features. + *

+ * API name: {@code limit} + */ + public final Builder limit(@Nullable Integer value) { + this.limit = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link MappingLimitSettingsDimensionFields}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public MappingLimitSettingsDimensionFields build() { + _checkSingleUse(); + + return new MappingLimitSettingsDimensionFields(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link MappingLimitSettingsDimensionFields} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, + MappingLimitSettingsDimensionFields::setupMappingLimitSettingsDimensionFieldsDeserializer); + + protected static void setupMappingLimitSettingsDimensionFieldsDeserializer( + ObjectDeserializer op) { + + op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsFieldNameLength.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsFieldNameLength.java new file mode 100644 index 000000000..616fbbd6c --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsFieldNameLength.java @@ -0,0 +1,167 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Long; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.MappingLimitSettingsFieldNameLength + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class MappingLimitSettingsFieldNameLength implements JsonpSerializable { + @Nullable + private final Long limit; + + // --------------------------------------------------------------------------------------------- + + private MappingLimitSettingsFieldNameLength(Builder builder) { + + this.limit = builder.limit; + + } + + public static MappingLimitSettingsFieldNameLength of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Setting for the maximum length of a field name. This setting isn’t really + * something that addresses mappings explosion but might still be useful if you + * want to limit the field length. It usually shouldn’t be necessary to set this + * setting. The default is okay unless a user starts to add a huge number of + * fields with really long names. Default is Long.MAX_VALUE (no + * limit). + *

+ * API name: {@code limit} + */ + @Nullable + public final Long limit() { + return this.limit; + } + + /** + * 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 (this.limit != null) { + generator.writeKey("limit"); + generator.write(this.limit); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link MappingLimitSettingsFieldNameLength}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Long limit; + + /** + * Setting for the maximum length of a field name. This setting isn’t really + * something that addresses mappings explosion but might still be useful if you + * want to limit the field length. It usually shouldn’t be necessary to set this + * setting. The default is okay unless a user starts to add a huge number of + * fields with really long names. Default is Long.MAX_VALUE (no + * limit). + *

+ * API name: {@code limit} + */ + public final Builder limit(@Nullable Long value) { + this.limit = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link MappingLimitSettingsFieldNameLength}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public MappingLimitSettingsFieldNameLength build() { + _checkSingleUse(); + + return new MappingLimitSettingsFieldNameLength(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link MappingLimitSettingsFieldNameLength} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, + MappingLimitSettingsFieldNameLength::setupMappingLimitSettingsFieldNameLengthDeserializer); + + protected static void setupMappingLimitSettingsFieldNameLengthDeserializer( + ObjectDeserializer op) { + + op.add(Builder::limit, JsonpDeserializer.longDeserializer(), "limit"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedFields.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedFields.java new file mode 100644 index 000000000..bda69b799 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedFields.java @@ -0,0 +1,162 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Integer; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.MappingLimitSettingsNestedFields + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class MappingLimitSettingsNestedFields implements JsonpSerializable { + @Nullable + private final Integer limit; + + // --------------------------------------------------------------------------------------------- + + private MappingLimitSettingsNestedFields(Builder builder) { + + this.limit = builder.limit; + + } + + public static MappingLimitSettingsNestedFields of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The maximum number of distinct nested mappings in an index. The nested type + * should only be used in special cases, when arrays of objects need to be + * queried independently of each other. To safeguard against poorly designed + * mappings, this setting limits the number of unique nested types per index. + *

+ * API name: {@code limit} + */ + @Nullable + public final Integer limit() { + return this.limit; + } + + /** + * 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 (this.limit != null) { + generator.writeKey("limit"); + generator.write(this.limit); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link MappingLimitSettingsNestedFields}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Integer limit; + + /** + * The maximum number of distinct nested mappings in an index. The nested type + * should only be used in special cases, when arrays of objects need to be + * queried independently of each other. To safeguard against poorly designed + * mappings, this setting limits the number of unique nested types per index. + *

+ * API name: {@code limit} + */ + public final Builder limit(@Nullable Integer value) { + this.limit = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link MappingLimitSettingsNestedFields}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public MappingLimitSettingsNestedFields build() { + _checkSingleUse(); + + return new MappingLimitSettingsNestedFields(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link MappingLimitSettingsNestedFields} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, MappingLimitSettingsNestedFields::setupMappingLimitSettingsNestedFieldsDeserializer); + + protected static void setupMappingLimitSettingsNestedFieldsDeserializer( + ObjectDeserializer op) { + + op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedObjects.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedObjects.java new file mode 100644 index 000000000..8fcaf13e7 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsNestedObjects.java @@ -0,0 +1,160 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Integer; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.MappingLimitSettingsNestedObjects + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class MappingLimitSettingsNestedObjects implements JsonpSerializable { + @Nullable + private final Integer limit; + + // --------------------------------------------------------------------------------------------- + + private MappingLimitSettingsNestedObjects(Builder builder) { + + this.limit = builder.limit; + + } + + public static MappingLimitSettingsNestedObjects of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The maximum number of nested JSON objects that a single document can contain + * across all nested types. This limit helps to prevent out of memory errors + * when a document contains too many nested objects. + *

+ * API name: {@code limit} + */ + @Nullable + public final Integer limit() { + return this.limit; + } + + /** + * 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 (this.limit != null) { + generator.writeKey("limit"); + generator.write(this.limit); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link MappingLimitSettingsNestedObjects}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Integer limit; + + /** + * The maximum number of nested JSON objects that a single document can contain + * across all nested types. This limit helps to prevent out of memory errors + * when a document contains too many nested objects. + *

+ * API name: {@code limit} + */ + public final Builder limit(@Nullable Integer value) { + this.limit = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link MappingLimitSettingsNestedObjects}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public MappingLimitSettingsNestedObjects build() { + _checkSingleUse(); + + return new MappingLimitSettingsNestedObjects(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link MappingLimitSettingsNestedObjects} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, MappingLimitSettingsNestedObjects::setupMappingLimitSettingsNestedObjectsDeserializer); + + protected static void setupMappingLimitSettingsNestedObjectsDeserializer( + ObjectDeserializer op) { + + op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java new file mode 100644 index 000000000..849a0c164 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MappingLimitSettingsTotalFields.java @@ -0,0 +1,164 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Integer; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.MappingLimitSettingsTotalFields + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class MappingLimitSettingsTotalFields implements JsonpSerializable { + @Nullable + private final Integer limit; + + // --------------------------------------------------------------------------------------------- + + private MappingLimitSettingsTotalFields(Builder builder) { + + this.limit = builder.limit; + + } + + public static MappingLimitSettingsTotalFields of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * The maximum number of fields in an index. Field and object mappings, as well + * as field aliases count towards this limit. The limit is in place to prevent + * mappings and searches from becoming too large. Higher values can lead to + * performance degradations and memory issues, especially in clusters with a + * high load or few resources. + *

+ * API name: {@code limit} + */ + @Nullable + public final Integer limit() { + return this.limit; + } + + /** + * 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 (this.limit != null) { + generator.writeKey("limit"); + generator.write(this.limit); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link MappingLimitSettingsTotalFields}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Integer limit; + + /** + * The maximum number of fields in an index. Field and object mappings, as well + * as field aliases count towards this limit. The limit is in place to prevent + * mappings and searches from becoming too large. Higher values can lead to + * performance degradations and memory issues, especially in clusters with a + * high load or few resources. + *

+ * API name: {@code limit} + */ + public final Builder limit(@Nullable Integer value) { + this.limit = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link MappingLimitSettingsTotalFields}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public MappingLimitSettingsTotalFields build() { + _checkSingleUse(); + + return new MappingLimitSettingsTotalFields(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link MappingLimitSettingsTotalFields} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, MappingLimitSettingsTotalFields::setupMappingLimitSettingsTotalFieldsDeserializer); + + protected static void setupMappingLimitSettingsTotalFieldsDeserializer( + ObjectDeserializer op) { + + op.add(Builder::limit, JsonpDeserializer.integerDeserializer(), "limit"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Merge.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Merge.java new file mode 100644 index 000000000..0d80cc1a7 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Merge.java @@ -0,0 +1,153 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.Merge + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Merge implements JsonpSerializable { + @Nullable + private final MergeScheduler scheduler; + + // --------------------------------------------------------------------------------------------- + + private Merge(Builder builder) { + + this.scheduler = builder.scheduler; + + } + + public static Merge of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code scheduler} + */ + @Nullable + public final MergeScheduler scheduler() { + return this.scheduler; + } + + /** + * 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 (this.scheduler != null) { + generator.writeKey("scheduler"); + this.scheduler.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Merge}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private MergeScheduler scheduler; + + /** + * API name: {@code scheduler} + */ + public final Builder scheduler(@Nullable MergeScheduler value) { + this.scheduler = value; + return this; + } + + /** + * API name: {@code scheduler} + */ + public final Builder scheduler(Function> fn) { + return this.scheduler(fn.apply(new MergeScheduler.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link Merge}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public Merge build() { + _checkSingleUse(); + + return new Merge(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Merge} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Merge::setupMergeDeserializer); + + protected static void setupMergeDeserializer(ObjectDeserializer op) { + + op.add(Builder::scheduler, MergeScheduler._DESERIALIZER, "scheduler"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MergeScheduler.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MergeScheduler.java new file mode 100644 index 000000000..81aa3b896 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MergeScheduler.java @@ -0,0 +1,176 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Integer; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.MergeScheduler + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class MergeScheduler implements JsonpSerializable { + @Nullable + private final Integer maxThreadCount; + + @Nullable + private final Integer maxMergeCount; + + // --------------------------------------------------------------------------------------------- + + private MergeScheduler(Builder builder) { + + this.maxThreadCount = builder.maxThreadCount; + this.maxMergeCount = builder.maxMergeCount; + + } + + public static MergeScheduler of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code max_thread_count} + */ + @Nullable + public final Integer maxThreadCount() { + return this.maxThreadCount; + } + + /** + * API name: {@code max_merge_count} + */ + @Nullable + public final Integer maxMergeCount() { + return this.maxMergeCount; + } + + /** + * 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 (this.maxThreadCount != null) { + generator.writeKey("max_thread_count"); + generator.write(this.maxThreadCount); + + } + if (this.maxMergeCount != null) { + generator.writeKey("max_merge_count"); + generator.write(this.maxMergeCount); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link MergeScheduler}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Integer maxThreadCount; + + @Nullable + private Integer maxMergeCount; + + /** + * API name: {@code max_thread_count} + */ + public final Builder maxThreadCount(@Nullable Integer value) { + this.maxThreadCount = value; + return this; + } + + /** + * API name: {@code max_merge_count} + */ + public final Builder maxMergeCount(@Nullable Integer value) { + this.maxMergeCount = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link MergeScheduler}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public MergeScheduler build() { + _checkSingleUse(); + + return new MergeScheduler(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link MergeScheduler} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + MergeScheduler::setupMergeSchedulerDeserializer); + + protected static void setupMergeSchedulerDeserializer(ObjectDeserializer op) { + + op.add(Builder::maxThreadCount, JsonpDeserializer.integerDeserializer(), "max_thread_count"); + op.add(Builder::maxMergeCount, JsonpDeserializer.integerDeserializer(), "max_merge_count"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MigrateToDataStreamRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MigrateToDataStreamRequest.java new file mode 100644 index 000000000..a7c7d13f1 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MigrateToDataStreamRequest.java @@ -0,0 +1,180 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +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.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.migrate_to_data_stream.Request + +/** + * Converts an index alias to a data stream. You must have a matching index + * template that is data stream enabled. The alias must meet the following + * criteria: The alias must have a write index; All indices for the alias must + * have a @timestamp field mapping of a date or + * date_nanos field type; The alias must not have any filters; The + * alias must not use custom routing. If successful, the request removes the + * alias and creates a data stream with the same name. The indices for the alias + * become hidden backing indices for the stream. The write index for the alias + * becomes the write index for the stream. + * + * @see API + * specification + */ + +public class MigrateToDataStreamRequest extends RequestBase { + private final String name; + + // --------------------------------------------------------------------------------------------- + + private MigrateToDataStreamRequest(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + + } + + public static MigrateToDataStreamRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Name of the index alias to convert to a data stream. + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link MigrateToDataStreamRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + private String name; + + /** + * Required - Name of the index alias to convert to a data stream. + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link MigrateToDataStreamRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public MigrateToDataStreamRequest build() { + _checkSingleUse(); + + return new MigrateToDataStreamRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.migrate_to_data_stream}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.migrate_to_data_stream", + + // Request method + request -> { + return "POST"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_data_stream"); + buf.append("/_migrate"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name); + } + return params; + }, + + // Request parameters + request -> { + return Collections.emptyMap(); + + }, SimpleEndpoint.emptyMap(), false, MigrateToDataStreamResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MigrateToDataStreamResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MigrateToDataStreamResponse.java new file mode 100644 index 000000000..3aed3a38c --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/MigrateToDataStreamResponse.java @@ -0,0 +1,98 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.migrate_to_data_stream.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class MigrateToDataStreamResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private MigrateToDataStreamResponse(Builder builder) { + super(builder); + + } + + public static MigrateToDataStreamResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link MigrateToDataStreamResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link MigrateToDataStreamResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public MigrateToDataStreamResponse build() { + _checkSingleUse(); + + return new MigrateToDataStreamResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link MigrateToDataStreamResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, MigrateToDataStreamResponse::setupMigrateToDataStreamResponseDeserializer); + + protected static void setupMigrateToDataStreamResponseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ModifyDataStreamRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ModifyDataStreamRequest.java new file mode 100644 index 000000000..f3fca2a41 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ModifyDataStreamRequest.java @@ -0,0 +1,214 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch.indices.modify_data_stream.Action; +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.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.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.modify_data_stream.Request + +/** + * Performs one or more data stream modification actions in a single atomic + * operation. + * + * @see API + * specification + */ +@JsonpDeserializable +public class ModifyDataStreamRequest extends RequestBase implements JsonpSerializable { + private final List actions; + + // --------------------------------------------------------------------------------------------- + + private ModifyDataStreamRequest(Builder builder) { + + this.actions = ApiTypeHelper.unmodifiableRequired(builder.actions, this, "actions"); + + } + + public static ModifyDataStreamRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Actions to perform. + *

+ * API name: {@code actions} + */ + public final List actions() { + return this.actions; + } + + /** + * 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.actions)) { + generator.writeKey("actions"); + generator.writeStartArray(); + for (Action item0 : this.actions) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ModifyDataStreamRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + private List actions; + + /** + * Required - Actions to perform. + *

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

+ * Adds all elements of list to actions. + */ + public final Builder actions(List list) { + this.actions = _listAddAll(this.actions, list); + return this; + } + + /** + * Required - Actions to perform. + *

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

+ * Adds one or more values to actions. + */ + public final Builder actions(Action value, Action... values) { + this.actions = _listAdd(this.actions, value, values); + return this; + } + + /** + * Required - Actions to perform. + *

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

+ * Adds a value to actions using a builder lambda. + */ + public final Builder actions(Function> fn) { + return actions(fn.apply(new Action.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ModifyDataStreamRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ModifyDataStreamRequest build() { + _checkSingleUse(); + + return new ModifyDataStreamRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ModifyDataStreamRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ModifyDataStreamRequest::setupModifyDataStreamRequestDeserializer); + + protected static void setupModifyDataStreamRequestDeserializer( + ObjectDeserializer op) { + + op.add(Builder::actions, JsonpDeserializer.arrayDeserializer(Action._DESERIALIZER), "actions"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.modify_data_stream}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.modify_data_stream", + + // Request method + request -> { + return "POST"; + + }, + + // Request path + request -> { + return "/_data_stream/_modify"; + + }, + + // Path parameters + request -> { + return Collections.emptyMap(); + }, + + // Request parameters + request -> { + return Collections.emptyMap(); + + }, SimpleEndpoint.emptyMap(), true, ModifyDataStreamResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ModifyDataStreamResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ModifyDataStreamResponse.java new file mode 100644 index 000000000..e2b13d2d7 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ModifyDataStreamResponse.java @@ -0,0 +1,98 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.modify_data_stream.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ModifyDataStreamResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private ModifyDataStreamResponse(Builder builder) { + super(builder); + + } + + public static ModifyDataStreamResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ModifyDataStreamResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ModifyDataStreamResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ModifyDataStreamResponse build() { + _checkSingleUse(); + + return new ModifyDataStreamResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ModifyDataStreamResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ModifyDataStreamResponse::setupModifyDataStreamResponseDeserializer); + + protected static void setupModifyDataStreamResponseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/NumericFielddata.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/NumericFielddata.java new file mode 100644 index 000000000..60769703c --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/NumericFielddata.java @@ -0,0 +1,141 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.NumericFielddata + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class NumericFielddata implements JsonpSerializable { + private final NumericFielddataFormat format; + + // --------------------------------------------------------------------------------------------- + + private NumericFielddata(Builder builder) { + + this.format = ApiTypeHelper.requireNonNull(builder.format, this, "format"); + + } + + public static NumericFielddata of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code format} + */ + public final NumericFielddataFormat format() { + return this.format; + } + + /** + * 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("format"); + this.format.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link NumericFielddata}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private NumericFielddataFormat format; + + /** + * Required - API name: {@code format} + */ + public final Builder format(NumericFielddataFormat value) { + this.format = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link NumericFielddata}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public NumericFielddata build() { + _checkSingleUse(); + + return new NumericFielddata(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link NumericFielddata} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + NumericFielddata::setupNumericFielddataDeserializer); + + protected static void setupNumericFielddataDeserializer(ObjectDeserializer op) { + + op.add(Builder::format, NumericFielddataFormat._DESERIALIZER, "format"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/NumericFielddataFormat.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/NumericFielddataFormat.java new file mode 100644 index 000000000..27f5b92df --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/NumericFielddataFormat.java @@ -0,0 +1,56 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum NumericFielddataFormat implements JsonEnum { + Array("array"), + + Disabled("disabled"), + + ; + + private final String jsonValue; + + NumericFielddataFormat(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + NumericFielddataFormat.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutAliasRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutAliasRequest.java new file mode 100644 index 000000000..da1bae0e7 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutAliasRequest.java @@ -0,0 +1,548 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.elasticsearch._types.query_dsl.Query; +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.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.Boolean; +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; + +// typedef: indices.put_alias.Request + +/** + * Adds a data stream or index to an alias. + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutAliasRequest extends RequestBase implements JsonpSerializable { + @Nullable + private final Query filter; + + private final List index; + + @Nullable + private final String indexRouting; + + @Nullable + private final Boolean isWriteIndex; + + @Nullable + private final Time masterTimeout; + + private final String name; + + @Nullable + private final String routing; + + @Nullable + private final String searchRouting; + + @Nullable + private final Time timeout; + + // --------------------------------------------------------------------------------------------- + + private PutAliasRequest(Builder builder) { + + this.filter = builder.filter; + this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); + this.indexRouting = builder.indexRouting; + this.isWriteIndex = builder.isWriteIndex; + this.masterTimeout = builder.masterTimeout; + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.routing = builder.routing; + this.searchRouting = builder.searchRouting; + this.timeout = builder.timeout; + + } + + public static PutAliasRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Query used to limit documents the alias can access. + *

+ * API name: {@code filter} + */ + @Nullable + public final Query filter() { + return this.filter; + } + + /** + * Required - Comma-separated list of data streams or indices to add. Supports + * wildcards (*). Wildcard patterns that match both data streams + * and indices return an error. + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * Value used to route indexing operations to a specific shard. If specified, + * this overwrites the routing value for indexing operations. Data + * stream aliases don’t support this parameter. + *

+ * API name: {@code index_routing} + */ + @Nullable + public final String indexRouting() { + return this.indexRouting; + } + + /** + * If true, sets the write index or data stream for the alias. If + * an alias points to multiple indices or data streams and + * is_write_index isn’t set, the alias rejects write requests. If + * an index alias points to one index and is_write_index isn’t set, + * the index automatically acts as the write index. Data stream aliases don’t + * automatically set a write data stream, even if the alias points to one data + * stream. + *

+ * API name: {@code is_write_index} + */ + @Nullable + public final Boolean isWriteIndex() { + return this.isWriteIndex; + } + + /** + * 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; + } + + /** + * Required - Alias to update. If the alias doesn’t exist, the request creates + * it. Index alias names support date math. + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * Value used to route indexing and search operations to a specific shard. Data + * stream aliases don’t support this parameter. + *

+ * API name: {@code routing} + */ + @Nullable + public final String routing() { + return this.routing; + } + + /** + * Value used to route search operations to a specific shard. If specified, this + * overwrites the routing value for search operations. Data stream + * aliases don’t support this parameter. + *

+ * API name: {@code search_routing} + */ + @Nullable + public final String searchRouting() { + return this.searchRouting; + } + + /** + * 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; + } + + /** + * 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 (this.filter != null) { + generator.writeKey("filter"); + this.filter.serialize(generator, mapper); + + } + if (this.indexRouting != null) { + generator.writeKey("index_routing"); + generator.write(this.indexRouting); + + } + if (this.isWriteIndex != null) { + generator.writeKey("is_write_index"); + generator.write(this.isWriteIndex); + + } + if (this.routing != null) { + generator.writeKey("routing"); + generator.write(this.routing); + + } + if (this.searchRouting != null) { + generator.writeKey("search_routing"); + generator.write(this.searchRouting); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutAliasRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + @Nullable + private Query filter; + + private List index; + + @Nullable + private String indexRouting; + + @Nullable + private Boolean isWriteIndex; + + @Nullable + private Time masterTimeout; + + private String name; + + @Nullable + private String routing; + + @Nullable + private String searchRouting; + + @Nullable + private Time timeout; + + /** + * Query used to limit documents the alias can access. + *

+ * API name: {@code filter} + */ + public final Builder filter(@Nullable Query value) { + this.filter = value; + return this; + } + + /** + * Query used to limit documents the alias can access. + *

+ * API name: {@code filter} + */ + public final Builder filter(Function> fn) { + return this.filter(fn.apply(new Query.Builder()).build()); + } + + /** + * Required - Comma-separated list of data streams or indices to add. Supports + * wildcards (*). Wildcard patterns that match both data streams + * and indices return an error. + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Required - Comma-separated list of data streams or indices to add. Supports + * wildcards (*). Wildcard patterns that match both data streams + * and indices return an error. + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); + return this; + } + + /** + * Value used to route indexing operations to a specific shard. If specified, + * this overwrites the routing value for indexing operations. Data + * stream aliases don’t support this parameter. + *

+ * API name: {@code index_routing} + */ + public final Builder indexRouting(@Nullable String value) { + this.indexRouting = value; + return this; + } + + /** + * If true, sets the write index or data stream for the alias. If + * an alias points to multiple indices or data streams and + * is_write_index isn’t set, the alias rejects write requests. If + * an index alias points to one index and is_write_index isn’t set, + * the index automatically acts as the write index. Data stream aliases don’t + * automatically set a write data stream, even if the alias points to one data + * stream. + *

+ * API name: {@code is_write_index} + */ + public final Builder isWriteIndex(@Nullable Boolean value) { + this.isWriteIndex = 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(@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()); + } + + /** + * Required - Alias to update. If the alias doesn’t exist, the request creates + * it. Index alias names support date math. + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Value used to route indexing and search operations to a specific shard. Data + * stream aliases don’t support this parameter. + *

+ * API name: {@code routing} + */ + public final Builder routing(@Nullable String value) { + this.routing = value; + return this; + } + + /** + * Value used to route search operations to a specific shard. If specified, this + * overwrites the routing value for search operations. Data stream + * aliases don’t support this parameter. + *

+ * API name: {@code search_routing} + */ + public final Builder searchRouting(@Nullable String value) { + this.searchRouting = 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(@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 PutAliasRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutAliasRequest build() { + _checkSingleUse(); + + return new PutAliasRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutAliasRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + PutAliasRequest::setupPutAliasRequestDeserializer); + + protected static void setupPutAliasRequestDeserializer(ObjectDeserializer op) { + + op.add(Builder::filter, Query._DESERIALIZER, "filter"); + op.add(Builder::indexRouting, JsonpDeserializer.stringDeserializer(), "index_routing"); + op.add(Builder::isWriteIndex, JsonpDeserializer.booleanDeserializer(), "is_write_index"); + op.add(Builder::routing, JsonpDeserializer.stringDeserializer(), "routing"); + op.add(Builder::searchRouting, JsonpDeserializer.stringDeserializer(), "search_routing"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.put_alias}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.put_alias", + + // Request method + request -> { + return "PUT"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + final int _index = 1 << 1; + + int propsSet = 0; + + propsSet |= _name; + propsSet |= _index; + + if (propsSet == (_index | _name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_alias"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + return buf.toString(); + } + if (propsSet == (_index | _name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_aliases"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + final int _index = 1 << 1; + + int propsSet = 0; + + propsSet |= _name; + propsSet |= _index; + + if (propsSet == (_index | _name)) { + params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); + params.put("name", request.name); + } + if (propsSet == (_index | _name)) { + params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); + params.put("name", request.name); + } + 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(), true, PutAliasResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutAliasResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutAliasResponse.java new file mode 100644 index 000000000..fca01f0f0 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutAliasResponse.java @@ -0,0 +1,96 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.put_alias.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutAliasResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private PutAliasResponse(Builder builder) { + super(builder); + + } + + public static PutAliasResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutAliasResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutAliasResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutAliasResponse build() { + _checkSingleUse(); + + return new PutAliasResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutAliasResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + PutAliasResponse::setupPutAliasResponseDeserializer); + + protected static void setupPutAliasResponseDeserializer(ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataLifecycleRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataLifecycleRequest.java new file mode 100644 index 000000000..4e38a30ba --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataLifecycleRequest.java @@ -0,0 +1,413 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +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.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +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; + +// typedef: indices.put_data_lifecycle.Request + +/** + * Update the data lifecycle of the specified data streams. + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutDataLifecycleRequest extends RequestBase implements JsonpSerializable { + @Nullable + private final Time dataRetention; + + private final List expandWildcards; + + @Nullable + private final Time masterTimeout; + + private final List name; + + @Nullable + private final Time timeout; + + // --------------------------------------------------------------------------------------------- + + private PutDataLifecycleRequest(Builder builder) { + + this.dataRetention = builder.dataRetention; + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.masterTimeout = builder.masterTimeout; + this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); + this.timeout = builder.timeout; + + } + + public static PutDataLifecycleRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If defined, every document added to this data stream will be stored at least + * for this time frame. Any time after this duration the document could be + * deleted. When empty, every document in this data stream will be stored + * indefinitely. + *

+ * API name: {@code data_retention} + */ + @Nullable + public final Time dataRetention() { + return this.dataRetention; + } + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values, such as open,hidden. Valid values are: + * all, hidden, open, + * closed, none. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * 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; + } + + /** + * Required - Comma-separated list of data streams used to limit the request. + * Supports wildcards (*). To target all data streams use + * * or _all. + *

+ * API name: {@code name} + */ + public final List name() { + return this.name; + } + + /** + * 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; + } + + /** + * 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 (this.dataRetention != null) { + generator.writeKey("data_retention"); + this.dataRetention.serialize(generator, mapper); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutDataLifecycleRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Time dataRetention; + + @Nullable + private List expandWildcards; + + @Nullable + private Time masterTimeout; + + private List name; + + @Nullable + private Time timeout; + + /** + * If defined, every document added to this data stream will be stored at least + * for this time frame. Any time after this duration the document could be + * deleted. When empty, every document in this data stream will be stored + * indefinitely. + *

+ * API name: {@code data_retention} + */ + public final Builder dataRetention(@Nullable Time value) { + this.dataRetention = value; + return this; + } + + /** + * If defined, every document added to this data stream will be stored at least + * for this time frame. Any time after this duration the document could be + * deleted. When empty, every document in this data stream will be stored + * indefinitely. + *

+ * API name: {@code data_retention} + */ + public final Builder dataRetention(Function> fn) { + return this.dataRetention(fn.apply(new Time.Builder()).build()); + } + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values, such as open,hidden. Valid values are: + * all, hidden, open, + * closed, none. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of data stream that wildcard patterns can match. Supports + * comma-separated values, such as open,hidden. Valid values are: + * all, hidden, open, + * closed, none. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, 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()); + } + + /** + * Required - Comma-separated list of data streams used to limit the request. + * Supports wildcards (*). To target all data streams use + * * or _all. + *

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

+ * Adds all elements of list to name. + */ + public final Builder name(List list) { + this.name = _listAddAll(this.name, list); + return this; + } + + /** + * Required - Comma-separated list of data streams used to limit the request. + * Supports wildcards (*). To target all data streams use + * * or _all. + *

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

+ * Adds one or more values to name. + */ + public final Builder name(String value, String... values) { + this.name = _listAdd(this.name, value, values); + 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(@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 PutDataLifecycleRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutDataLifecycleRequest build() { + _checkSingleUse(); + + return new PutDataLifecycleRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutDataLifecycleRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, PutDataLifecycleRequest::setupPutDataLifecycleRequestDeserializer); + + protected static void setupPutDataLifecycleRequestDeserializer( + ObjectDeserializer op) { + + op.add(Builder::dataRetention, Time._DESERIALIZER, "data_retention"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.put_data_lifecycle}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.put_data_lifecycle", + + // Request method + request -> { + return "PUT"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_data_stream"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_lifecycle"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name.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 (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), true, PutDataLifecycleResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataLifecycleResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataLifecycleResponse.java new file mode 100644 index 000000000..6fb604435 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutDataLifecycleResponse.java @@ -0,0 +1,98 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.put_data_lifecycle.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutDataLifecycleResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private PutDataLifecycleResponse(Builder builder) { + super(builder); + + } + + public static PutDataLifecycleResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutDataLifecycleResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutDataLifecycleResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutDataLifecycleResponse build() { + _checkSingleUse(); + + return new PutDataLifecycleResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutDataLifecycleResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, PutDataLifecycleResponse::setupPutDataLifecycleResponseDeserializer); + + protected static void setupPutDataLifecycleResponseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateRequest.java new file mode 100644 index 000000000..03d25f990 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateRequest.java @@ -0,0 +1,572 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch.indices.put_index_template.IndexTemplateMapping; +import co.elastic.clients.json.JsonData; +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.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.Boolean; +import java.lang.Integer; +import java.lang.Long; +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 javax.annotation.Nullable; + +// typedef: indices.put_index_template.Request + +/** + * Creates or updates an index template. Index templates define settings, + * mappings, and aliases that can be applied automatically to new indices. + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutIndexTemplateRequest extends RequestBase implements JsonpSerializable { + private final Map meta; + + private final List composedOf; + + @Nullable + private final Boolean create; + + @Nullable + private final DataStreamVisibility dataStream; + + private final List indexPatterns; + + private final String name; + + @Nullable + private final Integer priority; + + @Nullable + private final IndexTemplateMapping template; + + @Nullable + private final Long version; + + // --------------------------------------------------------------------------------------------- + + private PutIndexTemplateRequest(Builder builder) { + + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.composedOf = ApiTypeHelper.unmodifiable(builder.composedOf); + this.create = builder.create; + this.dataStream = builder.dataStream; + this.indexPatterns = ApiTypeHelper.unmodifiable(builder.indexPatterns); + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.priority = builder.priority; + this.template = builder.template; + this.version = builder.version; + + } + + public static PutIndexTemplateRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Optional user metadata about the index template. May have any contents. This + * map is not automatically generated by Elasticsearch. + *

+ * API name: {@code _meta} + */ + public final Map meta() { + return this.meta; + } + + /** + * An ordered list of component template names. Component templates are merged + * in the order specified, meaning that the last component template specified + * has the highest precedence. + *

+ * API name: {@code composed_of} + */ + public final List composedOf() { + return this.composedOf; + } + + /** + * If true, this request cannot replace or update existing index + * templates. + *

+ * API name: {@code create} + */ + @Nullable + public final Boolean create() { + return this.create; + } + + /** + * If this object is included, the template is used to create data streams and + * their backing indices. Supports an empty object. Data streams require a + * matching index template with a data_stream object. + *

+ * API name: {@code data_stream} + */ + @Nullable + public final DataStreamVisibility dataStream() { + return this.dataStream; + } + + /** + * Name of the index template to create. + *

+ * API name: {@code index_patterns} + */ + public final List indexPatterns() { + return this.indexPatterns; + } + + /** + * Required - Index or template name + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * Priority to determine index template precedence when a new data stream or + * index is created. The index template with the highest priority is chosen. If + * no priority is specified the template is treated as though it is of priority + * 0 (lowest priority). This number is not automatically generated by + * Elasticsearch. + *

+ * API name: {@code priority} + */ + @Nullable + public final Integer priority() { + return this.priority; + } + + /** + * Template to be applied. It may optionally include an aliases, + * mappings, or settings configuration. + *

+ * API name: {@code template} + */ + @Nullable + public final IndexTemplateMapping template() { + return this.template; + } + + /** + * Version number used to manage index templates externally. This number is not + * automatically generated by Elasticsearch. + *

+ * API name: {@code version} + */ + @Nullable + public final Long version() { + return this.version; + } + + /** + * 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.meta)) { + generator.writeKey("_meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.composedOf)) { + generator.writeKey("composed_of"); + generator.writeStartArray(); + for (String item0 : this.composedOf) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.dataStream != null) { + generator.writeKey("data_stream"); + this.dataStream.serialize(generator, mapper); + + } + if (ApiTypeHelper.isDefined(this.indexPatterns)) { + generator.writeKey("index_patterns"); + generator.writeStartArray(); + for (String item0 : this.indexPatterns) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.priority != null) { + generator.writeKey("priority"); + generator.write(this.priority); + + } + if (this.template != null) { + generator.writeKey("template"); + this.template.serialize(generator, mapper); + + } + if (this.version != null) { + generator.writeKey("version"); + generator.write(this.version); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutIndexTemplateRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Map meta; + + @Nullable + private List composedOf; + + @Nullable + private Boolean create; + + @Nullable + private DataStreamVisibility dataStream; + + @Nullable + private List indexPatterns; + + private String name; + + @Nullable + private Integer priority; + + @Nullable + private IndexTemplateMapping template; + + @Nullable + private Long version; + + /** + * Optional user metadata about the index template. May have any contents. This + * map is not automatically generated by Elasticsearch. + *

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

+ * Adds all entries of map to meta. + */ + public final Builder meta(Map map) { + this.meta = _mapPutAll(this.meta, map); + return this; + } + + /** + * Optional user metadata about the index template. May have any contents. This + * map is not automatically generated by Elasticsearch. + *

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

+ * Adds an entry to meta. + */ + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); + return this; + } + + /** + * An ordered list of component template names. Component templates are merged + * in the order specified, meaning that the last component template specified + * has the highest precedence. + *

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

+ * Adds all elements of list to composedOf. + */ + public final Builder composedOf(List list) { + this.composedOf = _listAddAll(this.composedOf, list); + return this; + } + + /** + * An ordered list of component template names. Component templates are merged + * in the order specified, meaning that the last component template specified + * has the highest precedence. + *

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

+ * Adds one or more values to composedOf. + */ + public final Builder composedOf(String value, String... values) { + this.composedOf = _listAdd(this.composedOf, value, values); + return this; + } + + /** + * If true, this request cannot replace or update existing index + * templates. + *

+ * API name: {@code create} + */ + public final Builder create(@Nullable Boolean value) { + this.create = value; + return this; + } + + /** + * If this object is included, the template is used to create data streams and + * their backing indices. Supports an empty object. Data streams require a + * matching index template with a data_stream object. + *

+ * API name: {@code data_stream} + */ + public final Builder dataStream(@Nullable DataStreamVisibility value) { + this.dataStream = value; + return this; + } + + /** + * If this object is included, the template is used to create data streams and + * their backing indices. Supports an empty object. Data streams require a + * matching index template with a data_stream object. + *

+ * API name: {@code data_stream} + */ + public final Builder dataStream( + Function> fn) { + return this.dataStream(fn.apply(new DataStreamVisibility.Builder()).build()); + } + + /** + * Name of the index template to create. + *

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

+ * Adds all elements of list to indexPatterns. + */ + public final Builder indexPatterns(List list) { + this.indexPatterns = _listAddAll(this.indexPatterns, list); + return this; + } + + /** + * Name of the index template to create. + *

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

+ * Adds one or more values to indexPatterns. + */ + public final Builder indexPatterns(String value, String... values) { + this.indexPatterns = _listAdd(this.indexPatterns, value, values); + return this; + } + + /** + * Required - Index or template name + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Priority to determine index template precedence when a new data stream or + * index is created. The index template with the highest priority is chosen. If + * no priority is specified the template is treated as though it is of priority + * 0 (lowest priority). This number is not automatically generated by + * Elasticsearch. + *

+ * API name: {@code priority} + */ + public final Builder priority(@Nullable Integer value) { + this.priority = value; + return this; + } + + /** + * Template to be applied. It may optionally include an aliases, + * mappings, or settings configuration. + *

+ * API name: {@code template} + */ + public final Builder template(@Nullable IndexTemplateMapping value) { + this.template = value; + return this; + } + + /** + * Template to be applied. It may optionally include an aliases, + * mappings, or settings configuration. + *

+ * API name: {@code template} + */ + public final Builder template(Function> fn) { + return this.template(fn.apply(new IndexTemplateMapping.Builder()).build()); + } + + /** + * Version number used to manage index templates externally. This number is not + * automatically generated by Elasticsearch. + *

+ * API name: {@code version} + */ + public final Builder version(@Nullable Long value) { + this.version = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutIndexTemplateRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutIndexTemplateRequest build() { + _checkSingleUse(); + + return new PutIndexTemplateRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutIndexTemplateRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, PutIndexTemplateRequest::setupPutIndexTemplateRequestDeserializer); + + protected static void setupPutIndexTemplateRequestDeserializer( + ObjectDeserializer op) { + + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); + op.add(Builder::composedOf, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "composed_of"); + op.add(Builder::dataStream, DataStreamVisibility._DESERIALIZER, "data_stream"); + op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "index_patterns"); + op.add(Builder::priority, JsonpDeserializer.integerDeserializer(), "priority"); + op.add(Builder::template, IndexTemplateMapping._DESERIALIZER, "template"); + op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.put_index_template}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.put_index_template", + + // Request method + request -> { + return "PUT"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_index_template"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.create != null) { + params.put("create", String.valueOf(request.create)); + } + return params; + + }, SimpleEndpoint.emptyMap(), true, PutIndexTemplateResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateResponse.java new file mode 100644 index 000000000..5e1c7cc62 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndexTemplateResponse.java @@ -0,0 +1,98 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.put_index_template.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutIndexTemplateResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private PutIndexTemplateResponse(Builder builder) { + super(builder); + + } + + public static PutIndexTemplateResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutIndexTemplateResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutIndexTemplateResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutIndexTemplateResponse build() { + _checkSingleUse(); + + return new PutIndexTemplateResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutIndexTemplateResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, PutIndexTemplateResponse::setupPutIndexTemplateResponseDeserializer); + + protected static void setupPutIndexTemplateResponseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndicesSettingsRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndicesSettingsRequest.java new file mode 100644 index 000000000..adf2e5d0e --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndicesSettingsRequest.java @@ -0,0 +1,527 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +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.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +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 jakarta.json.stream.JsonParser; +import java.lang.Boolean; +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; + +// typedef: indices.put_settings.Request + +/** + * Changes a dynamic index setting in real time. For data streams, index setting + * changes are applied to all backing indices by default. + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutIndicesSettingsRequest extends RequestBase implements JsonpSerializable { + @Nullable + private final Boolean allowNoIndices; + + private final List expandWildcards; + + @Nullable + private final Boolean flatSettings; + + @Nullable + private final Boolean ignoreUnavailable; + + private final List index; + + @Nullable + private final Time masterTimeout; + + @Nullable + private final Boolean preserveExisting; + + @Nullable + private final Time timeout; + + private final IndexSettings settings; + + // --------------------------------------------------------------------------------------------- + + private PutIndicesSettingsRequest(Builder builder) { + + this.allowNoIndices = builder.allowNoIndices; + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.flatSettings = builder.flatSettings; + this.ignoreUnavailable = builder.ignoreUnavailable; + this.index = ApiTypeHelper.unmodifiable(builder.index); + this.masterTimeout = builder.masterTimeout; + this.preserveExisting = builder.preserveExisting; + this.timeout = builder.timeout; + this.settings = ApiTypeHelper.requireNonNull(builder.settings, this, "settings"); + + } + + public static PutIndicesSettingsRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. For example, a request targeting foo*,bar* returns an + * error if an index starts with foo but no index starts with + * bar. + *

+ * API name: {@code allow_no_indices} + */ + @Nullable + public final Boolean allowNoIndices() { + return this.allowNoIndices; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code flat_settings} + */ + @Nullable + public final Boolean flatSettings() { + return this.flatSettings; + } + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code ignore_unavailable} + */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + + /** + * Comma-separated list of data streams, indices, and aliases used to limit the + * request. Supports wildcards (*). To target all data streams and + * indices, omit this parameter or use * or _all. + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * 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; + } + + /** + * If true, existing index settings remain unchanged. + *

+ * API name: {@code preserve_existing} + */ + @Nullable + public final Boolean preserveExisting() { + return this.preserveExisting; + } + + /** + * 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; + } + + /** + * Required - Request body. + */ + public final IndexSettings settings() { + return this.settings; + } + + /** + * Serialize this value to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + this.settings.serialize(generator, mapper); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutIndicesSettingsRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean allowNoIndices; + + @Nullable + private List expandWildcards; + + @Nullable + private Boolean flatSettings; + + @Nullable + private Boolean ignoreUnavailable; + + @Nullable + private List index; + + @Nullable + private Time masterTimeout; + + @Nullable + private Boolean preserveExisting; + + @Nullable + private Time timeout; + + private IndexSettings settings; + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. For example, a request targeting foo*,bar* returns an + * error if an index starts with foo but no index starts with + * bar. + *

+ * API name: {@code allow_no_indices} + */ + public final Builder allowNoIndices(@Nullable Boolean value) { + this.allowNoIndices = value; + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code flat_settings} + */ + public final Builder flatSettings(@Nullable Boolean value) { + this.flatSettings = value; + return this; + } + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code ignore_unavailable} + */ + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + + /** + * Comma-separated list of data streams, indices, and aliases used to limit the + * request. Supports wildcards (*). To target all data streams and + * indices, omit this parameter or use * or _all. + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Comma-separated list of data streams, indices, and aliases used to limit the + * request. Supports wildcards (*). To target all data streams and + * indices, omit this parameter or use * or _all. + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, 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()); + } + + /** + * If true, existing index settings remain unchanged. + *

+ * API name: {@code preserve_existing} + */ + public final Builder preserveExisting(@Nullable Boolean value) { + this.preserveExisting = 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(@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()); + } + + /** + * Required - Request body. + */ + public final Builder settings(IndexSettings value) { + this.settings = value; + return this; + } + + /** + * Required - Request body. + */ + public final Builder settings(Function> fn) { + return this.settings(fn.apply(new IndexSettings.Builder()).build()); + } + + @Override + public Builder withJson(JsonParser parser, JsonpMapper mapper) { + + @SuppressWarnings("unchecked") + IndexSettings value = (IndexSettings) IndexSettings._DESERIALIZER.deserialize(parser, mapper); + return this.settings(value); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutIndicesSettingsRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutIndicesSettingsRequest build() { + _checkSingleUse(); + + return new PutIndicesSettingsRequest(this); + } + } + + public static final JsonpDeserializer _DESERIALIZER = createPutIndicesSettingsRequestDeserializer(); + protected static JsonpDeserializer createPutIndicesSettingsRequestDeserializer() { + + JsonpDeserializer valueDeserializer = IndexSettings._DESERIALIZER; + + return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() + .settings(valueDeserializer.deserialize(parser, mapper, event)).build()); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.put_settings}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.put_settings", + + // Request method + request -> { + return "PUT"; + + }, + + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.index())) + propsSet |= _index; + + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_settings"); + return buf.toString(); + } + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_settings"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _index = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.index())) + propsSet |= _index; + + if (propsSet == 0) { + } + if (propsSet == (_index)) { + params.put("index", request.index.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.flatSettings != null) { + params.put("flat_settings", String.valueOf(request.flatSettings)); + } + if (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); + } + if (request.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); + } + if (request.preserveExisting != null) { + params.put("preserve_existing", String.valueOf(request.preserveExisting)); + } + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), true, PutIndicesSettingsResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndicesSettingsResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndicesSettingsResponse.java new file mode 100644 index 000000000..8a4bbbc23 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutIndicesSettingsResponse.java @@ -0,0 +1,97 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.put_settings.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutIndicesSettingsResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private PutIndicesSettingsResponse(Builder builder) { + super(builder); + + } + + public static PutIndicesSettingsResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutIndicesSettingsResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutIndicesSettingsResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutIndicesSettingsResponse build() { + _checkSingleUse(); + + return new PutIndicesSettingsResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutIndicesSettingsResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, PutIndicesSettingsResponse::setupPutIndicesSettingsResponseDeserializer); + + protected static void setupPutIndicesSettingsResponseDeserializer( + ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutMappingRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutMappingRequest.java new file mode 100644 index 000000000..de3f08a08 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutMappingRequest.java @@ -0,0 +1,1018 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.elasticsearch._types.mapping.DynamicMapping; +import co.elastic.clients.elasticsearch._types.mapping.DynamicTemplate; +import co.elastic.clients.elasticsearch._types.mapping.FieldNamesField; +import co.elastic.clients.elasticsearch._types.mapping.Property; +import co.elastic.clients.elasticsearch._types.mapping.RoutingField; +import co.elastic.clients.elasticsearch._types.mapping.RuntimeField; +import co.elastic.clients.elasticsearch._types.mapping.SourceField; +import co.elastic.clients.json.JsonData; +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.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.Boolean; +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; + +// typedef: indices.put_mapping.Request + +/** + * Adds new fields to an existing data stream or index. You can also use this + * API to change the search settings of existing fields. For data streams, these + * changes are applied to all backing indices by default. + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutMappingRequest extends RequestBase implements JsonpSerializable { + @Nullable + private final FieldNamesField fieldNames; + + private final Map meta; + + @Nullable + private final RoutingField routing; + + @Nullable + private final SourceField source; + + @Nullable + private final Boolean allowNoIndices; + + @Nullable + private final Boolean dateDetection; + + @Nullable + private final DynamicMapping dynamic; + + private final List dynamicDateFormats; + + private final List> dynamicTemplates; + + private final List expandWildcards; + + @Nullable + private final Boolean ignoreUnavailable; + + private final List index; + + @Nullable + private final Time masterTimeout; + + @Nullable + private final Boolean numericDetection; + + private final Map properties; + + private final Map runtime; + + @Nullable + private final Time timeout; + + @Nullable + private final Boolean writeIndexOnly; + + // --------------------------------------------------------------------------------------------- + + private PutMappingRequest(Builder builder) { + + this.fieldNames = builder.fieldNames; + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.routing = builder.routing; + this.source = builder.source; + this.allowNoIndices = builder.allowNoIndices; + this.dateDetection = builder.dateDetection; + this.dynamic = builder.dynamic; + this.dynamicDateFormats = ApiTypeHelper.unmodifiable(builder.dynamicDateFormats); + this.dynamicTemplates = ApiTypeHelper.unmodifiable(builder.dynamicTemplates); + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.ignoreUnavailable = builder.ignoreUnavailable; + this.index = ApiTypeHelper.unmodifiableRequired(builder.index, this, "index"); + this.masterTimeout = builder.masterTimeout; + this.numericDetection = builder.numericDetection; + this.properties = ApiTypeHelper.unmodifiable(builder.properties); + this.runtime = ApiTypeHelper.unmodifiable(builder.runtime); + this.timeout = builder.timeout; + this.writeIndexOnly = builder.writeIndexOnly; + + } + + public static PutMappingRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Control whether field names are enabled for the index. + *

+ * API name: {@code _field_names} + */ + @Nullable + public final FieldNamesField fieldNames() { + return this.fieldNames; + } + + /** + * A mapping type can have custom meta data associated with it. These are not + * used at all by Elasticsearch, but can be used to store application-specific + * metadata. + *

+ * API name: {@code _meta} + */ + public final Map meta() { + return this.meta; + } + + /** + * Enable making a routing value required on indexed documents. + *

+ * API name: {@code _routing} + */ + @Nullable + public final RoutingField routing() { + return this.routing; + } + + /** + * Control whether the _source field is enabled on the index. + *

+ * API name: {@code _source} + */ + @Nullable + public final SourceField source() { + return this.source; + } + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. + *

+ * API name: {@code allow_no_indices} + */ + @Nullable + public final Boolean allowNoIndices() { + return this.allowNoIndices; + } + + /** + * Controls whether dynamic date detection is enabled. + *

+ * API name: {@code date_detection} + */ + @Nullable + public final Boolean dateDetection() { + return this.dateDetection; + } + + /** + * Controls whether new fields are added dynamically. + *

+ * API name: {@code dynamic} + */ + @Nullable + public final DynamicMapping dynamic() { + return this.dynamic; + } + + /** + * If date detection is enabled then new string fields are checked against + * 'dynamic_date_formats' and if the value matches then a new date field is + * added instead of string. + *

+ * API name: {@code dynamic_date_formats} + */ + public final List dynamicDateFormats() { + return this.dynamicDateFormats; + } + + /** + * Specify dynamic templates for the mapping. + *

+ * API name: {@code dynamic_templates} + */ + public final List> dynamicTemplates() { + return this.dynamicTemplates; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * If false, the request returns an error if it targets a missing + * or closed index. + *

+ * API name: {@code ignore_unavailable} + */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + + /** + * Required - A comma-separated list of index names the mapping should be added + * to (supports wildcards); use _all or omit to add the mapping on + * all indices. + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * 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; + } + + /** + * Automatically map strings into numeric data types for all fields. + *

+ * API name: {@code numeric_detection} + */ + @Nullable + public final Boolean numericDetection() { + return this.numericDetection; + } + + /** + * Mapping for a field. For new fields, this mapping can include: + *

    + *
  • Field name
  • + *
  • Field data type
  • + *
  • Mapping parameters
  • + *
+ *

+ * API name: {@code properties} + */ + public final Map properties() { + return this.properties; + } + + /** + * Mapping of runtime fields for the index. + *

+ * API name: {@code runtime} + */ + public final Map runtime() { + return this.runtime; + } + + /** + * 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; + } + + /** + * If true, the mappings are applied only to the current write + * index for the target. + *

+ * API name: {@code write_index_only} + */ + @Nullable + public final Boolean writeIndexOnly() { + return this.writeIndexOnly; + } + + /** + * 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 (this.fieldNames != null) { + generator.writeKey("_field_names"); + this.fieldNames.serialize(generator, mapper); + + } + if (ApiTypeHelper.isDefined(this.meta)) { + generator.writeKey("_meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.routing != null) { + generator.writeKey("_routing"); + this.routing.serialize(generator, mapper); + + } + if (this.source != null) { + generator.writeKey("_source"); + this.source.serialize(generator, mapper); + + } + if (this.dateDetection != null) { + generator.writeKey("date_detection"); + generator.write(this.dateDetection); + + } + if (this.dynamic != null) { + generator.writeKey("dynamic"); + this.dynamic.serialize(generator, mapper); + } + if (ApiTypeHelper.isDefined(this.dynamicDateFormats)) { + generator.writeKey("dynamic_date_formats"); + generator.writeStartArray(); + for (String item0 : this.dynamicDateFormats) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.dynamicTemplates)) { + generator.writeKey("dynamic_templates"); + generator.writeStartArray(); + for (Map item0 : this.dynamicTemplates) { + generator.writeStartObject(); + if (item0 != null) { + for (Map.Entry item1 : item0.entrySet()) { + generator.writeKey(item1.getKey()); + item1.getValue().serialize(generator, mapper); + + } + } + generator.writeEnd(); + + } + generator.writeEnd(); + + } + if (this.numericDetection != null) { + generator.writeKey("numeric_detection"); + generator.write(this.numericDetection); + + } + if (ApiTypeHelper.isDefined(this.properties)) { + generator.writeKey("properties"); + generator.writeStartObject(); + for (Map.Entry item0 : this.properties.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.runtime)) { + generator.writeKey("runtime"); + generator.writeStartObject(); + for (Map.Entry item0 : this.runtime.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutMappingRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private FieldNamesField fieldNames; + + @Nullable + private Map meta; + + @Nullable + private RoutingField routing; + + @Nullable + private SourceField source; + + @Nullable + private Boolean allowNoIndices; + + @Nullable + private Boolean dateDetection; + + @Nullable + private DynamicMapping dynamic; + + @Nullable + private List dynamicDateFormats; + + @Nullable + private List> dynamicTemplates; + + @Nullable + private List expandWildcards; + + @Nullable + private Boolean ignoreUnavailable; + + private List index; + + @Nullable + private Time masterTimeout; + + @Nullable + private Boolean numericDetection; + + @Nullable + private Map properties; + + @Nullable + private Map runtime; + + @Nullable + private Time timeout; + + @Nullable + private Boolean writeIndexOnly; + + /** + * Control whether field names are enabled for the index. + *

+ * API name: {@code _field_names} + */ + public final Builder fieldNames(@Nullable FieldNamesField value) { + this.fieldNames = value; + return this; + } + + /** + * Control whether field names are enabled for the index. + *

+ * API name: {@code _field_names} + */ + public final Builder fieldNames(Function> fn) { + return this.fieldNames(fn.apply(new FieldNamesField.Builder()).build()); + } + + /** + * A mapping type can have custom meta data associated with it. These are not + * used at all by Elasticsearch, but can be used to store application-specific + * metadata. + *

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

+ * Adds all entries of map to meta. + */ + public final Builder meta(Map map) { + this.meta = _mapPutAll(this.meta, map); + return this; + } + + /** + * A mapping type can have custom meta data associated with it. These are not + * used at all by Elasticsearch, but can be used to store application-specific + * metadata. + *

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

+ * Adds an entry to meta. + */ + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); + return this; + } + + /** + * Enable making a routing value required on indexed documents. + *

+ * API name: {@code _routing} + */ + public final Builder routing(@Nullable RoutingField value) { + this.routing = value; + return this; + } + + /** + * Enable making a routing value required on indexed documents. + *

+ * API name: {@code _routing} + */ + public final Builder routing(Function> fn) { + return this.routing(fn.apply(new RoutingField.Builder()).build()); + } + + /** + * Control whether the _source field is enabled on the index. + *

+ * API name: {@code _source} + */ + public final Builder source(@Nullable SourceField value) { + this.source = value; + return this; + } + + /** + * Control whether the _source field is enabled on the index. + *

+ * API name: {@code _source} + */ + public final Builder source(Function> fn) { + return this.source(fn.apply(new SourceField.Builder()).build()); + } + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. + *

+ * API name: {@code allow_no_indices} + */ + public final Builder allowNoIndices(@Nullable Boolean value) { + this.allowNoIndices = value; + return this; + } + + /** + * Controls whether dynamic date detection is enabled. + *

+ * API name: {@code date_detection} + */ + public final Builder dateDetection(@Nullable Boolean value) { + this.dateDetection = value; + return this; + } + + /** + * Controls whether new fields are added dynamically. + *

+ * API name: {@code dynamic} + */ + public final Builder dynamic(@Nullable DynamicMapping value) { + this.dynamic = value; + return this; + } + + /** + * If date detection is enabled then new string fields are checked against + * 'dynamic_date_formats' and if the value matches then a new date field is + * added instead of string. + *

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

+ * Adds all elements of list to dynamicDateFormats. + */ + public final Builder dynamicDateFormats(List list) { + this.dynamicDateFormats = _listAddAll(this.dynamicDateFormats, list); + return this; + } + + /** + * If date detection is enabled then new string fields are checked against + * 'dynamic_date_formats' and if the value matches then a new date field is + * added instead of string. + *

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

+ * Adds one or more values to dynamicDateFormats. + */ + public final Builder dynamicDateFormats(String value, String... values) { + this.dynamicDateFormats = _listAdd(this.dynamicDateFormats, value, values); + return this; + } + + /** + * Specify dynamic templates for the mapping. + *

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

+ * Adds all elements of list to dynamicTemplates. + */ + public final Builder dynamicTemplates(List> list) { + this.dynamicTemplates = _listAddAll(this.dynamicTemplates, list); + return this; + } + + /** + * Specify dynamic templates for the mapping. + *

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

+ * Adds one or more values to dynamicTemplates. + */ + public final Builder dynamicTemplates(Map value, + Map... values) { + this.dynamicTemplates = _listAdd(this.dynamicTemplates, value, values); + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * If false, the request returns an error if it targets a missing + * or closed index. + *

+ * API name: {@code ignore_unavailable} + */ + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + + /** + * Required - A comma-separated list of index names the mapping should be added + * to (supports wildcards); use _all or omit to add the mapping on + * all indices. + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Required - A comma-separated list of index names the mapping should be added + * to (supports wildcards); use _all or omit to add the mapping on + * all indices. + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, 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()); + } + + /** + * Automatically map strings into numeric data types for all fields. + *

+ * API name: {@code numeric_detection} + */ + public final Builder numericDetection(@Nullable Boolean value) { + this.numericDetection = value; + return this; + } + + /** + * Mapping for a field. For new fields, this mapping can include: + *

    + *
  • Field name
  • + *
  • Field data type
  • + *
  • Mapping parameters
  • + *
+ *

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

+ * Adds all entries of map to properties. + */ + public final Builder properties(Map map) { + this.properties = _mapPutAll(this.properties, map); + return this; + } + + /** + * Mapping for a field. For new fields, this mapping can include: + *

    + *
  • Field name
  • + *
  • Field data type
  • + *
  • Mapping parameters
  • + *
+ *

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

+ * Adds an entry to properties. + */ + public final Builder properties(String key, Property value) { + this.properties = _mapPut(this.properties, key, value); + return this; + } + + /** + * Mapping for a field. For new fields, this mapping can include: + *

    + *
  • Field name
  • + *
  • Field data type
  • + *
  • Mapping parameters
  • + *
+ *

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

+ * Adds an entry to properties using a builder lambda. + */ + public final Builder properties(String key, Function> fn) { + return properties(key, fn.apply(new Property.Builder()).build()); + } + + /** + * Mapping of runtime fields for the index. + *

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

+ * Adds all entries of map to runtime. + */ + public final Builder runtime(Map map) { + this.runtime = _mapPutAll(this.runtime, map); + return this; + } + + /** + * Mapping of runtime fields for the index. + *

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

+ * Adds an entry to runtime. + */ + public final Builder runtime(String key, RuntimeField value) { + this.runtime = _mapPut(this.runtime, key, value); + return this; + } + + /** + * Mapping of runtime fields for the index. + *

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

+ * Adds an entry to runtime using a builder lambda. + */ + public final Builder runtime(String key, Function> fn) { + return runtime(key, fn.apply(new RuntimeField.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()); + } + + /** + * If true, the mappings are applied only to the current write + * index for the target. + *

+ * API name: {@code write_index_only} + */ + public final Builder writeIndexOnly(@Nullable Boolean value) { + this.writeIndexOnly = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutMappingRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutMappingRequest build() { + _checkSingleUse(); + + return new PutMappingRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutMappingRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, PutMappingRequest::setupPutMappingRequestDeserializer); + + protected static void setupPutMappingRequestDeserializer(ObjectDeserializer op) { + + op.add(Builder::fieldNames, FieldNamesField._DESERIALIZER, "_field_names"); + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); + op.add(Builder::routing, RoutingField._DESERIALIZER, "_routing"); + op.add(Builder::source, SourceField._DESERIALIZER, "_source"); + op.add(Builder::dateDetection, JsonpDeserializer.booleanDeserializer(), "date_detection"); + op.add(Builder::dynamic, DynamicMapping._DESERIALIZER, "dynamic"); + op.add(Builder::dynamicDateFormats, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "dynamic_date_formats"); + op.add(Builder::dynamicTemplates, JsonpDeserializer.arrayDeserializer( + JsonpDeserializer.stringMapDeserializer(DynamicTemplate._DESERIALIZER)), "dynamic_templates"); + op.add(Builder::numericDetection, JsonpDeserializer.booleanDeserializer(), "numeric_detection"); + op.add(Builder::properties, JsonpDeserializer.stringMapDeserializer(Property._DESERIALIZER), "properties"); + op.add(Builder::runtime, JsonpDeserializer.stringMapDeserializer(RuntimeField._DESERIALIZER), "runtime"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.put_mapping}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.put_mapping", + + // Request method + request -> { + return "PUT"; + + }, + + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_mapping"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _index = 1 << 0; + + int propsSet = 0; + + propsSet |= _index; + + if (propsSet == (_index)) { + params.put("index", request.index.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 (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); + } + if (request.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); + } + if (request.writeIndexOnly != null) { + params.put("write_index_only", String.valueOf(request.writeIndexOnly)); + } + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), true, PutMappingResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutMappingResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutMappingResponse.java new file mode 100644 index 000000000..3d93567a1 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutMappingResponse.java @@ -0,0 +1,96 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.IndicesResponseBase; +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; + +// typedef: indices.put_mapping.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutMappingResponse extends IndicesResponseBase { + // --------------------------------------------------------------------------------------------- + + private PutMappingResponse(Builder builder) { + super(builder); + + } + + public static PutMappingResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutMappingResponse}. + */ + + public static class Builder extends IndicesResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutMappingResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutMappingResponse build() { + _checkSingleUse(); + + return new PutMappingResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutMappingResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, PutMappingResponse::setupPutMappingResponseDeserializer); + + protected static void setupPutMappingResponseDeserializer(ObjectDeserializer op) { + IndicesResponseBase.setupIndicesResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateRequest.java new file mode 100644 index 000000000..281ea7a6d --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateRequest.java @@ -0,0 +1,636 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.elasticsearch._types.mapping.TypeMapping; +import co.elastic.clients.json.JsonData; +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.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.Boolean; +import java.lang.Integer; +import java.lang.Long; +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 javax.annotation.Nullable; + +// typedef: indices.put_template.Request + +/** + * Creates or updates an index template. Index templates define settings, + * mappings, and aliases that can be applied automatically to new indices. + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutTemplateRequest extends RequestBase implements JsonpSerializable { + private final Map aliases; + + @Nullable + private final Boolean create; + + @Nullable + private final Boolean flatSettings; + + private final List indexPatterns; + + @Nullable + private final TypeMapping mappings; + + @Nullable + private final Time masterTimeout; + + private final String name; + + @Nullable + private final Integer order; + + private final Map settings; + + @Nullable + private final Time timeout; + + @Nullable + private final Long version; + + // --------------------------------------------------------------------------------------------- + + private PutTemplateRequest(Builder builder) { + + this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); + this.create = builder.create; + this.flatSettings = builder.flatSettings; + this.indexPatterns = ApiTypeHelper.unmodifiable(builder.indexPatterns); + this.mappings = builder.mappings; + this.masterTimeout = builder.masterTimeout; + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.order = builder.order; + this.settings = ApiTypeHelper.unmodifiable(builder.settings); + this.timeout = builder.timeout; + this.version = builder.version; + + } + + public static PutTemplateRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Aliases for the index. + *

+ * API name: {@code aliases} + */ + public final Map aliases() { + return this.aliases; + } + + /** + * If true, this request cannot replace or update existing index templates. + *

+ * API name: {@code create} + */ + @Nullable + public final Boolean create() { + return this.create; + } + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code flat_settings} + */ + @Nullable + public final Boolean flatSettings() { + return this.flatSettings; + } + + /** + * Array of wildcard expressions used to match the names of indices during + * creation. + *

+ * API name: {@code index_patterns} + */ + public final List indexPatterns() { + return this.indexPatterns; + } + + /** + * Mapping for fields in the index. + *

+ * API name: {@code mappings} + */ + @Nullable + public final TypeMapping mappings() { + return this.mappings; + } + + /** + * 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; + } + + /** + * Required - The name of the template + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * Order in which Elasticsearch applies this template if index matches multiple + * templates. + *

+ * Templates with lower 'order' values are merged first. Templates with higher + * 'order' values are merged later, overriding templates with lower values. + *

+ * API name: {@code order} + */ + @Nullable + public final Integer order() { + return this.order; + } + + /** + * Configuration options for the index. + *

+ * API name: {@code settings} + */ + public final Map settings() { + return this.settings; + } + + /** + * 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; + } + + /** + * Version number used to manage index templates externally. This number is not + * automatically generated by Elasticsearch. + *

+ * API name: {@code version} + */ + @Nullable + public final Long version() { + return this.version; + } + + /** + * 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.aliases)) { + generator.writeKey("aliases"); + generator.writeStartObject(); + for (Map.Entry item0 : this.aliases.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.indexPatterns)) { + generator.writeKey("index_patterns"); + generator.writeStartArray(); + for (String item0 : this.indexPatterns) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.mappings != null) { + generator.writeKey("mappings"); + this.mappings.serialize(generator, mapper); + + } + if (this.order != null) { + generator.writeKey("order"); + generator.write(this.order); + + } + if (ApiTypeHelper.isDefined(this.settings)) { + generator.writeKey("settings"); + generator.writeStartObject(); + for (Map.Entry item0 : this.settings.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.version != null) { + generator.writeKey("version"); + generator.write(this.version); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutTemplateRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Map aliases; + + @Nullable + private Boolean create; + + @Nullable + private Boolean flatSettings; + + @Nullable + private List indexPatterns; + + @Nullable + private TypeMapping mappings; + + @Nullable + private Time masterTimeout; + + private String name; + + @Nullable + private Integer order; + + @Nullable + private Map settings; + + @Nullable + private Time timeout; + + @Nullable + private Long version; + + /** + * Aliases for the index. + *

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

+ * Adds all entries of map to aliases. + */ + public final Builder aliases(Map map) { + this.aliases = _mapPutAll(this.aliases, map); + return this; + } + + /** + * Aliases for the index. + *

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

+ * Adds an entry to aliases. + */ + public final Builder aliases(String key, Alias value) { + this.aliases = _mapPut(this.aliases, key, value); + return this; + } + + /** + * Aliases for the index. + *

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

+ * Adds an entry to aliases using a builder lambda. + */ + public final Builder aliases(String key, Function> fn) { + return aliases(key, fn.apply(new Alias.Builder()).build()); + } + + /** + * If true, this request cannot replace or update existing index templates. + *

+ * API name: {@code create} + */ + public final Builder create(@Nullable Boolean value) { + this.create = value; + return this; + } + + /** + * If true, returns settings in flat format. + *

+ * API name: {@code flat_settings} + */ + public final Builder flatSettings(@Nullable Boolean value) { + this.flatSettings = value; + return this; + } + + /** + * Array of wildcard expressions used to match the names of indices during + * creation. + *

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

+ * Adds all elements of list to indexPatterns. + */ + public final Builder indexPatterns(List list) { + this.indexPatterns = _listAddAll(this.indexPatterns, list); + return this; + } + + /** + * Array of wildcard expressions used to match the names of indices during + * creation. + *

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

+ * Adds one or more values to indexPatterns. + */ + public final Builder indexPatterns(String value, String... values) { + this.indexPatterns = _listAdd(this.indexPatterns, value, values); + return this; + } + + /** + * Mapping for fields in the index. + *

+ * API name: {@code mappings} + */ + public final Builder mappings(@Nullable TypeMapping value) { + this.mappings = value; + return this; + } + + /** + * Mapping for fields in the index. + *

+ * API name: {@code mappings} + */ + public final Builder mappings(Function> fn) { + return this.mappings(fn.apply(new TypeMapping.Builder()).build()); + } + + /** + * 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()); + } + + /** + * Required - The name of the template + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Order in which Elasticsearch applies this template if index matches multiple + * templates. + *

+ * Templates with lower 'order' values are merged first. Templates with higher + * 'order' values are merged later, overriding templates with lower values. + *

+ * API name: {@code order} + */ + public final Builder order(@Nullable Integer value) { + this.order = value; + return this; + } + + /** + * Configuration options for the index. + *

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

+ * Adds all entries of map to settings. + */ + public final Builder settings(Map map) { + this.settings = _mapPutAll(this.settings, map); + return this; + } + + /** + * Configuration options for the index. + *

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

+ * Adds an entry to settings. + */ + public final Builder settings(String key, JsonData value) { + this.settings = _mapPut(this.settings, key, 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(@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()); + } + + /** + * Version number used to manage index templates externally. This number is not + * automatically generated by Elasticsearch. + *

+ * API name: {@code version} + */ + public final Builder version(@Nullable Long value) { + this.version = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutTemplateRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutTemplateRequest build() { + _checkSingleUse(); + + return new PutTemplateRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutTemplateRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, PutTemplateRequest::setupPutTemplateRequestDeserializer); + + protected static void setupPutTemplateRequestDeserializer(ObjectDeserializer op) { + + op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(Alias._DESERIALIZER), "aliases"); + op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "index_patterns"); + op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); + op.add(Builder::order, JsonpDeserializer.integerDeserializer(), "order"); + op.add(Builder::settings, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "settings"); + op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.put_template}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.put_template", + + // Request method + request -> { + return "PUT"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_template"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } + if (request.flatSettings != null) { + params.put("flat_settings", String.valueOf(request.flatSettings)); + } + if (request.create != null) { + params.put("create", String.valueOf(request.create)); + } + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), true, PutTemplateResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateResponse.java new file mode 100644 index 000000000..bffddb145 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/PutTemplateResponse.java @@ -0,0 +1,96 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.put_template.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class PutTemplateResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private PutTemplateResponse(Builder builder) { + super(builder); + + } + + public static PutTemplateResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link PutTemplateResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link PutTemplateResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public PutTemplateResponse build() { + _checkSingleUse(); + + return new PutTemplateResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link PutTemplateResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, PutTemplateResponse::setupPutTemplateResponseDeserializer); + + protected static void setupPutTemplateResponseDeserializer(ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Queries.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Queries.java new file mode 100644 index 000000000..a2b0752d2 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Queries.java @@ -0,0 +1,153 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.Queries + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Queries implements JsonpSerializable { + @Nullable + private final CacheQueries cache; + + // --------------------------------------------------------------------------------------------- + + private Queries(Builder builder) { + + this.cache = builder.cache; + + } + + public static Queries of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code cache} + */ + @Nullable + public final CacheQueries cache() { + return this.cache; + } + + /** + * 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 (this.cache != null) { + generator.writeKey("cache"); + this.cache.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Queries}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private CacheQueries cache; + + /** + * API name: {@code cache} + */ + public final Builder cache(@Nullable CacheQueries value) { + this.cache = value; + return this; + } + + /** + * API name: {@code cache} + */ + public final Builder cache(Function> fn) { + return this.cache(fn.apply(new CacheQueries.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link Queries}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public Queries build() { + _checkSingleUse(); + + return new Queries(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Queries} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Queries::setupQueriesDeserializer); + + protected static void setupQueriesDeserializer(ObjectDeserializer op) { + + op.add(Builder::cache, CacheQueries._DESERIALIZER, "cache"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ResolveIndexRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ResolveIndexRequest.java new file mode 100644 index 000000000..02618e6b2 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ResolveIndexRequest.java @@ -0,0 +1,256 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +import co.elastic.clients.elasticsearch._types.RequestBase; +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; + +// typedef: indices.resolve_index.Request + +/** + * Resolves the specified name(s) and/or index patterns for indices, aliases, + * and data streams. Multiple patterns and remote clusters are supported. + * + * @see API + * specification + */ + +public class ResolveIndexRequest extends RequestBase { + private final List expandWildcards; + + private final List name; + + // --------------------------------------------------------------------------------------------- + + private ResolveIndexRequest(Builder builder) { + + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.name = ApiTypeHelper.unmodifiableRequired(builder.name, this, "name"); + + } + + public static ResolveIndexRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * Required - Comma-separated name(s) or index pattern(s) of the indices, + * aliases, and data streams to resolve. Resources on remote clusters can be + * specified using the <cluster>:<name> + * syntax. + *

+ * API name: {@code name} + */ + public final List name() { + return this.name; + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ResolveIndexRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private List expandWildcards; + + private List name; + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * Required - Comma-separated name(s) or index pattern(s) of the indices, + * aliases, and data streams to resolve. Resources on remote clusters can be + * specified using the <cluster>:<name> + * syntax. + *

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

+ * Adds all elements of list to name. + */ + public final Builder name(List list) { + this.name = _listAddAll(this.name, list); + return this; + } + + /** + * Required - Comma-separated name(s) or index pattern(s) of the indices, + * aliases, and data streams to resolve. Resources on remote clusters can be + * specified using the <cluster>:<name> + * syntax. + *

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

+ * Adds one or more values to name. + */ + public final Builder name(String value, String... values) { + this.name = _listAdd(this.name, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ResolveIndexRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ResolveIndexRequest build() { + _checkSingleUse(); + + return new ResolveIndexRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.resolve_index}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.resolve_index", + + // Request method + request -> { + return "GET"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_resolve"); + buf.append("/index"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name.stream().map(v -> v).collect(Collectors.joining(",")), buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name.stream().map(v -> v).collect(Collectors.joining(","))); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + return params; + + }, SimpleEndpoint.emptyMap(), false, ResolveIndexResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ResolveIndexResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ResolveIndexResponse.java new file mode 100644 index 000000000..6f92410af --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ResolveIndexResponse.java @@ -0,0 +1,282 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch.indices.resolve_index.ResolveIndexAliasItem; +import co.elastic.clients.elasticsearch.indices.resolve_index.ResolveIndexDataStreamsItem; +import co.elastic.clients.elasticsearch.indices.resolve_index.ResolveIndexItem; +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; + +// typedef: indices.resolve_index.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ResolveIndexResponse implements JsonpSerializable { + private final List indices; + + private final List aliases; + + private final List dataStreams; + + // --------------------------------------------------------------------------------------------- + + private ResolveIndexResponse(Builder builder) { + + this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); + this.aliases = ApiTypeHelper.unmodifiableRequired(builder.aliases, this, "aliases"); + this.dataStreams = ApiTypeHelper.unmodifiableRequired(builder.dataStreams, this, "dataStreams"); + + } + + public static ResolveIndexResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code indices} + */ + public final List indices() { + return this.indices; + } + + /** + * Required - API name: {@code aliases} + */ + public final List aliases() { + return this.aliases; + } + + /** + * Required - API name: {@code data_streams} + */ + public final List dataStreams() { + return this.dataStreams; + } + + /** + * 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.indices)) { + generator.writeKey("indices"); + generator.writeStartArray(); + for (ResolveIndexItem item0 : this.indices) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.aliases)) { + generator.writeKey("aliases"); + generator.writeStartArray(); + for (ResolveIndexAliasItem item0 : this.aliases) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.dataStreams)) { + generator.writeKey("data_streams"); + generator.writeStartArray(); + for (ResolveIndexDataStreamsItem item0 : this.dataStreams) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ResolveIndexResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private List indices; + + private List aliases; + + private List dataStreams; + + /** + * Required - API name: {@code indices} + *

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

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

+ * Adds a value to indices using a builder lambda. + */ + public final Builder indices(Function> fn) { + return indices(fn.apply(new ResolveIndexItem.Builder()).build()); + } + + /** + * Required - API name: {@code aliases} + *

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

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

+ * Adds a value to aliases using a builder lambda. + */ + public final Builder aliases(Function> fn) { + return aliases(fn.apply(new ResolveIndexAliasItem.Builder()).build()); + } + + /** + * Required - API name: {@code data_streams} + *

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

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

+ * Adds a value to dataStreams using a builder lambda. + */ + public final Builder dataStreams( + Function> fn) { + return dataStreams(fn.apply(new ResolveIndexDataStreamsItem.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ResolveIndexResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ResolveIndexResponse build() { + _checkSingleUse(); + + return new ResolveIndexResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ResolveIndexResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ResolveIndexResponse::setupResolveIndexResponseDeserializer); + + protected static void setupResolveIndexResponseDeserializer(ObjectDeserializer op) { + + op.add(Builder::indices, JsonpDeserializer.arrayDeserializer(ResolveIndexItem._DESERIALIZER), "indices"); + op.add(Builder::aliases, JsonpDeserializer.arrayDeserializer(ResolveIndexAliasItem._DESERIALIZER), "aliases"); + op.add(Builder::dataStreams, JsonpDeserializer.arrayDeserializer(ResolveIndexDataStreamsItem._DESERIALIZER), + "data_streams"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RetentionLease.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RetentionLease.java new file mode 100644 index 000000000..6a32f8a7b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RetentionLease.java @@ -0,0 +1,149 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.Time; +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.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.RetentionLease + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class RetentionLease implements JsonpSerializable { + private final Time period; + + // --------------------------------------------------------------------------------------------- + + private RetentionLease(Builder builder) { + + this.period = ApiTypeHelper.requireNonNull(builder.period, this, "period"); + + } + + public static RetentionLease of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code period} + */ + public final Time period() { + return this.period; + } + + /** + * 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("period"); + this.period.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link RetentionLease}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Time period; + + /** + * Required - API name: {@code period} + */ + public final Builder period(Time value) { + this.period = value; + return this; + } + + /** + * Required - API name: {@code period} + */ + public final Builder period(Function> fn) { + return this.period(fn.apply(new Time.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link RetentionLease}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public RetentionLease build() { + _checkSingleUse(); + + return new RetentionLease(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link RetentionLease} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + RetentionLease::setupRetentionLeaseDeserializer); + + protected static void setupRetentionLeaseDeserializer(ObjectDeserializer op) { + + op.add(Builder::period, Time._DESERIALIZER, "period"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverRequest.java new file mode 100644 index 000000000..ea5837c32 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverRequest.java @@ -0,0 +1,631 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.elasticsearch._types.WaitForActiveShards; +import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; +import co.elastic.clients.elasticsearch.indices.rollover.RolloverConditions; +import co.elastic.clients.json.JsonData; +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.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.Boolean; +import java.lang.String; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.rollover.Request + +/** + * Creates a new index for a data stream or index alias. + * + * @see API + * specification + */ +@JsonpDeserializable +public class RolloverRequest extends RequestBase implements JsonpSerializable { + private final String alias; + + private final Map aliases; + + @Nullable + private final RolloverConditions conditions; + + @Nullable + private final Boolean dryRun; + + @Nullable + private final TypeMapping mappings; + + @Nullable + private final Time masterTimeout; + + @Nullable + private final String newIndex; + + private final Map settings; + + @Nullable + private final Time timeout; + + @Nullable + private final WaitForActiveShards waitForActiveShards; + + // --------------------------------------------------------------------------------------------- + + private RolloverRequest(Builder builder) { + + this.alias = ApiTypeHelper.requireNonNull(builder.alias, this, "alias"); + this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); + this.conditions = builder.conditions; + this.dryRun = builder.dryRun; + this.mappings = builder.mappings; + this.masterTimeout = builder.masterTimeout; + this.newIndex = builder.newIndex; + this.settings = ApiTypeHelper.unmodifiable(builder.settings); + this.timeout = builder.timeout; + this.waitForActiveShards = builder.waitForActiveShards; + + } + + public static RolloverRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Name of the data stream or index alias to roll over. + *

+ * API name: {@code alias} + */ + public final String alias() { + return this.alias; + } + + /** + * Aliases for the target index. Data streams do not support this parameter. + *

+ * API name: {@code aliases} + */ + public final Map aliases() { + return this.aliases; + } + + /** + * Conditions for the rollover. If specified, Elasticsearch only performs the + * rollover if the current index satisfies these conditions. If this parameter + * is not specified, Elasticsearch performs the rollover unconditionally. If + * conditions are specified, at least one of them must be a max_* + * condition. The index will rollover if any max_* condition is + * satisfied and all min_* conditions are satisfied. + *

+ * API name: {@code conditions} + */ + @Nullable + public final RolloverConditions conditions() { + return this.conditions; + } + + /** + * If true, checks whether the current index satisfies the + * specified conditions but does not perform a rollover. + *

+ * API name: {@code dry_run} + */ + @Nullable + public final Boolean dryRun() { + return this.dryRun; + } + + /** + * Mapping for fields in the index. If specified, this mapping can include field + * names, field data types, and mapping paramaters. + *

+ * API name: {@code mappings} + */ + @Nullable + public final TypeMapping mappings() { + return this.mappings; + } + + /** + * 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; + } + + /** + * Name of the index to create. Supports date math. Data streams do not support + * this parameter. + *

+ * API name: {@code new_index} + */ + @Nullable + public final String newIndex() { + return this.newIndex; + } + + /** + * Configuration options for the index. Data streams do not support this + * parameter. + *

+ * API name: {@code settings} + */ + public final Map settings() { + return this.settings; + } + + /** + * 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; + } + + /** + * The number of shard copies that must be active before proceeding with the + * operation. Set to all or any positive integer up to the total number of + * shards in the index (number_of_replicas+1). + *

+ * API name: {@code wait_for_active_shards} + */ + @Nullable + public final WaitForActiveShards waitForActiveShards() { + return this.waitForActiveShards; + } + + /** + * 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.aliases)) { + generator.writeKey("aliases"); + generator.writeStartObject(); + for (Map.Entry item0 : this.aliases.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.conditions != null) { + generator.writeKey("conditions"); + this.conditions.serialize(generator, mapper); + + } + if (this.mappings != null) { + generator.writeKey("mappings"); + this.mappings.serialize(generator, mapper); + + } + if (ApiTypeHelper.isDefined(this.settings)) { + generator.writeKey("settings"); + generator.writeStartObject(); + for (Map.Entry item0 : this.settings.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link RolloverRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder implements ObjectBuilder { + private String alias; + + @Nullable + private Map aliases; + + @Nullable + private RolloverConditions conditions; + + @Nullable + private Boolean dryRun; + + @Nullable + private TypeMapping mappings; + + @Nullable + private Time masterTimeout; + + @Nullable + private String newIndex; + + @Nullable + private Map settings; + + @Nullable + private Time timeout; + + @Nullable + private WaitForActiveShards waitForActiveShards; + + /** + * Required - Name of the data stream or index alias to roll over. + *

+ * API name: {@code alias} + */ + public final Builder alias(String value) { + this.alias = value; + return this; + } + + /** + * Aliases for the target index. Data streams do not support this parameter. + *

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

+ * Adds all entries of map to aliases. + */ + public final Builder aliases(Map map) { + this.aliases = _mapPutAll(this.aliases, map); + return this; + } + + /** + * Aliases for the target index. Data streams do not support this parameter. + *

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

+ * Adds an entry to aliases. + */ + public final Builder aliases(String key, Alias value) { + this.aliases = _mapPut(this.aliases, key, value); + return this; + } + + /** + * Aliases for the target index. Data streams do not support this parameter. + *

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

+ * Adds an entry to aliases using a builder lambda. + */ + public final Builder aliases(String key, Function> fn) { + return aliases(key, fn.apply(new Alias.Builder()).build()); + } + + /** + * Conditions for the rollover. If specified, Elasticsearch only performs the + * rollover if the current index satisfies these conditions. If this parameter + * is not specified, Elasticsearch performs the rollover unconditionally. If + * conditions are specified, at least one of them must be a max_* + * condition. The index will rollover if any max_* condition is + * satisfied and all min_* conditions are satisfied. + *

+ * API name: {@code conditions} + */ + public final Builder conditions(@Nullable RolloverConditions value) { + this.conditions = value; + return this; + } + + /** + * Conditions for the rollover. If specified, Elasticsearch only performs the + * rollover if the current index satisfies these conditions. If this parameter + * is not specified, Elasticsearch performs the rollover unconditionally. If + * conditions are specified, at least one of them must be a max_* + * condition. The index will rollover if any max_* condition is + * satisfied and all min_* conditions are satisfied. + *

+ * API name: {@code conditions} + */ + public final Builder conditions(Function> fn) { + return this.conditions(fn.apply(new RolloverConditions.Builder()).build()); + } + + /** + * If true, checks whether the current index satisfies the + * specified conditions but does not perform a rollover. + *

+ * API name: {@code dry_run} + */ + public final Builder dryRun(@Nullable Boolean value) { + this.dryRun = value; + return this; + } + + /** + * Mapping for fields in the index. If specified, this mapping can include field + * names, field data types, and mapping paramaters. + *

+ * API name: {@code mappings} + */ + public final Builder mappings(@Nullable TypeMapping value) { + this.mappings = value; + return this; + } + + /** + * Mapping for fields in the index. If specified, this mapping can include field + * names, field data types, and mapping paramaters. + *

+ * API name: {@code mappings} + */ + public final Builder mappings(Function> fn) { + return this.mappings(fn.apply(new TypeMapping.Builder()).build()); + } + + /** + * 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()); + } + + /** + * Name of the index to create. Supports date math. Data streams do not support + * this parameter. + *

+ * API name: {@code new_index} + */ + public final Builder newIndex(@Nullable String value) { + this.newIndex = value; + return this; + } + + /** + * Configuration options for the index. Data streams do not support this + * parameter. + *

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

+ * Adds all entries of map to settings. + */ + public final Builder settings(Map map) { + this.settings = _mapPutAll(this.settings, map); + return this; + } + + /** + * Configuration options for the index. Data streams do not support this + * parameter. + *

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

+ * Adds an entry to settings. + */ + public final Builder settings(String key, JsonData value) { + this.settings = _mapPut(this.settings, key, 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(@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()); + } + + /** + * The number of shard copies that must be active before proceeding with the + * operation. Set to all or any positive integer up to the total number of + * shards in the index (number_of_replicas+1). + *

+ * API name: {@code wait_for_active_shards} + */ + public final Builder waitForActiveShards(@Nullable WaitForActiveShards value) { + this.waitForActiveShards = value; + return this; + } + + /** + * The number of shard copies that must be active before proceeding with the + * operation. Set to all or any positive integer up to the total number of + * shards in the index (number_of_replicas+1). + *

+ * API name: {@code wait_for_active_shards} + */ + public final Builder waitForActiveShards( + Function> fn) { + return this.waitForActiveShards(fn.apply(new WaitForActiveShards.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link RolloverRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public RolloverRequest build() { + _checkSingleUse(); + + return new RolloverRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link RolloverRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + RolloverRequest::setupRolloverRequestDeserializer); + + protected static void setupRolloverRequestDeserializer(ObjectDeserializer op) { + + op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(Alias._DESERIALIZER), "aliases"); + op.add(Builder::conditions, RolloverConditions._DESERIALIZER, "conditions"); + op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); + op.add(Builder::settings, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "settings"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.rollover}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.rollover", + + // Request method + request -> { + return "POST"; + + }, + + // Request path + request -> { + final int _newIndex = 1 << 0; + final int _alias = 1 << 1; + + int propsSet = 0; + + if (request.newIndex() != null) + propsSet |= _newIndex; + propsSet |= _alias; + + if (propsSet == (_alias)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.alias, buf); + buf.append("/_rollover"); + return buf.toString(); + } + if (propsSet == (_alias | _newIndex)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.alias, buf); + buf.append("/_rollover"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.newIndex, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _newIndex = 1 << 0; + final int _alias = 1 << 1; + + int propsSet = 0; + + if (request.newIndex() != null) + propsSet |= _newIndex; + propsSet |= _alias; + + if (propsSet == (_alias)) { + params.put("alias", request.alias); + } + if (propsSet == (_alias | _newIndex)) { + params.put("alias", request.alias); + params.put("newIndex", request.newIndex); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } + if (request.waitForActiveShards != null) { + params.put("wait_for_active_shards", request.waitForActiveShards._toJsonString()); + } + if (request.dryRun != null) { + params.put("dry_run", String.valueOf(request.dryRun)); + } + if (request.timeout != null) { + params.put("timeout", request.timeout._toJsonString()); + } + return params; + + }, SimpleEndpoint.emptyMap(), true, RolloverResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverResponse.java new file mode 100644 index 000000000..c9926974c --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/RolloverResponse.java @@ -0,0 +1,310 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.AcknowledgedResponse; +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.Boolean; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.rollover.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class RolloverResponse implements AcknowledgedResponse, JsonpSerializable { + private final boolean acknowledged; + + private final Map conditions; + + private final boolean dryRun; + + private final String newIndex; + + private final String oldIndex; + + private final boolean rolledOver; + + private final boolean shardsAcknowledged; + + // --------------------------------------------------------------------------------------------- + + private RolloverResponse(Builder builder) { + + this.acknowledged = ApiTypeHelper.requireNonNull(builder.acknowledged, this, "acknowledged"); + this.conditions = ApiTypeHelper.unmodifiableRequired(builder.conditions, this, "conditions"); + this.dryRun = ApiTypeHelper.requireNonNull(builder.dryRun, this, "dryRun"); + this.newIndex = ApiTypeHelper.requireNonNull(builder.newIndex, this, "newIndex"); + this.oldIndex = ApiTypeHelper.requireNonNull(builder.oldIndex, this, "oldIndex"); + this.rolledOver = ApiTypeHelper.requireNonNull(builder.rolledOver, this, "rolledOver"); + this.shardsAcknowledged = ApiTypeHelper.requireNonNull(builder.shardsAcknowledged, this, "shardsAcknowledged"); + + } + + public static RolloverResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code acknowledged} + */ + public final boolean acknowledged() { + return this.acknowledged; + } + + /** + * Required - API name: {@code conditions} + */ + public final Map conditions() { + return this.conditions; + } + + /** + * Required - API name: {@code dry_run} + */ + public final boolean dryRun() { + return this.dryRun; + } + + /** + * Required - API name: {@code new_index} + */ + public final String newIndex() { + return this.newIndex; + } + + /** + * Required - API name: {@code old_index} + */ + public final String oldIndex() { + return this.oldIndex; + } + + /** + * Required - API name: {@code rolled_over} + */ + public final boolean rolledOver() { + return this.rolledOver; + } + + /** + * Required - API name: {@code shards_acknowledged} + */ + public final boolean shardsAcknowledged() { + return this.shardsAcknowledged; + } + + /** + * 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("acknowledged"); + generator.write(this.acknowledged); + + if (ApiTypeHelper.isDefined(this.conditions)) { + generator.writeKey("conditions"); + generator.writeStartObject(); + for (Map.Entry item0 : this.conditions.entrySet()) { + generator.writeKey(item0.getKey()); + generator.write(item0.getValue()); + + } + generator.writeEnd(); + + } + generator.writeKey("dry_run"); + generator.write(this.dryRun); + + generator.writeKey("new_index"); + generator.write(this.newIndex); + + generator.writeKey("old_index"); + generator.write(this.oldIndex); + + generator.writeKey("rolled_over"); + generator.write(this.rolledOver); + + generator.writeKey("shards_acknowledged"); + generator.write(this.shardsAcknowledged); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link RolloverResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Boolean acknowledged; + + private Map conditions; + + private Boolean dryRun; + + private String newIndex; + + private String oldIndex; + + private Boolean rolledOver; + + private Boolean shardsAcknowledged; + + /** + * Required - API name: {@code acknowledged} + */ + public final Builder acknowledged(boolean value) { + this.acknowledged = value; + return this; + } + + /** + * Required - API name: {@code conditions} + *

+ * Adds all entries of map to conditions. + */ + public final Builder conditions(Map map) { + this.conditions = _mapPutAll(this.conditions, map); + return this; + } + + /** + * Required - API name: {@code conditions} + *

+ * Adds an entry to conditions. + */ + public final Builder conditions(String key, Boolean value) { + this.conditions = _mapPut(this.conditions, key, value); + return this; + } + + /** + * Required - API name: {@code dry_run} + */ + public final Builder dryRun(boolean value) { + this.dryRun = value; + return this; + } + + /** + * Required - API name: {@code new_index} + */ + public final Builder newIndex(String value) { + this.newIndex = value; + return this; + } + + /** + * Required - API name: {@code old_index} + */ + public final Builder oldIndex(String value) { + this.oldIndex = value; + return this; + } + + /** + * Required - API name: {@code rolled_over} + */ + public final Builder rolledOver(boolean value) { + this.rolledOver = value; + return this; + } + + /** + * Required - API name: {@code shards_acknowledged} + */ + public final Builder shardsAcknowledged(boolean value) { + this.shardsAcknowledged = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link RolloverResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public RolloverResponse build() { + _checkSingleUse(); + + return new RolloverResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link RolloverResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + RolloverResponse::setupRolloverResponseDeserializer); + + protected static void setupRolloverResponseDeserializer(ObjectDeserializer op) { + + op.add(Builder::acknowledged, JsonpDeserializer.booleanDeserializer(), "acknowledged"); + op.add(Builder::conditions, JsonpDeserializer.stringMapDeserializer(JsonpDeserializer.booleanDeserializer()), + "conditions"); + op.add(Builder::dryRun, JsonpDeserializer.booleanDeserializer(), "dry_run"); + op.add(Builder::newIndex, JsonpDeserializer.stringDeserializer(), "new_index"); + op.add(Builder::oldIndex, JsonpDeserializer.stringDeserializer(), "old_index"); + op.add(Builder::rolledOver, JsonpDeserializer.booleanDeserializer(), "rolled_over"); + op.add(Builder::shardsAcknowledged, JsonpDeserializer.booleanDeserializer(), "shards_acknowledged"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SearchIdle.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SearchIdle.java new file mode 100644 index 000000000..96a2fb150 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SearchIdle.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.Time; +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.SearchIdle + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SearchIdle implements JsonpSerializable { + @Nullable + private final Time after; + + // --------------------------------------------------------------------------------------------- + + private SearchIdle(Builder builder) { + + this.after = builder.after; + + } + + public static SearchIdle of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code after} + */ + @Nullable + public final Time after() { + return this.after; + } + + /** + * 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 (this.after != null) { + generator.writeKey("after"); + this.after.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SearchIdle}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Time after; + + /** + * API name: {@code after} + */ + public final Builder after(@Nullable Time value) { + this.after = value; + return this; + } + + /** + * API name: {@code after} + */ + public final Builder after(Function> fn) { + return this.after(fn.apply(new Time.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SearchIdle}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SearchIdle build() { + _checkSingleUse(); + + return new SearchIdle(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SearchIdle} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + SearchIdle::setupSearchIdleDeserializer); + + protected static void setupSearchIdleDeserializer(ObjectDeserializer op) { + + op.add(Builder::after, Time._DESERIALIZER, "after"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortMissing.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortMissing.java new file mode 100644 index 000000000..04f5c30ea --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortMissing.java @@ -0,0 +1,56 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum SegmentSortMissing implements JsonEnum { + Last("_last"), + + First("_first"), + + ; + + private final String jsonValue; + + SegmentSortMissing(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + SegmentSortMissing.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortMode.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortMode.java new file mode 100644 index 000000000..66e1f2ede --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortMode.java @@ -0,0 +1,61 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum SegmentSortMode implements JsonEnum { + Min("min", "MIN"), + + Max("max", "MAX"), + + ; + + private final String jsonValue; + private final String[] aliases; + + SegmentSortMode(String jsonValue, String... aliases) { + this.jsonValue = jsonValue; + this.aliases = aliases; + } + + public String jsonValue() { + return this.jsonValue; + } + + public String[] aliases() { + return this.aliases; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + SegmentSortMode.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortOrder.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortOrder.java new file mode 100644 index 000000000..d140c205b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SegmentSortOrder.java @@ -0,0 +1,61 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum SegmentSortOrder implements JsonEnum { + Asc("asc", "ASC"), + + Desc("desc", "DESC"), + + ; + + private final String jsonValue; + private final String[] aliases; + + SegmentSortOrder(String jsonValue, String... aliases) { + this.jsonValue = jsonValue; + this.aliases = aliases; + } + + public String jsonValue() { + return this.jsonValue; + } + + public String[] aliases() { + return this.aliases; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + SegmentSortOrder.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsAnalyze.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsAnalyze.java new file mode 100644 index 000000000..bf5c279f7 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsAnalyze.java @@ -0,0 +1,147 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Integer; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.SettingsAnalyze + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SettingsAnalyze implements JsonpSerializable { + @Nullable + private final Integer maxTokenCount; + + // --------------------------------------------------------------------------------------------- + + private SettingsAnalyze(Builder builder) { + + this.maxTokenCount = builder.maxTokenCount; + + } + + public static SettingsAnalyze of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code max_token_count} + */ + @Nullable + public final Integer maxTokenCount() { + return this.maxTokenCount; + } + + /** + * 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 (this.maxTokenCount != null) { + generator.writeKey("max_token_count"); + generator.write(this.maxTokenCount); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SettingsAnalyze}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Integer maxTokenCount; + + /** + * API name: {@code max_token_count} + */ + public final Builder maxTokenCount(@Nullable Integer value) { + this.maxTokenCount = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SettingsAnalyze}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SettingsAnalyze build() { + _checkSingleUse(); + + return new SettingsAnalyze(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SettingsAnalyze} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + SettingsAnalyze::setupSettingsAnalyzeDeserializer); + + protected static void setupSettingsAnalyzeDeserializer(ObjectDeserializer op) { + + op.add(Builder::maxTokenCount, JsonpDeserializer.integerDeserializer(), "max_token_count"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsHighlight.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsHighlight.java new file mode 100644 index 000000000..ea4a0b236 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsHighlight.java @@ -0,0 +1,148 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Integer; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.SettingsHighlight + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SettingsHighlight implements JsonpSerializable { + @Nullable + private final Integer maxAnalyzedOffset; + + // --------------------------------------------------------------------------------------------- + + private SettingsHighlight(Builder builder) { + + this.maxAnalyzedOffset = builder.maxAnalyzedOffset; + + } + + public static SettingsHighlight of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code max_analyzed_offset} + */ + @Nullable + public final Integer maxAnalyzedOffset() { + return this.maxAnalyzedOffset; + } + + /** + * 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 (this.maxAnalyzedOffset != null) { + generator.writeKey("max_analyzed_offset"); + generator.write(this.maxAnalyzedOffset); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SettingsHighlight}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Integer maxAnalyzedOffset; + + /** + * API name: {@code max_analyzed_offset} + */ + public final Builder maxAnalyzedOffset(@Nullable Integer value) { + this.maxAnalyzedOffset = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SettingsHighlight}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SettingsHighlight build() { + _checkSingleUse(); + + return new SettingsHighlight(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SettingsHighlight} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SettingsHighlight::setupSettingsHighlightDeserializer); + + protected static void setupSettingsHighlightDeserializer(ObjectDeserializer op) { + + op.add(Builder::maxAnalyzedOffset, JsonpDeserializer.integerDeserializer(), "max_analyzed_offset"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsQueryString.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsQueryString.java new file mode 100644 index 000000000..6809169c3 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsQueryString.java @@ -0,0 +1,144 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.Boolean; +import java.util.Objects; +import java.util.function.Function; + +// typedef: indices._types.SettingsQueryString + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SettingsQueryString implements JsonpSerializable { + private final boolean lenient; + + // --------------------------------------------------------------------------------------------- + + private SettingsQueryString(Builder builder) { + + this.lenient = ApiTypeHelper.requireNonNull(builder.lenient, this, "lenient"); + + } + + public static SettingsQueryString of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code lenient} + */ + public final boolean lenient() { + return this.lenient; + } + + /** + * 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("lenient"); + generator.write(this.lenient); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SettingsQueryString}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Boolean lenient; + + /** + * Required - API name: {@code lenient} + */ + public final Builder lenient(boolean value) { + this.lenient = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SettingsQueryString}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SettingsQueryString build() { + _checkSingleUse(); + + return new SettingsQueryString(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SettingsQueryString} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SettingsQueryString::setupSettingsQueryStringDeserializer); + + protected static void setupSettingsQueryStringDeserializer(ObjectDeserializer op) { + + op.add(Builder::lenient, JsonpDeserializer.booleanDeserializer(), "lenient"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSearch.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSearch.java new file mode 100644 index 000000000..ab9651dc8 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSearch.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.SettingsSearch + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SettingsSearch implements JsonpSerializable { + @Nullable + private final SearchIdle idle; + + @Nullable + private final SlowlogSettings slowlog; + + // --------------------------------------------------------------------------------------------- + + private SettingsSearch(Builder builder) { + + this.idle = builder.idle; + this.slowlog = builder.slowlog; + + } + + public static SettingsSearch of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code idle} + */ + @Nullable + public final SearchIdle idle() { + return this.idle; + } + + /** + * API name: {@code slowlog} + */ + @Nullable + public final SlowlogSettings slowlog() { + return this.slowlog; + } + + /** + * 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 (this.idle != null) { + generator.writeKey("idle"); + this.idle.serialize(generator, mapper); + + } + if (this.slowlog != null) { + generator.writeKey("slowlog"); + this.slowlog.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SettingsSearch}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private SearchIdle idle; + + @Nullable + private SlowlogSettings slowlog; + + /** + * API name: {@code idle} + */ + public final Builder idle(@Nullable SearchIdle value) { + this.idle = value; + return this; + } + + /** + * API name: {@code idle} + */ + public final Builder idle(Function> fn) { + return this.idle(fn.apply(new SearchIdle.Builder()).build()); + } + + /** + * API name: {@code slowlog} + */ + public final Builder slowlog(@Nullable SlowlogSettings value) { + this.slowlog = value; + return this; + } + + /** + * API name: {@code slowlog} + */ + public final Builder slowlog(Function> fn) { + return this.slowlog(fn.apply(new SlowlogSettings.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SettingsSearch}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SettingsSearch build() { + _checkSingleUse(); + + return new SettingsSearch(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SettingsSearch} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + SettingsSearch::setupSettingsSearchDeserializer); + + protected static void setupSettingsSearchDeserializer(ObjectDeserializer op) { + + op.add(Builder::idle, SearchIdle._DESERIALIZER, "idle"); + op.add(Builder::slowlog, SlowlogSettings._DESERIALIZER, "slowlog"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarity.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarity.java new file mode 100644 index 000000000..52c7e9ef9 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarity.java @@ -0,0 +1,373 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.SettingsSimilarity + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SettingsSimilarity implements JsonpSerializable { + @Nullable + private final SettingsSimilarityBm25 bm25; + + @Nullable + private final SettingsSimilarityDfi dfi; + + @Nullable + private final SettingsSimilarityDfr dfr; + + @Nullable + private final SettingsSimilarityIb ib; + + @Nullable + private final SettingsSimilarityLmd lmd; + + @Nullable + private final SettingsSimilarityLmj lmj; + + @Nullable + private final SettingsSimilarityScriptedTfidf scriptedTfidf; + + // --------------------------------------------------------------------------------------------- + + private SettingsSimilarity(Builder builder) { + + this.bm25 = builder.bm25; + this.dfi = builder.dfi; + this.dfr = builder.dfr; + this.ib = builder.ib; + this.lmd = builder.lmd; + this.lmj = builder.lmj; + this.scriptedTfidf = builder.scriptedTfidf; + + } + + public static SettingsSimilarity of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code bm25} + */ + @Nullable + public final SettingsSimilarityBm25 bm25() { + return this.bm25; + } + + /** + * API name: {@code dfi} + */ + @Nullable + public final SettingsSimilarityDfi dfi() { + return this.dfi; + } + + /** + * API name: {@code dfr} + */ + @Nullable + public final SettingsSimilarityDfr dfr() { + return this.dfr; + } + + /** + * API name: {@code ib} + */ + @Nullable + public final SettingsSimilarityIb ib() { + return this.ib; + } + + /** + * API name: {@code lmd} + */ + @Nullable + public final SettingsSimilarityLmd lmd() { + return this.lmd; + } + + /** + * API name: {@code lmj} + */ + @Nullable + public final SettingsSimilarityLmj lmj() { + return this.lmj; + } + + /** + * API name: {@code scripted_tfidf} + */ + @Nullable + public final SettingsSimilarityScriptedTfidf scriptedTfidf() { + return this.scriptedTfidf; + } + + /** + * 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 (this.bm25 != null) { + generator.writeKey("bm25"); + this.bm25.serialize(generator, mapper); + + } + if (this.dfi != null) { + generator.writeKey("dfi"); + this.dfi.serialize(generator, mapper); + + } + if (this.dfr != null) { + generator.writeKey("dfr"); + this.dfr.serialize(generator, mapper); + + } + if (this.ib != null) { + generator.writeKey("ib"); + this.ib.serialize(generator, mapper); + + } + if (this.lmd != null) { + generator.writeKey("lmd"); + this.lmd.serialize(generator, mapper); + + } + if (this.lmj != null) { + generator.writeKey("lmj"); + this.lmj.serialize(generator, mapper); + + } + if (this.scriptedTfidf != null) { + generator.writeKey("scripted_tfidf"); + this.scriptedTfidf.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SettingsSimilarity}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private SettingsSimilarityBm25 bm25; + + @Nullable + private SettingsSimilarityDfi dfi; + + @Nullable + private SettingsSimilarityDfr dfr; + + @Nullable + private SettingsSimilarityIb ib; + + @Nullable + private SettingsSimilarityLmd lmd; + + @Nullable + private SettingsSimilarityLmj lmj; + + @Nullable + private SettingsSimilarityScriptedTfidf scriptedTfidf; + + /** + * API name: {@code bm25} + */ + public final Builder bm25(@Nullable SettingsSimilarityBm25 value) { + this.bm25 = value; + return this; + } + + /** + * API name: {@code bm25} + */ + public final Builder bm25(Function> fn) { + return this.bm25(fn.apply(new SettingsSimilarityBm25.Builder()).build()); + } + + /** + * API name: {@code dfi} + */ + public final Builder dfi(@Nullable SettingsSimilarityDfi value) { + this.dfi = value; + return this; + } + + /** + * API name: {@code dfi} + */ + public final Builder dfi(Function> fn) { + return this.dfi(fn.apply(new SettingsSimilarityDfi.Builder()).build()); + } + + /** + * API name: {@code dfr} + */ + public final Builder dfr(@Nullable SettingsSimilarityDfr value) { + this.dfr = value; + return this; + } + + /** + * API name: {@code dfr} + */ + public final Builder dfr(Function> fn) { + return this.dfr(fn.apply(new SettingsSimilarityDfr.Builder()).build()); + } + + /** + * API name: {@code ib} + */ + public final Builder ib(@Nullable SettingsSimilarityIb value) { + this.ib = value; + return this; + } + + /** + * API name: {@code ib} + */ + public final Builder ib(Function> fn) { + return this.ib(fn.apply(new SettingsSimilarityIb.Builder()).build()); + } + + /** + * API name: {@code lmd} + */ + public final Builder lmd(@Nullable SettingsSimilarityLmd value) { + this.lmd = value; + return this; + } + + /** + * API name: {@code lmd} + */ + public final Builder lmd(Function> fn) { + return this.lmd(fn.apply(new SettingsSimilarityLmd.Builder()).build()); + } + + /** + * API name: {@code lmj} + */ + public final Builder lmj(@Nullable SettingsSimilarityLmj value) { + this.lmj = value; + return this; + } + + /** + * API name: {@code lmj} + */ + public final Builder lmj(Function> fn) { + return this.lmj(fn.apply(new SettingsSimilarityLmj.Builder()).build()); + } + + /** + * API name: {@code scripted_tfidf} + */ + public final Builder scriptedTfidf(@Nullable SettingsSimilarityScriptedTfidf value) { + this.scriptedTfidf = value; + return this; + } + + /** + * API name: {@code scripted_tfidf} + */ + public final Builder scriptedTfidf( + Function> fn) { + return this.scriptedTfidf(fn.apply(new SettingsSimilarityScriptedTfidf.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SettingsSimilarity}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SettingsSimilarity build() { + _checkSingleUse(); + + return new SettingsSimilarity(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SettingsSimilarity} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SettingsSimilarity::setupSettingsSimilarityDeserializer); + + protected static void setupSettingsSimilarityDeserializer(ObjectDeserializer op) { + + op.add(Builder::bm25, SettingsSimilarityBm25._DESERIALIZER, "bm25"); + op.add(Builder::dfi, SettingsSimilarityDfi._DESERIALIZER, "dfi"); + op.add(Builder::dfr, SettingsSimilarityDfr._DESERIALIZER, "dfr"); + op.add(Builder::ib, SettingsSimilarityIb._DESERIALIZER, "ib"); + op.add(Builder::lmd, SettingsSimilarityLmd._DESERIALIZER, "lmd"); + op.add(Builder::lmj, SettingsSimilarityLmj._DESERIALIZER, "lmj"); + op.add(Builder::scriptedTfidf, SettingsSimilarityScriptedTfidf._DESERIALIZER, "scripted_tfidf"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBm25.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBm25.java new file mode 100644 index 000000000..b585f302a --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityBm25.java @@ -0,0 +1,194 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.Boolean; +import java.lang.Double; +import java.util.Objects; +import java.util.function.Function; + +// typedef: indices._types.SettingsSimilarityBm25 + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SettingsSimilarityBm25 implements JsonpSerializable { + private final double b; + + private final boolean discountOverlaps; + + private final double k1; + + // --------------------------------------------------------------------------------------------- + + private SettingsSimilarityBm25(Builder builder) { + + this.b = ApiTypeHelper.requireNonNull(builder.b, this, "b"); + this.discountOverlaps = ApiTypeHelper.requireNonNull(builder.discountOverlaps, this, "discountOverlaps"); + this.k1 = ApiTypeHelper.requireNonNull(builder.k1, this, "k1"); + + } + + public static SettingsSimilarityBm25 of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code b} + */ + public final double b() { + return this.b; + } + + /** + * Required - API name: {@code discount_overlaps} + */ + public final boolean discountOverlaps() { + return this.discountOverlaps; + } + + /** + * Required - API name: {@code k1} + */ + public final double k1() { + return this.k1; + } + + /** + * 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("b"); + generator.write(this.b); + + generator.writeKey("discount_overlaps"); + generator.write(this.discountOverlaps); + + generator.writeKey("k1"); + generator.write(this.k1); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SettingsSimilarityBm25}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Double b; + + private Boolean discountOverlaps; + + private Double k1; + + /** + * Required - API name: {@code b} + */ + public final Builder b(double value) { + this.b = value; + return this; + } + + /** + * Required - API name: {@code discount_overlaps} + */ + public final Builder discountOverlaps(boolean value) { + this.discountOverlaps = value; + return this; + } + + /** + * Required - API name: {@code k1} + */ + public final Builder k1(double value) { + this.k1 = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SettingsSimilarityBm25}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SettingsSimilarityBm25 build() { + _checkSingleUse(); + + return new SettingsSimilarityBm25(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SettingsSimilarityBm25} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SettingsSimilarityBm25::setupSettingsSimilarityBm25Deserializer); + + protected static void setupSettingsSimilarityBm25Deserializer( + ObjectDeserializer op) { + + op.add(Builder::b, JsonpDeserializer.doubleDeserializer(), "b"); + op.add(Builder::discountOverlaps, JsonpDeserializer.booleanDeserializer(), "discount_overlaps"); + op.add(Builder::k1, JsonpDeserializer.doubleDeserializer(), "k1"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfi.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfi.java new file mode 100644 index 000000000..3c9367797 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfi.java @@ -0,0 +1,146 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.DFIIndependenceMeasure; +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.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.SettingsSimilarityDfi + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SettingsSimilarityDfi implements JsonpSerializable { + private final DFIIndependenceMeasure independenceMeasure; + + // --------------------------------------------------------------------------------------------- + + private SettingsSimilarityDfi(Builder builder) { + + this.independenceMeasure = ApiTypeHelper.requireNonNull(builder.independenceMeasure, this, + "independenceMeasure"); + + } + + public static SettingsSimilarityDfi of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code independence_measure} + */ + public final DFIIndependenceMeasure independenceMeasure() { + return this.independenceMeasure; + } + + /** + * 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("independence_measure"); + this.independenceMeasure.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SettingsSimilarityDfi}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private DFIIndependenceMeasure independenceMeasure; + + /** + * Required - API name: {@code independence_measure} + */ + public final Builder independenceMeasure(DFIIndependenceMeasure value) { + this.independenceMeasure = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SettingsSimilarityDfi}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SettingsSimilarityDfi build() { + _checkSingleUse(); + + return new SettingsSimilarityDfi(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SettingsSimilarityDfi} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SettingsSimilarityDfi::setupSettingsSimilarityDfiDeserializer); + + protected static void setupSettingsSimilarityDfiDeserializer(ObjectDeserializer op) { + + op.add(Builder::independenceMeasure, DFIIndependenceMeasure._DESERIALIZER, "independence_measure"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfr.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfr.java new file mode 100644 index 000000000..f853ca001 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityDfr.java @@ -0,0 +1,193 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.DFRAfterEffect; +import co.elastic.clients.elasticsearch._types.DFRBasicModel; +import co.elastic.clients.elasticsearch._types.Normalization; +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.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.SettingsSimilarityDfr + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SettingsSimilarityDfr implements JsonpSerializable { + private final DFRAfterEffect afterEffect; + + private final DFRBasicModel basicModel; + + private final Normalization normalization; + + // --------------------------------------------------------------------------------------------- + + private SettingsSimilarityDfr(Builder builder) { + + this.afterEffect = ApiTypeHelper.requireNonNull(builder.afterEffect, this, "afterEffect"); + this.basicModel = ApiTypeHelper.requireNonNull(builder.basicModel, this, "basicModel"); + this.normalization = ApiTypeHelper.requireNonNull(builder.normalization, this, "normalization"); + + } + + public static SettingsSimilarityDfr of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code after_effect} + */ + public final DFRAfterEffect afterEffect() { + return this.afterEffect; + } + + /** + * Required - API name: {@code basic_model} + */ + public final DFRBasicModel basicModel() { + return this.basicModel; + } + + /** + * Required - API name: {@code normalization} + */ + public final Normalization normalization() { + return this.normalization; + } + + /** + * 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("after_effect"); + this.afterEffect.serialize(generator, mapper); + generator.writeKey("basic_model"); + this.basicModel.serialize(generator, mapper); + generator.writeKey("normalization"); + this.normalization.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SettingsSimilarityDfr}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private DFRAfterEffect afterEffect; + + private DFRBasicModel basicModel; + + private Normalization normalization; + + /** + * Required - API name: {@code after_effect} + */ + public final Builder afterEffect(DFRAfterEffect value) { + this.afterEffect = value; + return this; + } + + /** + * Required - API name: {@code basic_model} + */ + public final Builder basicModel(DFRBasicModel value) { + this.basicModel = value; + return this; + } + + /** + * Required - API name: {@code normalization} + */ + public final Builder normalization(Normalization value) { + this.normalization = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SettingsSimilarityDfr}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SettingsSimilarityDfr build() { + _checkSingleUse(); + + return new SettingsSimilarityDfr(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SettingsSimilarityDfr} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SettingsSimilarityDfr::setupSettingsSimilarityDfrDeserializer); + + protected static void setupSettingsSimilarityDfrDeserializer(ObjectDeserializer op) { + + op.add(Builder::afterEffect, DFRAfterEffect._DESERIALIZER, "after_effect"); + op.add(Builder::basicModel, DFRBasicModel._DESERIALIZER, "basic_model"); + op.add(Builder::normalization, Normalization._DESERIALIZER, "normalization"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityIb.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityIb.java new file mode 100644 index 000000000..185bb5e3b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityIb.java @@ -0,0 +1,193 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.IBDistribution; +import co.elastic.clients.elasticsearch._types.IBLambda; +import co.elastic.clients.elasticsearch._types.Normalization; +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.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.SettingsSimilarityIb + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SettingsSimilarityIb implements JsonpSerializable { + private final IBDistribution distribution; + + private final IBLambda lambda; + + private final Normalization normalization; + + // --------------------------------------------------------------------------------------------- + + private SettingsSimilarityIb(Builder builder) { + + this.distribution = ApiTypeHelper.requireNonNull(builder.distribution, this, "distribution"); + this.lambda = ApiTypeHelper.requireNonNull(builder.lambda, this, "lambda"); + this.normalization = ApiTypeHelper.requireNonNull(builder.normalization, this, "normalization"); + + } + + public static SettingsSimilarityIb of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code distribution} + */ + public final IBDistribution distribution() { + return this.distribution; + } + + /** + * Required - API name: {@code lambda} + */ + public final IBLambda lambda() { + return this.lambda; + } + + /** + * Required - API name: {@code normalization} + */ + public final Normalization normalization() { + return this.normalization; + } + + /** + * 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("distribution"); + this.distribution.serialize(generator, mapper); + generator.writeKey("lambda"); + this.lambda.serialize(generator, mapper); + generator.writeKey("normalization"); + this.normalization.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SettingsSimilarityIb}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private IBDistribution distribution; + + private IBLambda lambda; + + private Normalization normalization; + + /** + * Required - API name: {@code distribution} + */ + public final Builder distribution(IBDistribution value) { + this.distribution = value; + return this; + } + + /** + * Required - API name: {@code lambda} + */ + public final Builder lambda(IBLambda value) { + this.lambda = value; + return this; + } + + /** + * Required - API name: {@code normalization} + */ + public final Builder normalization(Normalization value) { + this.normalization = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SettingsSimilarityIb}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SettingsSimilarityIb build() { + _checkSingleUse(); + + return new SettingsSimilarityIb(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SettingsSimilarityIb} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SettingsSimilarityIb::setupSettingsSimilarityIbDeserializer); + + protected static void setupSettingsSimilarityIbDeserializer(ObjectDeserializer op) { + + op.add(Builder::distribution, IBDistribution._DESERIALIZER, "distribution"); + op.add(Builder::lambda, IBLambda._DESERIALIZER, "lambda"); + op.add(Builder::normalization, Normalization._DESERIALIZER, "normalization"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmd.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmd.java new file mode 100644 index 000000000..4475b395f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmd.java @@ -0,0 +1,144 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.Integer; +import java.util.Objects; +import java.util.function.Function; + +// typedef: indices._types.SettingsSimilarityLmd + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SettingsSimilarityLmd implements JsonpSerializable { + private final int mu; + + // --------------------------------------------------------------------------------------------- + + private SettingsSimilarityLmd(Builder builder) { + + this.mu = ApiTypeHelper.requireNonNull(builder.mu, this, "mu"); + + } + + public static SettingsSimilarityLmd of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code mu} + */ + public final int mu() { + return this.mu; + } + + /** + * 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("mu"); + generator.write(this.mu); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SettingsSimilarityLmd}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Integer mu; + + /** + * Required - API name: {@code mu} + */ + public final Builder mu(int value) { + this.mu = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SettingsSimilarityLmd}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SettingsSimilarityLmd build() { + _checkSingleUse(); + + return new SettingsSimilarityLmd(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SettingsSimilarityLmd} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SettingsSimilarityLmd::setupSettingsSimilarityLmdDeserializer); + + protected static void setupSettingsSimilarityLmdDeserializer(ObjectDeserializer op) { + + op.add(Builder::mu, JsonpDeserializer.integerDeserializer(), "mu"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmj.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmj.java new file mode 100644 index 000000000..b3890b127 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityLmj.java @@ -0,0 +1,144 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.Double; +import java.util.Objects; +import java.util.function.Function; + +// typedef: indices._types.SettingsSimilarityLmj + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SettingsSimilarityLmj implements JsonpSerializable { + private final double lambda; + + // --------------------------------------------------------------------------------------------- + + private SettingsSimilarityLmj(Builder builder) { + + this.lambda = ApiTypeHelper.requireNonNull(builder.lambda, this, "lambda"); + + } + + public static SettingsSimilarityLmj of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code lambda} + */ + public final double lambda() { + return this.lambda; + } + + /** + * 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("lambda"); + generator.write(this.lambda); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SettingsSimilarityLmj}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Double lambda; + + /** + * Required - API name: {@code lambda} + */ + public final Builder lambda(double value) { + this.lambda = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SettingsSimilarityLmj}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SettingsSimilarityLmj build() { + _checkSingleUse(); + + return new SettingsSimilarityLmj(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SettingsSimilarityLmj} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SettingsSimilarityLmj::setupSettingsSimilarityLmjDeserializer); + + protected static void setupSettingsSimilarityLmjDeserializer(ObjectDeserializer op) { + + op.add(Builder::lambda, JsonpDeserializer.doubleDeserializer(), "lambda"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityScriptedTfidf.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityScriptedTfidf.java new file mode 100644 index 000000000..ff59778c4 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SettingsSimilarityScriptedTfidf.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.Script; +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.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.SettingsSimilarityScriptedTfidf + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SettingsSimilarityScriptedTfidf implements JsonpSerializable { + private final Script script; + + // --------------------------------------------------------------------------------------------- + + private SettingsSimilarityScriptedTfidf(Builder builder) { + + this.script = ApiTypeHelper.requireNonNull(builder.script, this, "script"); + + } + + public static SettingsSimilarityScriptedTfidf of( + Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code script} + */ + public final Script script() { + return this.script; + } + + /** + * 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("script"); + this.script.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SettingsSimilarityScriptedTfidf}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Script script; + + /** + * Required - API name: {@code script} + */ + public final Builder script(Script value) { + this.script = value; + return this; + } + + /** + * Required - API name: {@code script} + */ + public final Builder script(Function> fn) { + return this.script(fn.apply(new Script.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SettingsSimilarityScriptedTfidf}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SettingsSimilarityScriptedTfidf build() { + _checkSingleUse(); + + return new SettingsSimilarityScriptedTfidf(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SettingsSimilarityScriptedTfidf} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SettingsSimilarityScriptedTfidf::setupSettingsSimilarityScriptedTfidfDeserializer); + + protected static void setupSettingsSimilarityScriptedTfidfDeserializer( + ObjectDeserializer op) { + + op.add(Builder::script, Script._DESERIALIZER, "script"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateRequest.java new file mode 100644 index 000000000..ef4aedff7 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateRequest.java @@ -0,0 +1,696 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.elasticsearch.indices.put_index_template.IndexTemplateMapping; +import co.elastic.clients.json.JsonData; +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.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.Boolean; +import java.lang.Integer; +import java.lang.Long; +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 javax.annotation.Nullable; + +// typedef: indices.simulate_index_template.Request + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SimulateIndexTemplateRequest extends RequestBase implements JsonpSerializable { + private final Map meta; + + @Nullable + private final Boolean allowAutoCreate; + + private final List composedOf; + + @Nullable + private final Boolean create; + + @Nullable + private final DataStreamVisibility dataStream; + + @Nullable + private final Boolean includeDefaults; + + private final List indexPatterns; + + @Nullable + private final Time masterTimeout; + + private final String name; + + @Nullable + private final Integer priority; + + @Nullable + private final IndexTemplateMapping template; + + @Nullable + private final Long version; + + // --------------------------------------------------------------------------------------------- + + private SimulateIndexTemplateRequest(Builder builder) { + + this.meta = ApiTypeHelper.unmodifiable(builder.meta); + this.allowAutoCreate = builder.allowAutoCreate; + this.composedOf = ApiTypeHelper.unmodifiable(builder.composedOf); + this.create = builder.create; + this.dataStream = builder.dataStream; + this.includeDefaults = builder.includeDefaults; + this.indexPatterns = ApiTypeHelper.unmodifiable(builder.indexPatterns); + this.masterTimeout = builder.masterTimeout; + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.priority = builder.priority; + this.template = builder.template; + this.version = builder.version; + + } + + public static SimulateIndexTemplateRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Optional user metadata about the index template. May have any contents. This + * map is not automatically generated by Elasticsearch. + *

+ * API name: {@code _meta} + */ + public final Map meta() { + return this.meta; + } + + /** + * This setting overrides the value of the action.auto_create_index + * cluster setting. If set to true in a template, then indices can + * be automatically created using that template even if auto-creation of indices + * is disabled via actions.auto_create_index. If set to + * false, then indices or data streams matching the template must + * always be explicitly created, and may never be automatically created. + *

+ * API name: {@code allow_auto_create} + */ + @Nullable + public final Boolean allowAutoCreate() { + return this.allowAutoCreate; + } + + /** + * An ordered list of component template names. Component templates are merged + * in the order specified, meaning that the last component template specified + * has the highest precedence. + *

+ * API name: {@code composed_of} + */ + public final List composedOf() { + return this.composedOf; + } + + /** + * If true, the template passed in the body is only used if no + * existing templates match the same index patterns. If false, the + * simulation uses the template with the highest priority. Note that the + * template is not permanently added or updated in either case; it is only used + * for the simulation. + *

+ * API name: {@code create} + */ + @Nullable + public final Boolean create() { + return this.create; + } + + /** + * If this object is included, the template is used to create data streams and + * their backing indices. Supports an empty object. Data streams require a + * matching index template with a data_stream object. + *

+ * API name: {@code data_stream} + */ + @Nullable + public final DataStreamVisibility dataStream() { + return this.dataStream; + } + + /** + * If true, returns all relevant default configurations for the index template. + *

+ * API name: {@code include_defaults} + */ + @Nullable + public final Boolean includeDefaults() { + return this.includeDefaults; + } + + /** + * Array of wildcard (*) expressions used to match the names of + * data streams and indices during creation. + *

+ * API name: {@code index_patterns} + */ + public final List indexPatterns() { + return this.indexPatterns; + } + + /** + * 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; + } + + /** + * Required - Index or template name to simulate + *

+ * API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * Priority to determine index template precedence when a new data stream or + * index is created. The index template with the highest priority is chosen. If + * no priority is specified the template is treated as though it is of priority + * 0 (lowest priority). This number is not automatically generated by + * Elasticsearch. + *

+ * API name: {@code priority} + */ + @Nullable + public final Integer priority() { + return this.priority; + } + + /** + * Template to be applied. It may optionally include an aliases, + * mappings, or settings configuration. + *

+ * API name: {@code template} + */ + @Nullable + public final IndexTemplateMapping template() { + return this.template; + } + + /** + * Version number used to manage index templates externally. This number is not + * automatically generated by Elasticsearch. + *

+ * API name: {@code version} + */ + @Nullable + public final Long version() { + return this.version; + } + + /** + * 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.meta)) { + generator.writeKey("_meta"); + generator.writeStartObject(); + for (Map.Entry item0 : this.meta.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.allowAutoCreate != null) { + generator.writeKey("allow_auto_create"); + generator.write(this.allowAutoCreate); + + } + if (ApiTypeHelper.isDefined(this.composedOf)) { + generator.writeKey("composed_of"); + generator.writeStartArray(); + for (String item0 : this.composedOf) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.dataStream != null) { + generator.writeKey("data_stream"); + this.dataStream.serialize(generator, mapper); + + } + if (ApiTypeHelper.isDefined(this.indexPatterns)) { + generator.writeKey("index_patterns"); + generator.writeStartArray(); + for (String item0 : this.indexPatterns) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.priority != null) { + generator.writeKey("priority"); + generator.write(this.priority); + + } + if (this.template != null) { + generator.writeKey("template"); + this.template.serialize(generator, mapper); + + } + if (this.version != null) { + generator.writeKey("version"); + generator.write(this.version); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SimulateIndexTemplateRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Map meta; + + @Nullable + private Boolean allowAutoCreate; + + @Nullable + private List composedOf; + + @Nullable + private Boolean create; + + @Nullable + private DataStreamVisibility dataStream; + + @Nullable + private Boolean includeDefaults; + + @Nullable + private List indexPatterns; + + @Nullable + private Time masterTimeout; + + private String name; + + @Nullable + private Integer priority; + + @Nullable + private IndexTemplateMapping template; + + @Nullable + private Long version; + + /** + * Optional user metadata about the index template. May have any contents. This + * map is not automatically generated by Elasticsearch. + *

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

+ * Adds all entries of map to meta. + */ + public final Builder meta(Map map) { + this.meta = _mapPutAll(this.meta, map); + return this; + } + + /** + * Optional user metadata about the index template. May have any contents. This + * map is not automatically generated by Elasticsearch. + *

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

+ * Adds an entry to meta. + */ + public final Builder meta(String key, JsonData value) { + this.meta = _mapPut(this.meta, key, value); + return this; + } + + /** + * This setting overrides the value of the action.auto_create_index + * cluster setting. If set to true in a template, then indices can + * be automatically created using that template even if auto-creation of indices + * is disabled via actions.auto_create_index. If set to + * false, then indices or data streams matching the template must + * always be explicitly created, and may never be automatically created. + *

+ * API name: {@code allow_auto_create} + */ + public final Builder allowAutoCreate(@Nullable Boolean value) { + this.allowAutoCreate = value; + return this; + } + + /** + * An ordered list of component template names. Component templates are merged + * in the order specified, meaning that the last component template specified + * has the highest precedence. + *

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

+ * Adds all elements of list to composedOf. + */ + public final Builder composedOf(List list) { + this.composedOf = _listAddAll(this.composedOf, list); + return this; + } + + /** + * An ordered list of component template names. Component templates are merged + * in the order specified, meaning that the last component template specified + * has the highest precedence. + *

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

+ * Adds one or more values to composedOf. + */ + public final Builder composedOf(String value, String... values) { + this.composedOf = _listAdd(this.composedOf, value, values); + return this; + } + + /** + * If true, the template passed in the body is only used if no + * existing templates match the same index patterns. If false, the + * simulation uses the template with the highest priority. Note that the + * template is not permanently added or updated in either case; it is only used + * for the simulation. + *

+ * API name: {@code create} + */ + public final Builder create(@Nullable Boolean value) { + this.create = value; + return this; + } + + /** + * If this object is included, the template is used to create data streams and + * their backing indices. Supports an empty object. Data streams require a + * matching index template with a data_stream object. + *

+ * API name: {@code data_stream} + */ + public final Builder dataStream(@Nullable DataStreamVisibility value) { + this.dataStream = value; + return this; + } + + /** + * If this object is included, the template is used to create data streams and + * their backing indices. Supports an empty object. Data streams require a + * matching index template with a data_stream object. + *

+ * API name: {@code data_stream} + */ + public final Builder dataStream( + Function> fn) { + return this.dataStream(fn.apply(new DataStreamVisibility.Builder()).build()); + } + + /** + * If true, returns all relevant default configurations for the index template. + *

+ * API name: {@code include_defaults} + */ + public final Builder includeDefaults(@Nullable Boolean value) { + this.includeDefaults = value; + return this; + } + + /** + * Array of wildcard (*) expressions used to match the names of + * data streams and indices during creation. + *

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

+ * Adds all elements of list to indexPatterns. + */ + public final Builder indexPatterns(List list) { + this.indexPatterns = _listAddAll(this.indexPatterns, list); + return this; + } + + /** + * Array of wildcard (*) expressions used to match the names of + * data streams and indices during creation. + *

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

+ * Adds one or more values to indexPatterns. + */ + public final Builder indexPatterns(String value, String... values) { + this.indexPatterns = _listAdd(this.indexPatterns, 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()); + } + + /** + * Required - Index or template name to simulate + *

+ * API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Priority to determine index template precedence when a new data stream or + * index is created. The index template with the highest priority is chosen. If + * no priority is specified the template is treated as though it is of priority + * 0 (lowest priority). This number is not automatically generated by + * Elasticsearch. + *

+ * API name: {@code priority} + */ + public final Builder priority(@Nullable Integer value) { + this.priority = value; + return this; + } + + /** + * Template to be applied. It may optionally include an aliases, + * mappings, or settings configuration. + *

+ * API name: {@code template} + */ + public final Builder template(@Nullable IndexTemplateMapping value) { + this.template = value; + return this; + } + + /** + * Template to be applied. It may optionally include an aliases, + * mappings, or settings configuration. + *

+ * API name: {@code template} + */ + public final Builder template(Function> fn) { + return this.template(fn.apply(new IndexTemplateMapping.Builder()).build()); + } + + /** + * Version number used to manage index templates externally. This number is not + * automatically generated by Elasticsearch. + *

+ * API name: {@code version} + */ + public final Builder version(@Nullable Long value) { + this.version = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SimulateIndexTemplateRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SimulateIndexTemplateRequest build() { + _checkSingleUse(); + + return new SimulateIndexTemplateRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SimulateIndexTemplateRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SimulateIndexTemplateRequest::setupSimulateIndexTemplateRequestDeserializer); + + protected static void setupSimulateIndexTemplateRequestDeserializer( + ObjectDeserializer op) { + + op.add(Builder::meta, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "_meta"); + op.add(Builder::allowAutoCreate, JsonpDeserializer.booleanDeserializer(), "allow_auto_create"); + op.add(Builder::composedOf, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "composed_of"); + op.add(Builder::dataStream, DataStreamVisibility._DESERIALIZER, "data_stream"); + op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "index_patterns"); + op.add(Builder::priority, JsonpDeserializer.integerDeserializer(), "priority"); + op.add(Builder::template, IndexTemplateMapping._DESERIALIZER, "template"); + op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.simulate_index_template}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.simulate_index_template", + + // Request method + request -> { + return "POST"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_index_template"); + buf.append("/_simulate_index"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + propsSet |= _name; + + if (propsSet == (_name)) { + params.put("name", request.name); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } + if (request.create != null) { + params.put("create", String.valueOf(request.create)); + } + if (request.includeDefaults != null) { + params.put("include_defaults", String.valueOf(request.includeDefaults)); + } + return params; + + }, SimpleEndpoint.emptyMap(), true, SimulateIndexTemplateResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateResponse.java new file mode 100644 index 000000000..9c85fdf06 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateIndexTemplateResponse.java @@ -0,0 +1,55 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.simulate_index_template.Response + +/** + * + * @see API + * specification + */ + +public class SimulateIndexTemplateResponse { + public SimulateIndexTemplateResponse() { + } + + /** + * Singleton instance for {@link SimulateIndexTemplateResponse}. + */ + public static final SimulateIndexTemplateResponse _INSTANCE = new SimulateIndexTemplateResponse(); + + public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer + .fixedValue(SimulateIndexTemplateResponse._INSTANCE); + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateRequest.java new file mode 100644 index 000000000..4bafcbf29 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateRequest.java @@ -0,0 +1,355 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.JsonpMapper; +import co.elastic.clients.json.JsonpSerializable; +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 jakarta.json.stream.JsonParser; +import java.lang.Boolean; +import java.lang.String; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.simulate_template.Request + +/** + * Returns the index configuration that would be applied by a particular index + * template. + * + * @see API + * specification + */ +@JsonpDeserializable +public class SimulateTemplateRequest extends RequestBase implements JsonpSerializable { + @Nullable + private final Boolean create; + + @Nullable + private final Boolean includeDefaults; + + @Nullable + private final Time masterTimeout; + + @Nullable + private final String name; + + private final IndexTemplate template; + + // --------------------------------------------------------------------------------------------- + + private SimulateTemplateRequest(Builder builder) { + + this.create = builder.create; + this.includeDefaults = builder.includeDefaults; + this.masterTimeout = builder.masterTimeout; + this.name = builder.name; + this.template = ApiTypeHelper.requireNonNull(builder.template, this, "template"); + + } + + public static SimulateTemplateRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If true, the template passed in the body is only used if no existing + * templates match the same index patterns. If false, the simulation uses the + * template with the highest priority. Note that the template is not permanently + * added or updated in either case; it is only used for the simulation. + *

+ * API name: {@code create} + */ + @Nullable + public final Boolean create() { + return this.create; + } + + /** + * If true, returns all relevant default configurations for the index template. + *

+ * API name: {@code include_defaults} + */ + @Nullable + public final Boolean includeDefaults() { + return this.includeDefaults; + } + + /** + * 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; + } + + /** + * Name of the index template to simulate. To test a template configuration + * before you add it to the cluster, omit this parameter and specify the + * template configuration in the request body. + *

+ * API name: {@code name} + */ + @Nullable + public final String name() { + return this.name; + } + + /** + * Required - Request body. + */ + public final IndexTemplate template() { + return this.template; + } + + /** + * Serialize this value to JSON. + */ + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + this.template.serialize(generator, mapper); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SimulateTemplateRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean create; + + @Nullable + private Boolean includeDefaults; + + @Nullable + private Time masterTimeout; + + @Nullable + private String name; + + private IndexTemplate template; + + /** + * If true, the template passed in the body is only used if no existing + * templates match the same index patterns. If false, the simulation uses the + * template with the highest priority. Note that the template is not permanently + * added or updated in either case; it is only used for the simulation. + *

+ * API name: {@code create} + */ + public final Builder create(@Nullable Boolean value) { + this.create = value; + return this; + } + + /** + * If true, returns all relevant default configurations for the index template. + *

+ * API name: {@code include_defaults} + */ + public final Builder includeDefaults(@Nullable Boolean value) { + this.includeDefaults = 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(@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()); + } + + /** + * Name of the index template to simulate. To test a template configuration + * before you add it to the cluster, omit this parameter and specify the + * template configuration in the request body. + *

+ * API name: {@code name} + */ + public final Builder name(@Nullable String value) { + this.name = value; + return this; + } + + /** + * Required - Request body. + */ + public final Builder template(IndexTemplate value) { + this.template = value; + return this; + } + + /** + * Required - Request body. + */ + public final Builder template(Function> fn) { + return this.template(fn.apply(new IndexTemplate.Builder()).build()); + } + + @Override + public Builder withJson(JsonParser parser, JsonpMapper mapper) { + + @SuppressWarnings("unchecked") + IndexTemplate value = (IndexTemplate) IndexTemplate._DESERIALIZER.deserialize(parser, mapper); + return this.template(value); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SimulateTemplateRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SimulateTemplateRequest build() { + _checkSingleUse(); + + return new SimulateTemplateRequest(this); + } + } + + public static final JsonpDeserializer _DESERIALIZER = createSimulateTemplateRequestDeserializer(); + protected static JsonpDeserializer createSimulateTemplateRequestDeserializer() { + + JsonpDeserializer valueDeserializer = IndexTemplate._DESERIALIZER; + + return JsonpDeserializer.of(valueDeserializer.acceptedEvents(), (parser, mapper, event) -> new Builder() + .template(valueDeserializer.deserialize(parser, mapper, event)).build()); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.simulate_template}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.simulate_template", + + // Request method + request -> { + return "POST"; + + }, + + // Request path + request -> { + final int _name = 1 << 0; + + int propsSet = 0; + + if (request.name() != null) + propsSet |= _name; + + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_index_template"); + buf.append("/_simulate"); + return buf.toString(); + } + if (propsSet == (_name)) { + StringBuilder buf = new StringBuilder(); + buf.append("/_index_template"); + buf.append("/_simulate"); + buf.append("/"); + SimpleEndpoint.pathEncode(request.name, buf); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _name = 1 << 0; + + int propsSet = 0; + + if (request.name() != null) + propsSet |= _name; + + if (propsSet == 0) { + } + if (propsSet == (_name)) { + params.put("name", request.name); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.masterTimeout != null) { + params.put("master_timeout", request.masterTimeout._toJsonString()); + } + if (request.create != null) { + params.put("create", String.valueOf(request.create)); + } + if (request.includeDefaults != null) { + params.put("include_defaults", String.valueOf(request.includeDefaults)); + } + return params; + + }, SimpleEndpoint.emptyMap(), true, SimulateTemplateResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateResponse.java new file mode 100644 index 000000000..8cc600a1a --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SimulateTemplateResponse.java @@ -0,0 +1,208 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch.indices.simulate_template.Overlapping; +import co.elastic.clients.elasticsearch.indices.simulate_template.Template; +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; + +// typedef: indices.simulate_template.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SimulateTemplateResponse implements JsonpSerializable { + private final List overlapping; + + private final Template template; + + // --------------------------------------------------------------------------------------------- + + private SimulateTemplateResponse(Builder builder) { + + this.overlapping = ApiTypeHelper.unmodifiable(builder.overlapping); + this.template = ApiTypeHelper.requireNonNull(builder.template, this, "template"); + + } + + public static SimulateTemplateResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code overlapping} + */ + public final List overlapping() { + return this.overlapping; + } + + /** + * Required - API name: {@code template} + */ + public final Template template() { + return this.template; + } + + /** + * 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.overlapping)) { + generator.writeKey("overlapping"); + generator.writeStartArray(); + for (Overlapping item0 : this.overlapping) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + generator.writeKey("template"); + this.template.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SimulateTemplateResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private List overlapping; + + private Template template; + + /** + * API name: {@code overlapping} + *

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

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

+ * Adds a value to overlapping using a builder lambda. + */ + public final Builder overlapping(Function> fn) { + return overlapping(fn.apply(new Overlapping.Builder()).build()); + } + + /** + * Required - API name: {@code template} + */ + public final Builder template(Template value) { + this.template = value; + return this; + } + + /** + * Required - API name: {@code template} + */ + public final Builder template(Function> fn) { + return this.template(fn.apply(new Template.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SimulateTemplateResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SimulateTemplateResponse build() { + _checkSingleUse(); + + return new SimulateTemplateResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SimulateTemplateResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SimulateTemplateResponse::setupSimulateTemplateResponseDeserializer); + + protected static void setupSimulateTemplateResponseDeserializer( + ObjectDeserializer op) { + + op.add(Builder::overlapping, JsonpDeserializer.arrayDeserializer(Overlapping._DESERIALIZER), "overlapping"); + op.add(Builder::template, Template._DESERIALIZER, "template"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogSettings.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogSettings.java new file mode 100644 index 000000000..d9ab7000a --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogSettings.java @@ -0,0 +1,243 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.lang.Integer; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.SlowlogSettings + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SlowlogSettings implements JsonpSerializable { + @Nullable + private final String level; + + @Nullable + private final Integer source; + + @Nullable + private final Boolean reformat; + + @Nullable + private final SlowlogTresholds threshold; + + // --------------------------------------------------------------------------------------------- + + private SlowlogSettings(Builder builder) { + + this.level = builder.level; + this.source = builder.source; + this.reformat = builder.reformat; + this.threshold = builder.threshold; + + } + + public static SlowlogSettings of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code level} + */ + @Nullable + public final String level() { + return this.level; + } + + /** + * API name: {@code source} + */ + @Nullable + public final Integer source() { + return this.source; + } + + /** + * API name: {@code reformat} + */ + @Nullable + public final Boolean reformat() { + return this.reformat; + } + + /** + * API name: {@code threshold} + */ + @Nullable + public final SlowlogTresholds threshold() { + return this.threshold; + } + + /** + * 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 (this.level != null) { + generator.writeKey("level"); + generator.write(this.level); + + } + if (this.source != null) { + generator.writeKey("source"); + generator.write(this.source); + + } + if (this.reformat != null) { + generator.writeKey("reformat"); + generator.write(this.reformat); + + } + if (this.threshold != null) { + generator.writeKey("threshold"); + this.threshold.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SlowlogSettings}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private String level; + + @Nullable + private Integer source; + + @Nullable + private Boolean reformat; + + @Nullable + private SlowlogTresholds threshold; + + /** + * API name: {@code level} + */ + public final Builder level(@Nullable String value) { + this.level = value; + return this; + } + + /** + * API name: {@code source} + */ + public final Builder source(@Nullable Integer value) { + this.source = value; + return this; + } + + /** + * API name: {@code reformat} + */ + public final Builder reformat(@Nullable Boolean value) { + this.reformat = value; + return this; + } + + /** + * API name: {@code threshold} + */ + public final Builder threshold(@Nullable SlowlogTresholds value) { + this.threshold = value; + return this; + } + + /** + * API name: {@code threshold} + */ + public final Builder threshold(Function> fn) { + return this.threshold(fn.apply(new SlowlogTresholds.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SlowlogSettings}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SlowlogSettings build() { + _checkSingleUse(); + + return new SlowlogSettings(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SlowlogSettings} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + SlowlogSettings::setupSlowlogSettingsDeserializer); + + protected static void setupSlowlogSettingsDeserializer(ObjectDeserializer op) { + + op.add(Builder::level, JsonpDeserializer.stringDeserializer(), "level"); + op.add(Builder::source, JsonpDeserializer.integerDeserializer(), "source"); + op.add(Builder::reformat, JsonpDeserializer.booleanDeserializer(), "reformat"); + op.add(Builder::threshold, SlowlogTresholds._DESERIALIZER, "threshold"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogTresholdLevels.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogTresholdLevels.java new file mode 100644 index 000000000..3493285c9 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogTresholdLevels.java @@ -0,0 +1,265 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.Time; +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.SlowlogTresholdLevels + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SlowlogTresholdLevels implements JsonpSerializable { + @Nullable + private final Time warn; + + @Nullable + private final Time info; + + @Nullable + private final Time debug; + + @Nullable + private final Time trace; + + // --------------------------------------------------------------------------------------------- + + private SlowlogTresholdLevels(Builder builder) { + + this.warn = builder.warn; + this.info = builder.info; + this.debug = builder.debug; + this.trace = builder.trace; + + } + + public static SlowlogTresholdLevels of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code warn} + */ + @Nullable + public final Time warn() { + return this.warn; + } + + /** + * API name: {@code info} + */ + @Nullable + public final Time info() { + return this.info; + } + + /** + * API name: {@code debug} + */ + @Nullable + public final Time debug() { + return this.debug; + } + + /** + * API name: {@code trace} + */ + @Nullable + public final Time trace() { + return this.trace; + } + + /** + * 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 (this.warn != null) { + generator.writeKey("warn"); + this.warn.serialize(generator, mapper); + + } + if (this.info != null) { + generator.writeKey("info"); + this.info.serialize(generator, mapper); + + } + if (this.debug != null) { + generator.writeKey("debug"); + this.debug.serialize(generator, mapper); + + } + if (this.trace != null) { + generator.writeKey("trace"); + this.trace.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SlowlogTresholdLevels}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Time warn; + + @Nullable + private Time info; + + @Nullable + private Time debug; + + @Nullable + private Time trace; + + /** + * API name: {@code warn} + */ + public final Builder warn(@Nullable Time value) { + this.warn = value; + return this; + } + + /** + * API name: {@code warn} + */ + public final Builder warn(Function> fn) { + return this.warn(fn.apply(new Time.Builder()).build()); + } + + /** + * API name: {@code info} + */ + public final Builder info(@Nullable Time value) { + this.info = value; + return this; + } + + /** + * API name: {@code info} + */ + public final Builder info(Function> fn) { + return this.info(fn.apply(new Time.Builder()).build()); + } + + /** + * API name: {@code debug} + */ + public final Builder debug(@Nullable Time value) { + this.debug = value; + return this; + } + + /** + * API name: {@code debug} + */ + public final Builder debug(Function> fn) { + return this.debug(fn.apply(new Time.Builder()).build()); + } + + /** + * API name: {@code trace} + */ + public final Builder trace(@Nullable Time value) { + this.trace = value; + return this; + } + + /** + * API name: {@code trace} + */ + public final Builder trace(Function> fn) { + return this.trace(fn.apply(new Time.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SlowlogTresholdLevels}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SlowlogTresholdLevels build() { + _checkSingleUse(); + + return new SlowlogTresholdLevels(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SlowlogTresholdLevels} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, SlowlogTresholdLevels::setupSlowlogTresholdLevelsDeserializer); + + protected static void setupSlowlogTresholdLevelsDeserializer(ObjectDeserializer op) { + + op.add(Builder::warn, Time._DESERIALIZER, "warn"); + op.add(Builder::info, Time._DESERIALIZER, "info"); + op.add(Builder::debug, Time._DESERIALIZER, "debug"); + op.add(Builder::trace, Time._DESERIALIZER, "trace"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogTresholds.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogTresholds.java new file mode 100644 index 000000000..9d9efa393 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SlowlogTresholds.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.SlowlogTresholds + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SlowlogTresholds implements JsonpSerializable { + @Nullable + private final SlowlogTresholdLevels query; + + @Nullable + private final SlowlogTresholdLevels fetch; + + // --------------------------------------------------------------------------------------------- + + private SlowlogTresholds(Builder builder) { + + this.query = builder.query; + this.fetch = builder.fetch; + + } + + public static SlowlogTresholds of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code query} + */ + @Nullable + public final SlowlogTresholdLevels query() { + return this.query; + } + + /** + * API name: {@code fetch} + */ + @Nullable + public final SlowlogTresholdLevels fetch() { + return this.fetch; + } + + /** + * 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 (this.query != null) { + generator.writeKey("query"); + this.query.serialize(generator, mapper); + + } + if (this.fetch != null) { + generator.writeKey("fetch"); + this.fetch.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SlowlogTresholds}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private SlowlogTresholdLevels query; + + @Nullable + private SlowlogTresholdLevels fetch; + + /** + * API name: {@code query} + */ + public final Builder query(@Nullable SlowlogTresholdLevels value) { + this.query = value; + return this; + } + + /** + * API name: {@code query} + */ + public final Builder query(Function> fn) { + return this.query(fn.apply(new SlowlogTresholdLevels.Builder()).build()); + } + + /** + * API name: {@code fetch} + */ + public final Builder fetch(@Nullable SlowlogTresholdLevels value) { + this.fetch = value; + return this; + } + + /** + * API name: {@code fetch} + */ + public final Builder fetch(Function> fn) { + return this.fetch(fn.apply(new SlowlogTresholdLevels.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SlowlogTresholds}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SlowlogTresholds build() { + _checkSingleUse(); + + return new SlowlogTresholds(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SlowlogTresholds} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + SlowlogTresholds::setupSlowlogTresholdsDeserializer); + + protected static void setupSlowlogTresholdsDeserializer(ObjectDeserializer op) { + + op.add(Builder::query, SlowlogTresholdLevels._DESERIALIZER, "query"); + op.add(Builder::fetch, SlowlogTresholdLevels._DESERIALIZER, "fetch"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SoftDeletes.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SoftDeletes.java new file mode 100644 index 000000000..dfc72fddc --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/SoftDeletes.java @@ -0,0 +1,205 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.ObjectBuilder; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Boolean; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.SoftDeletes + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class SoftDeletes implements JsonpSerializable { + @Nullable + private final Boolean enabled; + + @Nullable + private final RetentionLease retentionLease; + + // --------------------------------------------------------------------------------------------- + + private SoftDeletes(Builder builder) { + + this.enabled = builder.enabled; + this.retentionLease = builder.retentionLease; + + } + + public static SoftDeletes of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Indicates whether soft deletes are enabled on the index. + *

+ * API name: {@code enabled} + */ + @Nullable + public final Boolean enabled() { + return this.enabled; + } + + /** + * The maximum period to retain a shard history retention lease before it is + * considered expired. Shard history retention leases ensure that soft deletes + * are retained during merges on the Lucene index. If a soft delete is merged + * away before it can be replicated to a follower the following process will + * fail due to incomplete history on the leader. + *

+ * API name: {@code retention_lease} + */ + @Nullable + public final RetentionLease retentionLease() { + return this.retentionLease; + } + + /** + * 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 (this.enabled != null) { + generator.writeKey("enabled"); + generator.write(this.enabled); + + } + if (this.retentionLease != null) { + generator.writeKey("retention_lease"); + this.retentionLease.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link SoftDeletes}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Boolean enabled; + + @Nullable + private RetentionLease retentionLease; + + /** + * Indicates whether soft deletes are enabled on the index. + *

+ * API name: {@code enabled} + */ + public final Builder enabled(@Nullable Boolean value) { + this.enabled = value; + return this; + } + + /** + * The maximum period to retain a shard history retention lease before it is + * considered expired. Shard history retention leases ensure that soft deletes + * are retained during merges on the Lucene index. If a soft delete is merged + * away before it can be replicated to a follower the following process will + * fail due to incomplete history on the leader. + *

+ * API name: {@code retention_lease} + */ + public final Builder retentionLease(@Nullable RetentionLease value) { + this.retentionLease = value; + return this; + } + + /** + * The maximum period to retain a shard history retention lease before it is + * considered expired. Shard history retention leases ensure that soft deletes + * are retained during merges on the Lucene index. If a soft delete is merged + * away before it can be replicated to a follower the following process will + * fail due to incomplete history on the leader. + *

+ * API name: {@code retention_lease} + */ + public final Builder retentionLease(Function> fn) { + return this.retentionLease(fn.apply(new RetentionLease.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link SoftDeletes}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public SoftDeletes build() { + _checkSingleUse(); + + return new SoftDeletes(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link SoftDeletes} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + SoftDeletes::setupSoftDeletesDeserializer); + + protected static void setupSoftDeletesDeserializer(ObjectDeserializer op) { + + op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled"); + op.add(Builder::retentionLease, RetentionLease._DESERIALIZER, "retention_lease"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Storage.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Storage.java new file mode 100644 index 000000000..c76beb368 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Storage.java @@ -0,0 +1,195 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.Boolean; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.Storage + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Storage implements JsonpSerializable { + private final String type; + + @Nullable + private final Boolean allowMmap; + + // --------------------------------------------------------------------------------------------- + + private Storage(Builder builder) { + + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + this.allowMmap = builder.allowMmap; + + } + + public static Storage of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code type} + */ + public final String type() { + return this.type; + } + + /** + * You can restrict the use of the mmapfs and the related hybridfs store type + * via the setting node.store.allow_mmap. This is a boolean setting indicating + * whether or not memory-mapping is allowed. The default is to allow it. This + * setting is useful, for example, if you are in an environment where you can + * not control the ability to create a lot of memory maps so you need disable + * the ability to use memory-mapping. + *

+ * API name: {@code allow_mmap} + */ + @Nullable + public final Boolean allowMmap() { + return this.allowMmap; + } + + /** + * 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("type"); + generator.write(this.type); + + if (this.allowMmap != null) { + generator.writeKey("allow_mmap"); + generator.write(this.allowMmap); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Storage}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String type; + + @Nullable + private Boolean allowMmap; + + /** + * Required - API name: {@code type} + */ + public final Builder type(String value) { + this.type = value; + return this; + } + + /** + * Required - API name: {@code type} + */ + public final Builder type(StorageType value) { + this.type = value == null ? null : value.jsonValue(); + return this; + } + + /** + * You can restrict the use of the mmapfs and the related hybridfs store type + * via the setting node.store.allow_mmap. This is a boolean setting indicating + * whether or not memory-mapping is allowed. The default is to allow it. This + * setting is useful, for example, if you are in an environment where you can + * not control the ability to create a lot of memory maps so you need disable + * the ability to use memory-mapping. + *

+ * API name: {@code allow_mmap} + */ + public final Builder allowMmap(@Nullable Boolean value) { + this.allowMmap = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link Storage}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public Storage build() { + _checkSingleUse(); + + return new Storage(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Storage} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Storage::setupStorageDeserializer); + + protected static void setupStorageDeserializer(ObjectDeserializer op) { + + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + op.add(Builder::allowMmap, JsonpDeserializer.booleanDeserializer(), "allow_mmap"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/StorageType.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/StorageType.java new file mode 100644 index 000000000..e42d85ab3 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/StorageType.java @@ -0,0 +1,91 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum StorageType implements JsonEnum { + /** + * Default file system implementation. This will pick the best implementation + * depending on the operating environment, which is currently hybridfs on all + * supported systems but is subject to change. + */ + Fs("fs", ""), + + /** + * The NIO FS type stores the shard index on the file system (maps to Lucene + * NIOFSDirectory) using NIO. It allows multiple threads to read from the same + * file concurrently. It is not recommended on Windows because of a bug in the + * SUN Java implementation and disables some optimizations for heap memory + * usage. + */ + Niofs("niofs"), + + /** + * The MMap FS type stores the shard index on the file system (maps to Lucene + * MMapDirectory) by mapping a file into memory (mmap). Memory mapping uses up a + * portion of the virtual memory address space in your process equal to the size + * of the file being mapped. Before using this class, be sure you have allowed + * plenty of virtual address space. + */ + Mmapfs("mmapfs"), + + /** + * The hybridfs type is a hybrid of niofs and mmapfs, which chooses the best + * file system type for each type of file based on the read access pattern. + * Currently only the Lucene term dictionary, norms and doc values files are + * memory mapped. All other files are opened using Lucene NIOFSDirectory. + * Similarly to mmapfs be sure you have allowed plenty of virtual address space. + */ + Hybridfs("hybridfs"), + + ; + + private final String jsonValue; + private final String[] aliases; + + StorageType(String jsonValue, String... aliases) { + this.jsonValue = jsonValue; + this.aliases = aliases; + } + + public String jsonValue() { + return this.jsonValue; + } + + public String[] aliases() { + return this.aliases; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + StorageType.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TemplateMapping.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TemplateMapping.java new file mode 100644 index 000000000..775659f7b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TemplateMapping.java @@ -0,0 +1,350 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; +import co.elastic.clients.json.JsonData; +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.Integer; +import java.lang.Long; +import java.lang.String; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices._types.TemplateMapping + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class TemplateMapping implements JsonpSerializable { + private final Map aliases; + + private final List indexPatterns; + + private final TypeMapping mappings; + + private final int order; + + private final Map settings; + + @Nullable + private final Long version; + + // --------------------------------------------------------------------------------------------- + + private TemplateMapping(Builder builder) { + + this.aliases = ApiTypeHelper.unmodifiableRequired(builder.aliases, this, "aliases"); + this.indexPatterns = ApiTypeHelper.unmodifiableRequired(builder.indexPatterns, this, "indexPatterns"); + this.mappings = ApiTypeHelper.requireNonNull(builder.mappings, this, "mappings"); + this.order = ApiTypeHelper.requireNonNull(builder.order, this, "order"); + this.settings = ApiTypeHelper.unmodifiableRequired(builder.settings, this, "settings"); + this.version = builder.version; + + } + + public static TemplateMapping of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code aliases} + */ + public final Map aliases() { + return this.aliases; + } + + /** + * Required - API name: {@code index_patterns} + */ + public final List indexPatterns() { + return this.indexPatterns; + } + + /** + * Required - API name: {@code mappings} + */ + public final TypeMapping mappings() { + return this.mappings; + } + + /** + * Required - API name: {@code order} + */ + public final int order() { + return this.order; + } + + /** + * Required - API name: {@code settings} + */ + public final Map settings() { + return this.settings; + } + + /** + * API name: {@code version} + */ + @Nullable + public final Long version() { + return this.version; + } + + /** + * 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.aliases)) { + generator.writeKey("aliases"); + generator.writeStartObject(); + for (Map.Entry item0 : this.aliases.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.indexPatterns)) { + generator.writeKey("index_patterns"); + generator.writeStartArray(); + for (String item0 : this.indexPatterns) { + generator.write(item0); + + } + generator.writeEnd(); + + } + generator.writeKey("mappings"); + this.mappings.serialize(generator, mapper); + + generator.writeKey("order"); + generator.write(this.order); + + if (ApiTypeHelper.isDefined(this.settings)) { + generator.writeKey("settings"); + generator.writeStartObject(); + for (Map.Entry item0 : this.settings.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.version != null) { + generator.writeKey("version"); + generator.write(this.version); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link TemplateMapping}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Map aliases; + + private List indexPatterns; + + private TypeMapping mappings; + + private Integer order; + + private Map settings; + + @Nullable + private Long version; + + /** + * Required - API name: {@code aliases} + *

+ * Adds all entries of map to aliases. + */ + public final Builder aliases(Map map) { + this.aliases = _mapPutAll(this.aliases, map); + return this; + } + + /** + * Required - API name: {@code aliases} + *

+ * Adds an entry to aliases. + */ + public final Builder aliases(String key, Alias value) { + this.aliases = _mapPut(this.aliases, key, value); + return this; + } + + /** + * Required - API name: {@code aliases} + *

+ * Adds an entry to aliases using a builder lambda. + */ + public final Builder aliases(String key, Function> fn) { + return aliases(key, fn.apply(new Alias.Builder()).build()); + } + + /** + * Required - API name: {@code index_patterns} + *

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

+ * Adds one or more values to indexPatterns. + */ + public final Builder indexPatterns(String value, String... values) { + this.indexPatterns = _listAdd(this.indexPatterns, value, values); + return this; + } + + /** + * Required - API name: {@code mappings} + */ + public final Builder mappings(TypeMapping value) { + this.mappings = value; + return this; + } + + /** + * Required - API name: {@code mappings} + */ + public final Builder mappings(Function> fn) { + return this.mappings(fn.apply(new TypeMapping.Builder()).build()); + } + + /** + * Required - API name: {@code order} + */ + public final Builder order(int value) { + this.order = value; + return this; + } + + /** + * Required - API name: {@code settings} + *

+ * Adds all entries of map to settings. + */ + public final Builder settings(Map map) { + this.settings = _mapPutAll(this.settings, map); + return this; + } + + /** + * Required - API name: {@code settings} + *

+ * Adds an entry to settings. + */ + public final Builder settings(String key, JsonData value) { + this.settings = _mapPut(this.settings, key, value); + return this; + } + + /** + * API name: {@code version} + */ + public final Builder version(@Nullable Long value) { + this.version = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link TemplateMapping}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public TemplateMapping build() { + _checkSingleUse(); + + return new TemplateMapping(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link TemplateMapping} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + TemplateMapping::setupTemplateMappingDeserializer); + + protected static void setupTemplateMappingDeserializer(ObjectDeserializer op) { + + op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(Alias._DESERIALIZER), "aliases"); + op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "index_patterns"); + op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); + op.add(Builder::order, JsonpDeserializer.integerDeserializer(), "order"); + op.add(Builder::settings, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "settings"); + op.add(Builder::version, JsonpDeserializer.longDeserializer(), "version"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Translog.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Translog.java new file mode 100644 index 000000000..16ab9c863 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/Translog.java @@ -0,0 +1,279 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.Time; +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.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; + +// typedef: indices._types.Translog + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Translog implements JsonpSerializable { + @Nullable + private final Time syncInterval; + + @Nullable + private final TranslogDurability durability; + + @Nullable + private final String flushThresholdSize; + + @Nullable + private final TranslogRetention retention; + + // --------------------------------------------------------------------------------------------- + + private Translog(Builder builder) { + + this.syncInterval = builder.syncInterval; + this.durability = builder.durability; + this.flushThresholdSize = builder.flushThresholdSize; + this.retention = builder.retention; + + } + + public static Translog of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * How often the translog is fsynced to disk and committed, regardless of write + * operations. Values less than 100ms are not allowed. + *

+ * API name: {@code sync_interval} + */ + @Nullable + public final Time syncInterval() { + return this.syncInterval; + } + + /** + * Whether or not to fsync and commit the translog after every + * index, delete, update, or bulk request. + *

+ * API name: {@code durability} + */ + @Nullable + public final TranslogDurability durability() { + return this.durability; + } + + /** + * The translog stores all operations that are not yet safely persisted in + * Lucene (i.e., are not part of a Lucene commit point). Although these + * operations are available for reads, they will need to be replayed if the + * shard was stopped and had to be recovered. This setting controls the maximum + * total size of these operations, to prevent recoveries from taking too long. + * Once the maximum size has been reached a flush will happen, generating a new + * Lucene commit point. + *

+ * API name: {@code flush_threshold_size} + */ + @Nullable + public final String flushThresholdSize() { + return this.flushThresholdSize; + } + + /** + * API name: {@code retention} + */ + @Nullable + public final TranslogRetention retention() { + return this.retention; + } + + /** + * 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 (this.syncInterval != null) { + generator.writeKey("sync_interval"); + this.syncInterval.serialize(generator, mapper); + + } + if (this.durability != null) { + generator.writeKey("durability"); + this.durability.serialize(generator, mapper); + } + if (this.flushThresholdSize != null) { + generator.writeKey("flush_threshold_size"); + generator.write(this.flushThresholdSize); + + } + if (this.retention != null) { + generator.writeKey("retention"); + this.retention.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Translog}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private Time syncInterval; + + @Nullable + private TranslogDurability durability; + + @Nullable + private String flushThresholdSize; + + @Nullable + private TranslogRetention retention; + + /** + * How often the translog is fsynced to disk and committed, regardless of write + * operations. Values less than 100ms are not allowed. + *

+ * API name: {@code sync_interval} + */ + public final Builder syncInterval(@Nullable Time value) { + this.syncInterval = value; + return this; + } + + /** + * How often the translog is fsynced to disk and committed, regardless of write + * operations. Values less than 100ms are not allowed. + *

+ * API name: {@code sync_interval} + */ + public final Builder syncInterval(Function> fn) { + return this.syncInterval(fn.apply(new Time.Builder()).build()); + } + + /** + * Whether or not to fsync and commit the translog after every + * index, delete, update, or bulk request. + *

+ * API name: {@code durability} + */ + public final Builder durability(@Nullable TranslogDurability value) { + this.durability = value; + return this; + } + + /** + * The translog stores all operations that are not yet safely persisted in + * Lucene (i.e., are not part of a Lucene commit point). Although these + * operations are available for reads, they will need to be replayed if the + * shard was stopped and had to be recovered. This setting controls the maximum + * total size of these operations, to prevent recoveries from taking too long. + * Once the maximum size has been reached a flush will happen, generating a new + * Lucene commit point. + *

+ * API name: {@code flush_threshold_size} + */ + public final Builder flushThresholdSize(@Nullable String value) { + this.flushThresholdSize = value; + return this; + } + + /** + * API name: {@code retention} + */ + public final Builder retention(@Nullable TranslogRetention value) { + this.retention = value; + return this; + } + + /** + * API name: {@code retention} + */ + public final Builder retention(Function> fn) { + return this.retention(fn.apply(new TranslogRetention.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link Translog}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public Translog build() { + _checkSingleUse(); + + return new Translog(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Translog} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Translog::setupTranslogDeserializer); + + protected static void setupTranslogDeserializer(ObjectDeserializer op) { + + op.add(Builder::syncInterval, Time._DESERIALIZER, "sync_interval"); + op.add(Builder::durability, TranslogDurability._DESERIALIZER, "durability"); + op.add(Builder::flushThresholdSize, JsonpDeserializer.stringDeserializer(), "flush_threshold_size"); + op.add(Builder::retention, TranslogRetention._DESERIALIZER, "retention"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TranslogDurability.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TranslogDurability.java new file mode 100644 index 000000000..c529ba186 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TranslogDurability.java @@ -0,0 +1,71 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum TranslogDurability implements JsonEnum { + /** + * (default) fsync and commit after every request. In the event of hardware + * failure, all acknowledged writes will already have been committed to disk. + */ + Request("request", "REQUEST"), + + /** + * fsync and commit in the background every sync_interval. In the event of a + * failure, all acknowledged writes since the last automatic commit will be + * discarded. + */ + Async("async", "ASYNC"), + + ; + + private final String jsonValue; + private final String[] aliases; + + TranslogDurability(String jsonValue, String... aliases) { + this.jsonValue = jsonValue; + this.aliases = aliases; + } + + public String jsonValue() { + return this.jsonValue; + } + + public String[] aliases() { + return this.aliases; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>( + TranslogDurability.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TranslogRetention.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TranslogRetention.java new file mode 100644 index 000000000..0770b6143 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/TranslogRetention.java @@ -0,0 +1,225 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.Time; +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.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; + +// typedef: indices._types.TranslogRetention + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class TranslogRetention implements JsonpSerializable { + @Nullable + private final String size; + + @Nullable + private final Time age; + + // --------------------------------------------------------------------------------------------- + + private TranslogRetention(Builder builder) { + + this.size = builder.size; + this.age = builder.age; + + } + + public static TranslogRetention of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * This controls the total size of translog files to keep for each shard. + * Keeping more translog files increases the chance of performing an operation + * based sync when recovering a replica. If the translog files are not + * sufficient, replica recovery will fall back to a file based sync. This + * setting is ignored, and should not be set, if soft deletes are enabled. Soft + * deletes are enabled by default in indices created in Elasticsearch versions + * 7.0.0 and later. + *

+ * API name: {@code size} + */ + @Nullable + public final String size() { + return this.size; + } + + /** + * This controls the maximum duration for which translog files are kept by each + * shard. Keeping more translog files increases the chance of performing an + * operation based sync when recovering replicas. If the translog files are not + * sufficient, replica recovery will fall back to a file based sync. This + * setting is ignored, and should not be set, if soft deletes are enabled. Soft + * deletes are enabled by default in indices created in Elasticsearch versions + * 7.0.0 and later. + *

+ * API name: {@code age} + */ + @Nullable + public final Time age() { + return this.age; + } + + /** + * 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 (this.size != null) { + generator.writeKey("size"); + generator.write(this.size); + + } + if (this.age != null) { + generator.writeKey("age"); + this.age.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link TranslogRetention}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private String size; + + @Nullable + private Time age; + + /** + * This controls the total size of translog files to keep for each shard. + * Keeping more translog files increases the chance of performing an operation + * based sync when recovering a replica. If the translog files are not + * sufficient, replica recovery will fall back to a file based sync. This + * setting is ignored, and should not be set, if soft deletes are enabled. Soft + * deletes are enabled by default in indices created in Elasticsearch versions + * 7.0.0 and later. + *

+ * API name: {@code size} + */ + public final Builder size(@Nullable String value) { + this.size = value; + return this; + } + + /** + * This controls the maximum duration for which translog files are kept by each + * shard. Keeping more translog files increases the chance of performing an + * operation based sync when recovering replicas. If the translog files are not + * sufficient, replica recovery will fall back to a file based sync. This + * setting is ignored, and should not be set, if soft deletes are enabled. Soft + * deletes are enabled by default in indices created in Elasticsearch versions + * 7.0.0 and later. + *

+ * API name: {@code age} + */ + public final Builder age(@Nullable Time value) { + this.age = value; + return this; + } + + /** + * This controls the maximum duration for which translog files are kept by each + * shard. Keeping more translog files increases the chance of performing an + * operation based sync when recovering replicas. If the translog files are not + * sufficient, replica recovery will fall back to a file based sync. This + * setting is ignored, and should not be set, if soft deletes are enabled. Soft + * deletes are enabled by default in indices created in Elasticsearch versions + * 7.0.0 and later. + *

+ * API name: {@code age} + */ + public final Builder age(Function> fn) { + return this.age(fn.apply(new Time.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link TranslogRetention}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public TranslogRetention build() { + _checkSingleUse(); + + return new TranslogRetention(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link TranslogRetention} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, TranslogRetention::setupTranslogRetentionDeserializer); + + protected static void setupTranslogRetentionDeserializer(ObjectDeserializer op) { + + op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size"); + op.add(Builder::age, Time._DESERIALIZER, "age"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/UpdateAliasesRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/UpdateAliasesRequest.java new file mode 100644 index 000000000..3702a9217 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/UpdateAliasesRequest.java @@ -0,0 +1,300 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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.elasticsearch.indices.update_aliases.Action; +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.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.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.update_aliases.Request + +/** + * Adds a data stream or index to an alias. + * + * @see API + * specification + */ +@JsonpDeserializable +public class UpdateAliasesRequest extends RequestBase implements JsonpSerializable { + private final List actions; + + @Nullable + private final Time masterTimeout; + + @Nullable + private final Time timeout; + + // --------------------------------------------------------------------------------------------- + + private UpdateAliasesRequest(Builder builder) { + + this.actions = ApiTypeHelper.unmodifiable(builder.actions); + this.masterTimeout = builder.masterTimeout; + this.timeout = builder.timeout; + + } + + public static UpdateAliasesRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Actions to perform. + *

+ * API name: {@code actions} + */ + public final List actions() { + return this.actions; + } + + /** + * 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; + } + + /** + * 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.actions)) { + generator.writeKey("actions"); + generator.writeStartArray(); + for (Action item0 : this.actions) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link UpdateAliasesRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private List actions; + + @Nullable + private Time masterTimeout; + + @Nullable + private Time timeout; + + /** + * Actions to perform. + *

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

+ * Adds all elements of list to actions. + */ + public final Builder actions(List list) { + this.actions = _listAddAll(this.actions, list); + return this; + } + + /** + * Actions to perform. + *

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

+ * Adds one or more values to actions. + */ + public final Builder actions(Action value, Action... values) { + this.actions = _listAdd(this.actions, value, values); + return this; + } + + /** + * Actions to perform. + *

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

+ * Adds a value to actions using a builder lambda. + */ + public final Builder actions(Function> fn) { + return actions(fn.apply(new Action.Builder()).build()); + } + + /** + * 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 UpdateAliasesRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public UpdateAliasesRequest build() { + _checkSingleUse(); + + return new UpdateAliasesRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link UpdateAliasesRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, UpdateAliasesRequest::setupUpdateAliasesRequestDeserializer); + + protected static void setupUpdateAliasesRequestDeserializer(ObjectDeserializer op) { + + op.add(Builder::actions, JsonpDeserializer.arrayDeserializer(Action._DESERIALIZER), "actions"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.update_aliases}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.update_aliases", + + // Request method + request -> { + return "POST"; + + }, + + // Request path + request -> { + return "/_aliases"; + + }, + + // Path parameters + request -> { + return Collections.emptyMap(); + }, + + // 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(), true, UpdateAliasesResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/UpdateAliasesResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/UpdateAliasesResponse.java new file mode 100644 index 000000000..8543585b5 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/UpdateAliasesResponse.java @@ -0,0 +1,96 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +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; + +// typedef: indices.update_aliases.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class UpdateAliasesResponse extends AcknowledgedResponseBase { + // --------------------------------------------------------------------------------------------- + + private UpdateAliasesResponse(Builder builder) { + super(builder); + + } + + public static UpdateAliasesResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link UpdateAliasesResponse}. + */ + + public static class Builder extends AcknowledgedResponseBase.AbstractBuilder + implements + ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link UpdateAliasesResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public UpdateAliasesResponse build() { + _checkSingleUse(); + + return new UpdateAliasesResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link UpdateAliasesResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, UpdateAliasesResponse::setupUpdateAliasesResponseDeserializer); + + protected static void setupUpdateAliasesResponseDeserializer(ObjectDeserializer op) { + AcknowledgedResponseBase.setupAcknowledgedResponseBaseDeserializer(op); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ValidateQueryRequest.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ValidateQueryRequest.java new file mode 100644 index 000000000..ab53caf1f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ValidateQueryRequest.java @@ -0,0 +1,691 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ErrorResponse; +import co.elastic.clients.elasticsearch._types.ExpandWildcard; +import co.elastic.clients.elasticsearch._types.RequestBase; +import co.elastic.clients.elasticsearch._types.query_dsl.Operator; +import co.elastic.clients.elasticsearch._types.query_dsl.Query; +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.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.Boolean; +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; + +// typedef: indices.validate_query.Request + +/** + * Validates a potentially expensive query without executing it. + * + * @see API + * specification + */ +@JsonpDeserializable +public class ValidateQueryRequest extends RequestBase implements JsonpSerializable { + @Nullable + private final Boolean allShards; + + @Nullable + private final Boolean allowNoIndices; + + @Nullable + private final Boolean analyzeWildcard; + + @Nullable + private final String analyzer; + + @Nullable + private final Operator defaultOperator; + + @Nullable + private final String df; + + private final List expandWildcards; + + @Nullable + private final Boolean explain; + + @Nullable + private final Boolean ignoreUnavailable; + + private final List index; + + @Nullable + private final Boolean lenient; + + @Nullable + private final String q; + + @Nullable + private final Query query; + + @Nullable + private final Boolean rewrite; + + // --------------------------------------------------------------------------------------------- + + private ValidateQueryRequest(Builder builder) { + + this.allShards = builder.allShards; + this.allowNoIndices = builder.allowNoIndices; + this.analyzeWildcard = builder.analyzeWildcard; + this.analyzer = builder.analyzer; + this.defaultOperator = builder.defaultOperator; + this.df = builder.df; + this.expandWildcards = ApiTypeHelper.unmodifiable(builder.expandWildcards); + this.explain = builder.explain; + this.ignoreUnavailable = builder.ignoreUnavailable; + this.index = ApiTypeHelper.unmodifiable(builder.index); + this.lenient = builder.lenient; + this.q = builder.q; + this.query = builder.query; + this.rewrite = builder.rewrite; + + } + + public static ValidateQueryRequest of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * If true, the validation is executed on all shards instead of one + * random shard per index. + *

+ * API name: {@code all_shards} + */ + @Nullable + public final Boolean allShards() { + return this.allShards; + } + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. + *

+ * API name: {@code allow_no_indices} + */ + @Nullable + public final Boolean allowNoIndices() { + return this.allowNoIndices; + } + + /** + * If true, wildcard and prefix queries are analyzed. + *

+ * API name: {@code analyze_wildcard} + */ + @Nullable + public final Boolean analyzeWildcard() { + return this.analyzeWildcard; + } + + /** + * Analyzer to use for the query string. This parameter can only be used when + * the q query string parameter is specified. + *

+ * API name: {@code analyzer} + */ + @Nullable + public final String analyzer() { + return this.analyzer; + } + + /** + * The default operator for query string query: AND or + * OR. + *

+ * API name: {@code default_operator} + */ + @Nullable + public final Operator defaultOperator() { + return this.defaultOperator; + } + + /** + * Field to use as default where no field prefix is given in the query string. + * This parameter can only be used when the q query string + * parameter is specified. + *

+ * API name: {@code df} + */ + @Nullable + public final String df() { + return this.df; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

+ * API name: {@code expand_wildcards} + */ + public final List expandWildcards() { + return this.expandWildcards; + } + + /** + * If true, the response returns detailed information if an error + * has occurred. + *

+ * API name: {@code explain} + */ + @Nullable + public final Boolean explain() { + return this.explain; + } + + /** + * If false, the request returns an error if it targets a missing + * or closed index. + *

+ * API name: {@code ignore_unavailable} + */ + @Nullable + public final Boolean ignoreUnavailable() { + return this.ignoreUnavailable; + } + + /** + * Comma-separated list of data streams, indices, and aliases to search. + * Supports wildcards (*). To search all data streams or indices, + * omit this parameter or use * or _all. + *

+ * API name: {@code index} + */ + public final List index() { + return this.index; + } + + /** + * If true, format-based query failures (such as providing text to + * a numeric field) in the query string will be ignored. + *

+ * API name: {@code lenient} + */ + @Nullable + public final Boolean lenient() { + return this.lenient; + } + + /** + * Query in the Lucene query string syntax. + *

+ * API name: {@code q} + */ + @Nullable + public final String q() { + return this.q; + } + + /** + * Query in the Lucene query string syntax. + *

+ * API name: {@code query} + */ + @Nullable + public final Query query() { + return this.query; + } + + /** + * If true, returns a more detailed explanation showing the actual + * Lucene query that will be executed. + *

+ * API name: {@code rewrite} + */ + @Nullable + public final Boolean rewrite() { + return this.rewrite; + } + + /** + * 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 (this.query != null) { + generator.writeKey("query"); + this.query.serialize(generator, mapper); + + } + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ValidateQueryRequest}. + */ + + public static class Builder extends RequestBase.AbstractBuilder + implements + ObjectBuilder { + @Nullable + private Boolean allShards; + + @Nullable + private Boolean allowNoIndices; + + @Nullable + private Boolean analyzeWildcard; + + @Nullable + private String analyzer; + + @Nullable + private Operator defaultOperator; + + @Nullable + private String df; + + @Nullable + private List expandWildcards; + + @Nullable + private Boolean explain; + + @Nullable + private Boolean ignoreUnavailable; + + @Nullable + private List index; + + @Nullable + private Boolean lenient; + + @Nullable + private String q; + + @Nullable + private Query query; + + @Nullable + private Boolean rewrite; + + /** + * If true, the validation is executed on all shards instead of one + * random shard per index. + *

+ * API name: {@code all_shards} + */ + public final Builder allShards(@Nullable Boolean value) { + this.allShards = value; + return this; + } + + /** + * If false, the request returns an error if any wildcard + * expression, index alias, or _all value targets only missing or + * closed indices. This behavior applies even if the request targets other open + * indices. + *

+ * API name: {@code allow_no_indices} + */ + public final Builder allowNoIndices(@Nullable Boolean value) { + this.allowNoIndices = value; + return this; + } + + /** + * If true, wildcard and prefix queries are analyzed. + *

+ * API name: {@code analyze_wildcard} + */ + public final Builder analyzeWildcard(@Nullable Boolean value) { + this.analyzeWildcard = value; + return this; + } + + /** + * Analyzer to use for the query string. This parameter can only be used when + * the q query string parameter is specified. + *

+ * API name: {@code analyzer} + */ + public final Builder analyzer(@Nullable String value) { + this.analyzer = value; + return this; + } + + /** + * The default operator for query string query: AND or + * OR. + *

+ * API name: {@code default_operator} + */ + public final Builder defaultOperator(@Nullable Operator value) { + this.defaultOperator = value; + return this; + } + + /** + * Field to use as default where no field prefix is given in the query string. + * This parameter can only be used when the q query string + * parameter is specified. + *

+ * API name: {@code df} + */ + public final Builder df(@Nullable String value) { + this.df = value; + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds all elements of list to expandWildcards. + */ + public final Builder expandWildcards(List list) { + this.expandWildcards = _listAddAll(this.expandWildcards, list); + return this; + } + + /** + * Type of index that wildcard patterns can match. If the request can target + * data streams, this argument determines whether wildcard expressions match + * hidden data streams. Supports comma-separated values, such as + * open,hidden. Valid values are: all, + * open, closed, hidden, + * none. + *

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

+ * Adds one or more values to expandWildcards. + */ + public final Builder expandWildcards(ExpandWildcard value, ExpandWildcard... values) { + this.expandWildcards = _listAdd(this.expandWildcards, value, values); + return this; + } + + /** + * If true, the response returns detailed information if an error + * has occurred. + *

+ * API name: {@code explain} + */ + public final Builder explain(@Nullable Boolean value) { + this.explain = value; + return this; + } + + /** + * If false, the request returns an error if it targets a missing + * or closed index. + *

+ * API name: {@code ignore_unavailable} + */ + public final Builder ignoreUnavailable(@Nullable Boolean value) { + this.ignoreUnavailable = value; + return this; + } + + /** + * Comma-separated list of data streams, indices, and aliases to search. + * Supports wildcards (*). To search all data streams or indices, + * omit this parameter or use * or _all. + *

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

+ * Adds all elements of list to index. + */ + public final Builder index(List list) { + this.index = _listAddAll(this.index, list); + return this; + } + + /** + * Comma-separated list of data streams, indices, and aliases to search. + * Supports wildcards (*). To search all data streams or indices, + * omit this parameter or use * or _all. + *

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

+ * Adds one or more values to index. + */ + public final Builder index(String value, String... values) { + this.index = _listAdd(this.index, value, values); + return this; + } + + /** + * If true, format-based query failures (such as providing text to + * a numeric field) in the query string will be ignored. + *

+ * API name: {@code lenient} + */ + public final Builder lenient(@Nullable Boolean value) { + this.lenient = value; + return this; + } + + /** + * Query in the Lucene query string syntax. + *

+ * API name: {@code q} + */ + public final Builder q(@Nullable String value) { + this.q = value; + return this; + } + + /** + * Query in the Lucene query string syntax. + *

+ * API name: {@code query} + */ + public final Builder query(@Nullable Query value) { + this.query = value; + return this; + } + + /** + * Query in the Lucene query string syntax. + *

+ * API name: {@code query} + */ + public final Builder query(Function> fn) { + return this.query(fn.apply(new Query.Builder()).build()); + } + + /** + * If true, returns a more detailed explanation showing the actual + * Lucene query that will be executed. + *

+ * API name: {@code rewrite} + */ + public final Builder rewrite(@Nullable Boolean value) { + this.rewrite = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ValidateQueryRequest}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ValidateQueryRequest build() { + _checkSingleUse(); + + return new ValidateQueryRequest(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ValidateQueryRequest} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ValidateQueryRequest::setupValidateQueryRequestDeserializer); + + protected static void setupValidateQueryRequestDeserializer(ObjectDeserializer op) { + + op.add(Builder::query, Query._DESERIALIZER, "query"); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Endpoint "{@code indices.validate_query}". + */ + public static final Endpoint _ENDPOINT = new SimpleEndpoint<>( + "es/indices.validate_query", + + // Request method + request -> { + return "POST"; + + }, + + // Request path + request -> { + final int _index = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.index())) + propsSet |= _index; + + if (propsSet == 0) { + StringBuilder buf = new StringBuilder(); + buf.append("/_validate"); + buf.append("/query"); + return buf.toString(); + } + if (propsSet == (_index)) { + StringBuilder buf = new StringBuilder(); + buf.append("/"); + SimpleEndpoint.pathEncode(request.index.stream().map(v -> v).collect(Collectors.joining(",")), buf); + buf.append("/_validate"); + buf.append("/query"); + return buf.toString(); + } + throw SimpleEndpoint.noPathTemplateFound("path"); + + }, + + // Path parameters + request -> { + Map params = new HashMap<>(); + final int _index = 1 << 0; + + int propsSet = 0; + + if (ApiTypeHelper.isDefined(request.index())) + propsSet |= _index; + + if (propsSet == 0) { + } + if (propsSet == (_index)) { + params.put("index", request.index.stream().map(v -> v).collect(Collectors.joining(","))); + } + return params; + }, + + // Request parameters + request -> { + Map params = new HashMap<>(); + if (request.explain != null) { + params.put("explain", String.valueOf(request.explain)); + } + if (request.q != null) { + params.put("q", request.q); + } + if (request.df != null) { + params.put("df", request.df); + } + if (request.defaultOperator != null) { + params.put("default_operator", request.defaultOperator.jsonValue()); + } + if (request.allShards != null) { + params.put("all_shards", String.valueOf(request.allShards)); + } + if (ApiTypeHelper.isDefined(request.expandWildcards)) { + params.put("expand_wildcards", + request.expandWildcards.stream().map(v -> v.jsonValue()).collect(Collectors.joining(","))); + } + if (request.ignoreUnavailable != null) { + params.put("ignore_unavailable", String.valueOf(request.ignoreUnavailable)); + } + if (request.allowNoIndices != null) { + params.put("allow_no_indices", String.valueOf(request.allowNoIndices)); + } + if (request.analyzer != null) { + params.put("analyzer", request.analyzer); + } + if (request.analyzeWildcard != null) { + params.put("analyze_wildcard", String.valueOf(request.analyzeWildcard)); + } + if (request.lenient != null) { + params.put("lenient", String.valueOf(request.lenient)); + } + if (request.rewrite != null) { + params.put("rewrite", String.valueOf(request.rewrite)); + } + return params; + + }, SimpleEndpoint.emptyMap(), true, ValidateQueryResponse._DESERIALIZER); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ValidateQueryResponse.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ValidateQueryResponse.java new file mode 100644 index 000000000..e82aad6ff --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/ValidateQueryResponse.java @@ -0,0 +1,269 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices; + +import co.elastic.clients.elasticsearch._types.ShardStatistics; +import co.elastic.clients.elasticsearch.indices.validate_query.IndicesValidationExplanation; +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.Boolean; +import java.lang.String; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.validate_query.Response + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ValidateQueryResponse implements JsonpSerializable { + private final List explanations; + + @Nullable + private final ShardStatistics shards; + + private final boolean valid; + + @Nullable + private final String error; + + // --------------------------------------------------------------------------------------------- + + private ValidateQueryResponse(Builder builder) { + + this.explanations = ApiTypeHelper.unmodifiable(builder.explanations); + this.shards = builder.shards; + this.valid = ApiTypeHelper.requireNonNull(builder.valid, this, "valid"); + this.error = builder.error; + + } + + public static ValidateQueryResponse of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code explanations} + */ + public final List explanations() { + return this.explanations; + } + + /** + * API name: {@code _shards} + */ + @Nullable + public final ShardStatistics shards() { + return this.shards; + } + + /** + * Required - API name: {@code valid} + */ + public final boolean valid() { + return this.valid; + } + + /** + * API name: {@code error} + */ + @Nullable + public final String error() { + return this.error; + } + + /** + * 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.explanations)) { + generator.writeKey("explanations"); + generator.writeStartArray(); + for (IndicesValidationExplanation item0 : this.explanations) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.shards != null) { + generator.writeKey("_shards"); + this.shards.serialize(generator, mapper); + + } + generator.writeKey("valid"); + generator.write(this.valid); + + if (this.error != null) { + generator.writeKey("error"); + generator.write(this.error); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ValidateQueryResponse}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private List explanations; + + @Nullable + private ShardStatistics shards; + + private Boolean valid; + + @Nullable + private String error; + + /** + * API name: {@code explanations} + *

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

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

+ * Adds a value to explanations using a builder lambda. + */ + public final Builder explanations( + Function> fn) { + return explanations(fn.apply(new IndicesValidationExplanation.Builder()).build()); + } + + /** + * API name: {@code _shards} + */ + public final Builder shards(@Nullable ShardStatistics value) { + this.shards = value; + return this; + } + + /** + * API name: {@code _shards} + */ + public final Builder shards(Function> fn) { + return this.shards(fn.apply(new ShardStatistics.Builder()).build()); + } + + /** + * Required - API name: {@code valid} + */ + public final Builder valid(boolean value) { + this.valid = value; + return this; + } + + /** + * API name: {@code error} + */ + public final Builder error(@Nullable String value) { + this.error = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ValidateQueryResponse}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ValidateQueryResponse build() { + _checkSingleUse(); + + return new ValidateQueryResponse(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ValidateQueryResponse} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ValidateQueryResponse::setupValidateQueryResponseDeserializer); + + protected static void setupValidateQueryResponseDeserializer(ObjectDeserializer op) { + + op.add(Builder::explanations, JsonpDeserializer.arrayDeserializer(IndicesValidationExplanation._DESERIALIZER), + "explanations"); + op.add(Builder::shards, ShardStatistics._DESERIALIZER, "_shards"); + op.add(Builder::valid, JsonpDeserializer.booleanDeserializer(), "valid"); + op.add(Builder::error, JsonpDeserializer.stringDeserializer(), "error"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzeDetail.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzeDetail.java new file mode 100644 index 000000000..112bffe4e --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzeDetail.java @@ -0,0 +1,324 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.analyze; + +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.Boolean; +import java.util.List; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.analyze.AnalyzeDetail + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class AnalyzeDetail implements JsonpSerializable { + @Nullable + private final AnalyzerDetail analyzer; + + private final List charfilters; + + private final boolean customAnalyzer; + + private final List tokenfilters; + + @Nullable + private final TokenDetail tokenizer; + + // --------------------------------------------------------------------------------------------- + + private AnalyzeDetail(Builder builder) { + + this.analyzer = builder.analyzer; + this.charfilters = ApiTypeHelper.unmodifiable(builder.charfilters); + this.customAnalyzer = ApiTypeHelper.requireNonNull(builder.customAnalyzer, this, "customAnalyzer"); + this.tokenfilters = ApiTypeHelper.unmodifiable(builder.tokenfilters); + this.tokenizer = builder.tokenizer; + + } + + public static AnalyzeDetail of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code analyzer} + */ + @Nullable + public final AnalyzerDetail analyzer() { + return this.analyzer; + } + + /** + * API name: {@code charfilters} + */ + public final List charfilters() { + return this.charfilters; + } + + /** + * Required - API name: {@code custom_analyzer} + */ + public final boolean customAnalyzer() { + return this.customAnalyzer; + } + + /** + * API name: {@code tokenfilters} + */ + public final List tokenfilters() { + return this.tokenfilters; + } + + /** + * API name: {@code tokenizer} + */ + @Nullable + public final TokenDetail tokenizer() { + return this.tokenizer; + } + + /** + * 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 (this.analyzer != null) { + generator.writeKey("analyzer"); + this.analyzer.serialize(generator, mapper); + + } + if (ApiTypeHelper.isDefined(this.charfilters)) { + generator.writeKey("charfilters"); + generator.writeStartArray(); + for (CharFilterDetail item0 : this.charfilters) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + generator.writeKey("custom_analyzer"); + generator.write(this.customAnalyzer); + + if (ApiTypeHelper.isDefined(this.tokenfilters)) { + generator.writeKey("tokenfilters"); + generator.writeStartArray(); + for (TokenDetail item0 : this.tokenfilters) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.tokenizer != null) { + generator.writeKey("tokenizer"); + this.tokenizer.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link AnalyzeDetail}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + @Nullable + private AnalyzerDetail analyzer; + + @Nullable + private List charfilters; + + private Boolean customAnalyzer; + + @Nullable + private List tokenfilters; + + @Nullable + private TokenDetail tokenizer; + + /** + * API name: {@code analyzer} + */ + public final Builder analyzer(@Nullable AnalyzerDetail value) { + this.analyzer = value; + return this; + } + + /** + * API name: {@code analyzer} + */ + public final Builder analyzer(Function> fn) { + return this.analyzer(fn.apply(new AnalyzerDetail.Builder()).build()); + } + + /** + * API name: {@code charfilters} + *

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

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

+ * Adds a value to charfilters using a builder lambda. + */ + public final Builder charfilters(Function> fn) { + return charfilters(fn.apply(new CharFilterDetail.Builder()).build()); + } + + /** + * Required - API name: {@code custom_analyzer} + */ + public final Builder customAnalyzer(boolean value) { + this.customAnalyzer = value; + return this; + } + + /** + * API name: {@code tokenfilters} + *

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

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

+ * Adds a value to tokenfilters using a builder lambda. + */ + public final Builder tokenfilters(Function> fn) { + return tokenfilters(fn.apply(new TokenDetail.Builder()).build()); + } + + /** + * API name: {@code tokenizer} + */ + public final Builder tokenizer(@Nullable TokenDetail value) { + this.tokenizer = value; + return this; + } + + /** + * API name: {@code tokenizer} + */ + public final Builder tokenizer(Function> fn) { + return this.tokenizer(fn.apply(new TokenDetail.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link AnalyzeDetail}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public AnalyzeDetail build() { + _checkSingleUse(); + + return new AnalyzeDetail(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link AnalyzeDetail} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + AnalyzeDetail::setupAnalyzeDetailDeserializer); + + protected static void setupAnalyzeDetailDeserializer(ObjectDeserializer op) { + + op.add(Builder::analyzer, AnalyzerDetail._DESERIALIZER, "analyzer"); + op.add(Builder::charfilters, JsonpDeserializer.arrayDeserializer(CharFilterDetail._DESERIALIZER), + "charfilters"); + op.add(Builder::customAnalyzer, JsonpDeserializer.booleanDeserializer(), "custom_analyzer"); + op.add(Builder::tokenfilters, JsonpDeserializer.arrayDeserializer(TokenDetail._DESERIALIZER), "tokenfilters"); + op.add(Builder::tokenizer, TokenDetail._DESERIALIZER, "tokenizer"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzeToken.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzeToken.java new file mode 100644 index 000000000..f78985405 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzeToken.java @@ -0,0 +1,268 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.analyze; + +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; + +// typedef: indices.analyze.AnalyzeToken + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class AnalyzeToken implements JsonpSerializable { + private final long endOffset; + + private final long position; + + @Nullable + private final Long positionlength; + + private final long startOffset; + + private final String token; + + private final String type; + + // --------------------------------------------------------------------------------------------- + + private AnalyzeToken(Builder builder) { + + this.endOffset = ApiTypeHelper.requireNonNull(builder.endOffset, this, "endOffset"); + this.position = ApiTypeHelper.requireNonNull(builder.position, this, "position"); + this.positionlength = builder.positionlength; + this.startOffset = ApiTypeHelper.requireNonNull(builder.startOffset, this, "startOffset"); + this.token = ApiTypeHelper.requireNonNull(builder.token, this, "token"); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + + } + + public static AnalyzeToken of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code end_offset} + */ + public final long endOffset() { + return this.endOffset; + } + + /** + * Required - API name: {@code position} + */ + public final long position() { + return this.position; + } + + /** + * API name: {@code positionLength} + */ + @Nullable + public final Long positionlength() { + return this.positionlength; + } + + /** + * Required - API name: {@code start_offset} + */ + public final long startOffset() { + return this.startOffset; + } + + /** + * Required - API name: {@code token} + */ + public final String token() { + return this.token; + } + + /** + * Required - API name: {@code type} + */ + public final String type() { + return this.type; + } + + /** + * 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("end_offset"); + generator.write(this.endOffset); + + generator.writeKey("position"); + generator.write(this.position); + + if (this.positionlength != null) { + generator.writeKey("positionLength"); + generator.write(this.positionlength); + + } + generator.writeKey("start_offset"); + generator.write(this.startOffset); + + generator.writeKey("token"); + generator.write(this.token); + + generator.writeKey("type"); + generator.write(this.type); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link AnalyzeToken}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Long endOffset; + + private Long position; + + @Nullable + private Long positionlength; + + private Long startOffset; + + private String token; + + private String type; + + /** + * Required - API name: {@code end_offset} + */ + public final Builder endOffset(long value) { + this.endOffset = value; + return this; + } + + /** + * Required - API name: {@code position} + */ + public final Builder position(long value) { + this.position = value; + return this; + } + + /** + * API name: {@code positionLength} + */ + public final Builder positionlength(@Nullable Long value) { + this.positionlength = value; + return this; + } + + /** + * Required - API name: {@code start_offset} + */ + public final Builder startOffset(long value) { + this.startOffset = value; + return this; + } + + /** + * Required - API name: {@code token} + */ + public final Builder token(String value) { + this.token = value; + return this; + } + + /** + * Required - API name: {@code type} + */ + public final Builder type(String value) { + this.type = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link AnalyzeToken}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public AnalyzeToken build() { + _checkSingleUse(); + + return new AnalyzeToken(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link AnalyzeToken} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + AnalyzeToken::setupAnalyzeTokenDeserializer); + + protected static void setupAnalyzeTokenDeserializer(ObjectDeserializer op) { + + op.add(Builder::endOffset, JsonpDeserializer.longDeserializer(), "end_offset"); + op.add(Builder::position, JsonpDeserializer.longDeserializer(), "position"); + op.add(Builder::positionlength, JsonpDeserializer.longDeserializer(), "positionLength"); + op.add(Builder::startOffset, JsonpDeserializer.longDeserializer(), "start_offset"); + op.add(Builder::token, JsonpDeserializer.stringDeserializer(), "token"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzerDetail.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzerDetail.java new file mode 100644 index 000000000..837cf9331 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/AnalyzerDetail.java @@ -0,0 +1,197 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.analyze; + +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; + +// typedef: indices.analyze.AnalyzerDetail + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class AnalyzerDetail implements JsonpSerializable { + private final String name; + + private final List tokens; + + // --------------------------------------------------------------------------------------------- + + private AnalyzerDetail(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.tokens = ApiTypeHelper.unmodifiableRequired(builder.tokens, this, "tokens"); + + } + + public static AnalyzerDetail 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 tokens} + */ + public final List tokens() { + return this.tokens; + } + + /** + * 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); + + if (ApiTypeHelper.isDefined(this.tokens)) { + generator.writeKey("tokens"); + generator.writeStartArray(); + for (ExplainAnalyzeToken item0 : this.tokens) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link AnalyzerDetail}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String name; + + private List tokens; + + /** + * Required - API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Required - API name: {@code tokens} + *

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

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

+ * Adds a value to tokens using a builder lambda. + */ + public final Builder tokens(Function> fn) { + return tokens(fn.apply(new ExplainAnalyzeToken.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link AnalyzerDetail}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public AnalyzerDetail build() { + _checkSingleUse(); + + return new AnalyzerDetail(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link AnalyzerDetail} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + AnalyzerDetail::setupAnalyzerDetailDeserializer); + + protected static void setupAnalyzerDetailDeserializer(ObjectDeserializer op) { + + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::tokens, JsonpDeserializer.arrayDeserializer(ExplainAnalyzeToken._DESERIALIZER), "tokens"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/CharFilterDetail.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/CharFilterDetail.java new file mode 100644 index 000000000..17554ce9b --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/CharFilterDetail.java @@ -0,0 +1,188 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.analyze; + +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; + +// typedef: indices.analyze.CharFilterDetail + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class CharFilterDetail implements JsonpSerializable { + private final List filteredText; + + private final String name; + + // --------------------------------------------------------------------------------------------- + + private CharFilterDetail(Builder builder) { + + this.filteredText = ApiTypeHelper.unmodifiableRequired(builder.filteredText, this, "filteredText"); + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + + } + + public static CharFilterDetail of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code filtered_text} + */ + public final List filteredText() { + return this.filteredText; + } + + /** + * Required - API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * 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.filteredText)) { + generator.writeKey("filtered_text"); + generator.writeStartArray(); + for (String item0 : this.filteredText) { + generator.write(item0); + + } + generator.writeEnd(); + + } + generator.writeKey("name"); + generator.write(this.name); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link CharFilterDetail}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private List filteredText; + + private String name; + + /** + * Required - API name: {@code filtered_text} + *

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

+ * Adds one or more values to filteredText. + */ + public final Builder filteredText(String value, String... values) { + this.filteredText = _listAdd(this.filteredText, value, values); + return this; + } + + /** + * Required - API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link CharFilterDetail}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public CharFilterDetail build() { + _checkSingleUse(); + + return new CharFilterDetail(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link CharFilterDetail} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + CharFilterDetail::setupCharFilterDetailDeserializer); + + protected static void setupCharFilterDetailDeserializer(ObjectDeserializer op) { + + op.add(Builder::filteredText, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "filtered_text"); + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/ExplainAnalyzeToken.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/ExplainAnalyzeToken.java new file mode 100644 index 000000000..9973c200e --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/ExplainAnalyzeToken.java @@ -0,0 +1,391 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.analyze; + +import co.elastic.clients.json.JsonData; +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.Boolean; +import java.lang.Long; +import java.lang.String; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.analyze.ExplainAnalyzeToken + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ExplainAnalyzeToken implements JsonpSerializable { + private final Map attributes; + + private final String bytes; + + private final long endOffset; + + @Nullable + private final Boolean keyword; + + private final long position; + + private final long positionlength; + + private final long startOffset; + + private final long termfrequency; + + private final String token; + + private final String type; + + // --------------------------------------------------------------------------------------------- + + private ExplainAnalyzeToken(Builder builder) { + + this.attributes = ApiTypeHelper.unmodifiable(builder.attributes); + + this.bytes = ApiTypeHelper.requireNonNull(builder.bytes, this, "bytes"); + this.endOffset = ApiTypeHelper.requireNonNull(builder.endOffset, this, "endOffset"); + this.keyword = builder.keyword; + this.position = ApiTypeHelper.requireNonNull(builder.position, this, "position"); + this.positionlength = ApiTypeHelper.requireNonNull(builder.positionlength, this, "positionlength"); + this.startOffset = ApiTypeHelper.requireNonNull(builder.startOffset, this, "startOffset"); + this.termfrequency = ApiTypeHelper.requireNonNull(builder.termfrequency, this, "termfrequency"); + this.token = ApiTypeHelper.requireNonNull(builder.token, this, "token"); + this.type = ApiTypeHelper.requireNonNull(builder.type, this, "type"); + + } + + public static ExplainAnalyzeToken of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Additional tokenizer-specific attributes + */ + public final Map attributes() { + return this.attributes; + } + + /** + * Required - API name: {@code bytes} + */ + public final String bytes() { + return this.bytes; + } + + /** + * Required - API name: {@code end_offset} + */ + public final long endOffset() { + return this.endOffset; + } + + /** + * API name: {@code keyword} + */ + @Nullable + public final Boolean keyword() { + return this.keyword; + } + + /** + * Required - API name: {@code position} + */ + public final long position() { + return this.position; + } + + /** + * Required - API name: {@code positionLength} + */ + public final long positionlength() { + return this.positionlength; + } + + /** + * Required - API name: {@code start_offset} + */ + public final long startOffset() { + return this.startOffset; + } + + /** + * Required - API name: {@code termFrequency} + */ + public final long termfrequency() { + return this.termfrequency; + } + + /** + * Required - API name: {@code token} + */ + public final String token() { + return this.token; + } + + /** + * Required - API name: {@code type} + */ + public final String type() { + return this.type; + } + + /** + * 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) { + + for (Map.Entry item0 : this.attributes.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + + generator.writeKey("bytes"); + generator.write(this.bytes); + + generator.writeKey("end_offset"); + generator.write(this.endOffset); + + if (this.keyword != null) { + generator.writeKey("keyword"); + generator.write(this.keyword); + + } + generator.writeKey("position"); + generator.write(this.position); + + generator.writeKey("positionLength"); + generator.write(this.positionlength); + + generator.writeKey("start_offset"); + generator.write(this.startOffset); + + generator.writeKey("termFrequency"); + generator.write(this.termfrequency); + + generator.writeKey("token"); + generator.write(this.token); + + generator.writeKey("type"); + generator.write(this.type); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ExplainAnalyzeToken}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Map attributes = new HashMap<>(); + + /** + * Additional tokenizer-specific attributes + *

+ * Adds all entries of map to attributes. + */ + public final Builder attributes(Map map) { + this.attributes = _mapPutAll(this.attributes, map); + return this; + } + + /** + * Additional tokenizer-specific attributes + *

+ * Adds an entry to attributes. + */ + public final Builder attributes(String key, JsonData value) { + this.attributes = _mapPut(this.attributes, key, value); + return this; + } + + private String bytes; + + private Long endOffset; + + @Nullable + private Boolean keyword; + + private Long position; + + private Long positionlength; + + private Long startOffset; + + private Long termfrequency; + + private String token; + + private String type; + + /** + * Required - API name: {@code bytes} + */ + public final Builder bytes(String value) { + this.bytes = value; + return this; + } + + /** + * Required - API name: {@code end_offset} + */ + public final Builder endOffset(long value) { + this.endOffset = value; + return this; + } + + /** + * API name: {@code keyword} + */ + public final Builder keyword(@Nullable Boolean value) { + this.keyword = value; + return this; + } + + /** + * Required - API name: {@code position} + */ + public final Builder position(long value) { + this.position = value; + return this; + } + + /** + * Required - API name: {@code positionLength} + */ + public final Builder positionlength(long value) { + this.positionlength = value; + return this; + } + + /** + * Required - API name: {@code start_offset} + */ + public final Builder startOffset(long value) { + this.startOffset = value; + return this; + } + + /** + * Required - API name: {@code termFrequency} + */ + public final Builder termfrequency(long value) { + this.termfrequency = value; + return this; + } + + /** + * Required - API name: {@code token} + */ + public final Builder token(String value) { + this.token = value; + return this; + } + + /** + * Required - API name: {@code type} + */ + public final Builder type(String value) { + this.type = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ExplainAnalyzeToken}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ExplainAnalyzeToken build() { + _checkSingleUse(); + + return new ExplainAnalyzeToken(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ExplainAnalyzeToken} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ExplainAnalyzeToken::setupExplainAnalyzeTokenDeserializer); + + protected static void setupExplainAnalyzeTokenDeserializer(ObjectDeserializer op) { + + op.add(Builder::bytes, JsonpDeserializer.stringDeserializer(), "bytes"); + op.add(Builder::endOffset, JsonpDeserializer.longDeserializer(), "end_offset"); + op.add(Builder::keyword, JsonpDeserializer.booleanDeserializer(), "keyword"); + op.add(Builder::position, JsonpDeserializer.longDeserializer(), "position"); + op.add(Builder::positionlength, JsonpDeserializer.longDeserializer(), "positionLength"); + op.add(Builder::startOffset, JsonpDeserializer.longDeserializer(), "start_offset"); + op.add(Builder::termfrequency, JsonpDeserializer.longDeserializer(), "termFrequency"); + op.add(Builder::token, JsonpDeserializer.stringDeserializer(), "token"); + op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); + + op.setUnknownFieldHandler((builder, name, parser, mapper) -> { + builder.attributes(name, JsonData._DESERIALIZER.deserialize(parser, mapper)); + }); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/TokenDetail.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/TokenDetail.java new file mode 100644 index 000000000..61917b585 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/analyze/TokenDetail.java @@ -0,0 +1,196 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.analyze; + +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; + +// typedef: indices.analyze.TokenDetail + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class TokenDetail implements JsonpSerializable { + private final String name; + + private final List tokens; + + // --------------------------------------------------------------------------------------------- + + private TokenDetail(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.tokens = ApiTypeHelper.unmodifiableRequired(builder.tokens, this, "tokens"); + + } + + public static TokenDetail 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 tokens} + */ + public final List tokens() { + return this.tokens; + } + + /** + * 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); + + if (ApiTypeHelper.isDefined(this.tokens)) { + generator.writeKey("tokens"); + generator.writeStartArray(); + for (ExplainAnalyzeToken item0 : this.tokens) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link TokenDetail}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String name; + + private List tokens; + + /** + * Required - API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Required - API name: {@code tokens} + *

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

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

+ * Adds a value to tokens using a builder lambda. + */ + public final Builder tokens(Function> fn) { + return tokens(fn.apply(new ExplainAnalyzeToken.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link TokenDetail}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public TokenDetail build() { + _checkSingleUse(); + + return new TokenDetail(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link TokenDetail} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + TokenDetail::setupTokenDetailDeserializer); + + protected static void setupTokenDetailDeserializer(ObjectDeserializer op) { + + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::tokens, JsonpDeserializer.arrayDeserializer(ExplainAnalyzeToken._DESERIALIZER), "tokens"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/data_streams_stats/DataStreamsStatsItem.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/data_streams_stats/DataStreamsStatsItem.java new file mode 100644 index 000000000..3b9efd510 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/data_streams_stats/DataStreamsStatsItem.java @@ -0,0 +1,284 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.data_streams_stats; + +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.Integer; +import java.lang.Long; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.data_streams_stats.DataStreamsStatsItem + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DataStreamsStatsItem implements JsonpSerializable { + private final int backingIndices; + + private final String dataStream; + + private final long maximumTimestamp; + + @Nullable + private final String storeSize; + + private final int storeSizeBytes; + + // --------------------------------------------------------------------------------------------- + + private DataStreamsStatsItem(Builder builder) { + + this.backingIndices = ApiTypeHelper.requireNonNull(builder.backingIndices, this, "backingIndices"); + this.dataStream = ApiTypeHelper.requireNonNull(builder.dataStream, this, "dataStream"); + this.maximumTimestamp = ApiTypeHelper.requireNonNull(builder.maximumTimestamp, this, "maximumTimestamp"); + this.storeSize = builder.storeSize; + this.storeSizeBytes = ApiTypeHelper.requireNonNull(builder.storeSizeBytes, this, "storeSizeBytes"); + + } + + public static DataStreamsStatsItem of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - Current number of backing indices for the data stream. + *

+ * API name: {@code backing_indices} + */ + public final int backingIndices() { + return this.backingIndices; + } + + /** + * Required - Name of the data stream. + *

+ * API name: {@code data_stream} + */ + public final String dataStream() { + return this.dataStream; + } + + /** + * Required - The data stream’s highest @timestamp value, converted + * to milliseconds since the Unix epoch. NOTE: This timestamp is provided as a + * best effort. The data stream may contain @timestamp values + * higher than this if one or more of the following conditions are met: The + * stream contains closed backing indices; Backing indices with a lower + * generation contain higher @timestamp values. + *

+ * API name: {@code maximum_timestamp} + */ + public final long maximumTimestamp() { + return this.maximumTimestamp; + } + + /** + * Total size of all shards for the data stream’s backing indices. This + * parameter is only returned if the human query parameter is + * true. + *

+ * API name: {@code store_size} + */ + @Nullable + public final String storeSize() { + return this.storeSize; + } + + /** + * Required - Total size, in bytes, of all shards for the data stream’s backing + * indices. + *

+ * API name: {@code store_size_bytes} + */ + public final int storeSizeBytes() { + return this.storeSizeBytes; + } + + /** + * 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("backing_indices"); + generator.write(this.backingIndices); + + generator.writeKey("data_stream"); + generator.write(this.dataStream); + + generator.writeKey("maximum_timestamp"); + generator.write(this.maximumTimestamp); + + if (this.storeSize != null) { + generator.writeKey("store_size"); + generator.write(this.storeSize); + + } + generator.writeKey("store_size_bytes"); + generator.write(this.storeSizeBytes); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DataStreamsStatsItem}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private Integer backingIndices; + + private String dataStream; + + private Long maximumTimestamp; + + @Nullable + private String storeSize; + + private Integer storeSizeBytes; + + /** + * Required - Current number of backing indices for the data stream. + *

+ * API name: {@code backing_indices} + */ + public final Builder backingIndices(int value) { + this.backingIndices = value; + return this; + } + + /** + * Required - Name of the data stream. + *

+ * API name: {@code data_stream} + */ + public final Builder dataStream(String value) { + this.dataStream = value; + return this; + } + + /** + * Required - The data stream’s highest @timestamp value, converted + * to milliseconds since the Unix epoch. NOTE: This timestamp is provided as a + * best effort. The data stream may contain @timestamp values + * higher than this if one or more of the following conditions are met: The + * stream contains closed backing indices; Backing indices with a lower + * generation contain higher @timestamp values. + *

+ * API name: {@code maximum_timestamp} + */ + public final Builder maximumTimestamp(long value) { + this.maximumTimestamp = value; + return this; + } + + /** + * Total size of all shards for the data stream’s backing indices. This + * parameter is only returned if the human query parameter is + * true. + *

+ * API name: {@code store_size} + */ + public final Builder storeSize(@Nullable String value) { + this.storeSize = value; + return this; + } + + /** + * Required - Total size, in bytes, of all shards for the data stream’s backing + * indices. + *

+ * API name: {@code store_size_bytes} + */ + public final Builder storeSizeBytes(int value) { + this.storeSizeBytes = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DataStreamsStatsItem}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DataStreamsStatsItem build() { + _checkSingleUse(); + + return new DataStreamsStatsItem(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DataStreamsStatsItem} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DataStreamsStatsItem::setupDataStreamsStatsItemDeserializer); + + protected static void setupDataStreamsStatsItemDeserializer(ObjectDeserializer op) { + + op.add(Builder::backingIndices, JsonpDeserializer.integerDeserializer(), "backing_indices"); + op.add(Builder::dataStream, JsonpDeserializer.stringDeserializer(), "data_stream"); + op.add(Builder::maximumTimestamp, JsonpDeserializer.longDeserializer(), "maximum_timestamp"); + op.add(Builder::storeSize, JsonpDeserializer.stringDeserializer(), "store_size"); + op.add(Builder::storeSizeBytes, JsonpDeserializer.integerDeserializer(), "store_size_bytes"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/explain_data_lifecycle/DataStreamLifecycleExplain.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/explain_data_lifecycle/DataStreamLifecycleExplain.java new file mode 100644 index 000000000..c4fdd1bc4 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/explain_data_lifecycle/DataStreamLifecycleExplain.java @@ -0,0 +1,407 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.explain_data_lifecycle; + +import co.elastic.clients.elasticsearch._types.Time; +import co.elastic.clients.elasticsearch.indices.DataStreamLifecycleWithRollover; +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.Boolean; +import java.lang.Long; +import java.lang.String; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.explain_data_lifecycle.DataStreamLifecycleExplain + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DataStreamLifecycleExplain implements JsonpSerializable { + private final String index; + + private final boolean managedByLifecycle; + + @Nullable + private final Long indexCreationDateMillis; + + @Nullable + private final Time timeSinceIndexCreation; + + @Nullable + private final Long rolloverDateMillis; + + @Nullable + private final Time timeSinceRollover; + + @Nullable + private final DataStreamLifecycleWithRollover lifecycle; + + @Nullable + private final Time generationTime; + + @Nullable + private final String error; + + // --------------------------------------------------------------------------------------------- + + private DataStreamLifecycleExplain(Builder builder) { + + this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); + this.managedByLifecycle = ApiTypeHelper.requireNonNull(builder.managedByLifecycle, this, "managedByLifecycle"); + this.indexCreationDateMillis = builder.indexCreationDateMillis; + this.timeSinceIndexCreation = builder.timeSinceIndexCreation; + this.rolloverDateMillis = builder.rolloverDateMillis; + this.timeSinceRollover = builder.timeSinceRollover; + this.lifecycle = builder.lifecycle; + this.generationTime = builder.generationTime; + this.error = builder.error; + + } + + public static DataStreamLifecycleExplain of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code index} + */ + public final String index() { + return this.index; + } + + /** + * Required - API name: {@code managed_by_lifecycle} + */ + public final boolean managedByLifecycle() { + return this.managedByLifecycle; + } + + /** + * API name: {@code index_creation_date_millis} + */ + @Nullable + public final Long indexCreationDateMillis() { + return this.indexCreationDateMillis; + } + + /** + * API name: {@code time_since_index_creation} + */ + @Nullable + public final Time timeSinceIndexCreation() { + return this.timeSinceIndexCreation; + } + + /** + * API name: {@code rollover_date_millis} + */ + @Nullable + public final Long rolloverDateMillis() { + return this.rolloverDateMillis; + } + + /** + * API name: {@code time_since_rollover} + */ + @Nullable + public final Time timeSinceRollover() { + return this.timeSinceRollover; + } + + /** + * API name: {@code lifecycle} + */ + @Nullable + public final DataStreamLifecycleWithRollover lifecycle() { + return this.lifecycle; + } + + /** + * API name: {@code generation_time} + */ + @Nullable + public final Time generationTime() { + return this.generationTime; + } + + /** + * API name: {@code error} + */ + @Nullable + public final String error() { + return this.error; + } + + /** + * 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("index"); + generator.write(this.index); + + generator.writeKey("managed_by_lifecycle"); + generator.write(this.managedByLifecycle); + + if (this.indexCreationDateMillis != null) { + generator.writeKey("index_creation_date_millis"); + generator.write(this.indexCreationDateMillis); + + } + if (this.timeSinceIndexCreation != null) { + generator.writeKey("time_since_index_creation"); + this.timeSinceIndexCreation.serialize(generator, mapper); + + } + if (this.rolloverDateMillis != null) { + generator.writeKey("rollover_date_millis"); + generator.write(this.rolloverDateMillis); + + } + if (this.timeSinceRollover != null) { + generator.writeKey("time_since_rollover"); + this.timeSinceRollover.serialize(generator, mapper); + + } + if (this.lifecycle != null) { + generator.writeKey("lifecycle"); + this.lifecycle.serialize(generator, mapper); + + } + if (this.generationTime != null) { + generator.writeKey("generation_time"); + this.generationTime.serialize(generator, mapper); + + } + if (this.error != null) { + generator.writeKey("error"); + generator.write(this.error); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DataStreamLifecycleExplain}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private String index; + + private Boolean managedByLifecycle; + + @Nullable + private Long indexCreationDateMillis; + + @Nullable + private Time timeSinceIndexCreation; + + @Nullable + private Long rolloverDateMillis; + + @Nullable + private Time timeSinceRollover; + + @Nullable + private DataStreamLifecycleWithRollover lifecycle; + + @Nullable + private Time generationTime; + + @Nullable + private String error; + + /** + * Required - API name: {@code index} + */ + public final Builder index(String value) { + this.index = value; + return this; + } + + /** + * Required - API name: {@code managed_by_lifecycle} + */ + public final Builder managedByLifecycle(boolean value) { + this.managedByLifecycle = value; + return this; + } + + /** + * API name: {@code index_creation_date_millis} + */ + public final Builder indexCreationDateMillis(@Nullable Long value) { + this.indexCreationDateMillis = value; + return this; + } + + /** + * API name: {@code time_since_index_creation} + */ + public final Builder timeSinceIndexCreation(@Nullable Time value) { + this.timeSinceIndexCreation = value; + return this; + } + + /** + * API name: {@code time_since_index_creation} + */ + public final Builder timeSinceIndexCreation(Function> fn) { + return this.timeSinceIndexCreation(fn.apply(new Time.Builder()).build()); + } + + /** + * API name: {@code rollover_date_millis} + */ + public final Builder rolloverDateMillis(@Nullable Long value) { + this.rolloverDateMillis = value; + return this; + } + + /** + * API name: {@code time_since_rollover} + */ + public final Builder timeSinceRollover(@Nullable Time value) { + this.timeSinceRollover = value; + return this; + } + + /** + * API name: {@code time_since_rollover} + */ + public final Builder timeSinceRollover(Function> fn) { + return this.timeSinceRollover(fn.apply(new Time.Builder()).build()); + } + + /** + * API name: {@code lifecycle} + */ + public final Builder lifecycle(@Nullable DataStreamLifecycleWithRollover value) { + this.lifecycle = value; + return this; + } + + /** + * API name: {@code lifecycle} + */ + public final Builder lifecycle( + Function> fn) { + return this.lifecycle(fn.apply(new DataStreamLifecycleWithRollover.Builder()).build()); + } + + /** + * API name: {@code generation_time} + */ + public final Builder generationTime(@Nullable Time value) { + this.generationTime = value; + return this; + } + + /** + * API name: {@code generation_time} + */ + public final Builder generationTime(Function> fn) { + return this.generationTime(fn.apply(new Time.Builder()).build()); + } + + /** + * API name: {@code error} + */ + public final Builder error(@Nullable String value) { + this.error = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DataStreamLifecycleExplain}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DataStreamLifecycleExplain build() { + _checkSingleUse(); + + return new DataStreamLifecycleExplain(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DataStreamLifecycleExplain} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DataStreamLifecycleExplain::setupDataStreamLifecycleExplainDeserializer); + + protected static void setupDataStreamLifecycleExplainDeserializer( + ObjectDeserializer op) { + + op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); + op.add(Builder::managedByLifecycle, JsonpDeserializer.booleanDeserializer(), "managed_by_lifecycle"); + op.add(Builder::indexCreationDateMillis, JsonpDeserializer.longDeserializer(), "index_creation_date_millis"); + op.add(Builder::timeSinceIndexCreation, Time._DESERIALIZER, "time_since_index_creation"); + op.add(Builder::rolloverDateMillis, JsonpDeserializer.longDeserializer(), "rollover_date_millis"); + op.add(Builder::timeSinceRollover, Time._DESERIALIZER, "time_since_rollover"); + op.add(Builder::lifecycle, DataStreamLifecycleWithRollover._DESERIALIZER, "lifecycle"); + op.add(Builder::generationTime, Time._DESERIALIZER, "generation_time"); + op.add(Builder::error, JsonpDeserializer.stringDeserializer(), "error"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get/Feature.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get/Feature.java new file mode 100644 index 000000000..4098b38c5 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get/Feature.java @@ -0,0 +1,56 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.get; + +import co.elastic.clients.json.JsonEnum; +import co.elastic.clients.json.JsonpDeserializable; +import co.elastic.clients.json.JsonpDeserializer; + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public enum Feature implements JsonEnum { + Aliases("aliases"), + + Mappings("mappings"), + + Settings("settings"), + + ; + + private final String jsonValue; + + Feature(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + public static final JsonEnum.Deserializer _DESERIALIZER = new JsonEnum.Deserializer<>(Feature.values()); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_alias/IndexAliases.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_alias/IndexAliases.java new file mode 100644 index 000000000..e1860e24a --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_alias/IndexAliases.java @@ -0,0 +1,175 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.get_alias; + +import co.elastic.clients.elasticsearch.indices.AliasDefinition; +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.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.get_alias.IndexAliases + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexAliases implements JsonpSerializable { + private final Map aliases; + + // --------------------------------------------------------------------------------------------- + + private IndexAliases(Builder builder) { + + this.aliases = ApiTypeHelper.unmodifiableRequired(builder.aliases, this, "aliases"); + + } + + public static IndexAliases of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code aliases} + */ + public final Map aliases() { + return this.aliases; + } + + /** + * 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.aliases)) { + generator.writeKey("aliases"); + generator.writeStartObject(); + for (Map.Entry item0 : this.aliases.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexAliases}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Map aliases; + + /** + * Required - API name: {@code aliases} + *

+ * Adds all entries of map to aliases. + */ + public final Builder aliases(Map map) { + this.aliases = _mapPutAll(this.aliases, map); + return this; + } + + /** + * Required - API name: {@code aliases} + *

+ * Adds an entry to aliases. + */ + public final Builder aliases(String key, AliasDefinition value) { + this.aliases = _mapPut(this.aliases, key, value); + return this; + } + + /** + * Required - API name: {@code aliases} + *

+ * Adds an entry to aliases using a builder lambda. + */ + public final Builder aliases(String key, Function> fn) { + return aliases(key, fn.apply(new AliasDefinition.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexAliases}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexAliases build() { + _checkSingleUse(); + + return new IndexAliases(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexAliases} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + IndexAliases::setupIndexAliasesDeserializer); + + protected static void setupIndexAliasesDeserializer(ObjectDeserializer op) { + + op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(AliasDefinition._DESERIALIZER), "aliases"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_data_lifecycle/DataStreamWithLifecycle.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_data_lifecycle/DataStreamWithLifecycle.java new file mode 100644 index 000000000..f60a3b633 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_data_lifecycle/DataStreamWithLifecycle.java @@ -0,0 +1,184 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.get_data_lifecycle; + +import co.elastic.clients.elasticsearch.indices.DataStreamLifecycle; +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; + +// typedef: indices.get_data_lifecycle.DataStreamWithLifecycle + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class DataStreamWithLifecycle implements JsonpSerializable { + private final String name; + + @Nullable + private final DataStreamLifecycle lifecycle; + + // --------------------------------------------------------------------------------------------- + + private DataStreamWithLifecycle(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.lifecycle = builder.lifecycle; + + } + + public static DataStreamWithLifecycle of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * API name: {@code lifecycle} + */ + @Nullable + public final DataStreamLifecycle lifecycle() { + return this.lifecycle; + } + + /** + * 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); + + if (this.lifecycle != null) { + generator.writeKey("lifecycle"); + this.lifecycle.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link DataStreamWithLifecycle}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private String name; + + @Nullable + private DataStreamLifecycle lifecycle; + + /** + * Required - API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * API name: {@code lifecycle} + */ + public final Builder lifecycle(@Nullable DataStreamLifecycle value) { + this.lifecycle = value; + return this; + } + + /** + * API name: {@code lifecycle} + */ + public final Builder lifecycle(Function> fn) { + return this.lifecycle(fn.apply(new DataStreamLifecycle.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link DataStreamWithLifecycle}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public DataStreamWithLifecycle build() { + _checkSingleUse(); + + return new DataStreamWithLifecycle(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link DataStreamWithLifecycle} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, DataStreamWithLifecycle::setupDataStreamWithLifecycleDeserializer); + + protected static void setupDataStreamWithLifecycleDeserializer( + ObjectDeserializer op) { + + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::lifecycle, DataStreamLifecycle._DESERIALIZER, "lifecycle"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_index_template/IndexTemplateItem.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_index_template/IndexTemplateItem.java new file mode 100644 index 000000000..98ea0a405 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_index_template/IndexTemplateItem.java @@ -0,0 +1,175 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.get_index_template; + +import co.elastic.clients.elasticsearch.indices.IndexTemplate; +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; + +// typedef: indices.get_index_template.IndexTemplateItem + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexTemplateItem implements JsonpSerializable { + private final String name; + + private final IndexTemplate indexTemplate; + + // --------------------------------------------------------------------------------------------- + + private IndexTemplateItem(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.indexTemplate = ApiTypeHelper.requireNonNull(builder.indexTemplate, this, "indexTemplate"); + + } + + public static IndexTemplateItem 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 index_template} + */ + public final IndexTemplate indexTemplate() { + return this.indexTemplate; + } + + /** + * 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("index_template"); + this.indexTemplate.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexTemplateItem}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String name; + + private IndexTemplate indexTemplate; + + /** + * Required - API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Required - API name: {@code index_template} + */ + public final Builder indexTemplate(IndexTemplate value) { + this.indexTemplate = value; + return this; + } + + /** + * Required - API name: {@code index_template} + */ + public final Builder indexTemplate(Function> fn) { + return this.indexTemplate(fn.apply(new IndexTemplate.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexTemplateItem}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexTemplateItem build() { + _checkSingleUse(); + + return new IndexTemplateItem(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexTemplateItem} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexTemplateItem::setupIndexTemplateItemDeserializer); + + protected static void setupIndexTemplateItemDeserializer(ObjectDeserializer op) { + + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::indexTemplate, IndexTemplate._DESERIALIZER, "index_template"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_mapping/IndexMappingRecord.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_mapping/IndexMappingRecord.java new file mode 100644 index 000000000..dc23f5661 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/get_mapping/IndexMappingRecord.java @@ -0,0 +1,188 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.get_mapping; + +import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; +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.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.get_mapping.IndexMappingRecord + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexMappingRecord implements JsonpSerializable { + @Nullable + private final TypeMapping item; + + private final TypeMapping mappings; + + // --------------------------------------------------------------------------------------------- + + private IndexMappingRecord(Builder builder) { + + this.item = builder.item; + this.mappings = ApiTypeHelper.requireNonNull(builder.mappings, this, "mappings"); + + } + + public static IndexMappingRecord of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code item} + */ + @Nullable + public final TypeMapping item() { + return this.item; + } + + /** + * Required - API name: {@code mappings} + */ + public final TypeMapping mappings() { + return this.mappings; + } + + /** + * 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 (this.item != null) { + generator.writeKey("item"); + this.item.serialize(generator, mapper); + + } + generator.writeKey("mappings"); + this.mappings.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexMappingRecord}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private TypeMapping item; + + private TypeMapping mappings; + + /** + * API name: {@code item} + */ + public final Builder item(@Nullable TypeMapping value) { + this.item = value; + return this; + } + + /** + * API name: {@code item} + */ + public final Builder item(Function> fn) { + return this.item(fn.apply(new TypeMapping.Builder()).build()); + } + + /** + * Required - API name: {@code mappings} + */ + public final Builder mappings(TypeMapping value) { + this.mappings = value; + return this; + } + + /** + * Required - API name: {@code mappings} + */ + public final Builder mappings(Function> fn) { + return this.mappings(fn.apply(new TypeMapping.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexMappingRecord}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexMappingRecord build() { + _checkSingleUse(); + + return new IndexMappingRecord(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexMappingRecord} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexMappingRecord::setupIndexMappingRecordDeserializer); + + protected static void setupIndexMappingRecordDeserializer(ObjectDeserializer op) { + + op.add(Builder::item, TypeMapping._DESERIALIZER, "item"); + op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/Action.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/Action.java new file mode 100644 index 000000000..fda3a8ce2 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/Action.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.modify_data_stream; + +import co.elastic.clients.json.JsonEnum; +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.TaggedUnion; +import co.elastic.clients.util.TaggedUnionUtils; +import co.elastic.clients.util.WithJsonObjectBuilderBase; +import jakarta.json.stream.JsonGenerator; +import java.lang.Object; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.modify_data_stream.Action + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Action implements TaggedUnion, JsonpSerializable { + + /** + * {@link Action} variant kinds. + * + * @see API + * specification + */ + + public enum Kind implements JsonEnum { + AddBackingIndex("add_backing_index"), + + RemoveBackingIndex("remove_backing_index"), + + ; + + private final String jsonValue; + + Kind(String jsonValue) { + this.jsonValue = jsonValue; + } + + public String jsonValue() { + return this.jsonValue; + } + + } + + private final Kind _kind; + private final Object _value; + + @Override + public final Kind _kind() { + return _kind; + } + + @Override + public final Object _get() { + return _value; + } + + public Action(ActionVariant value) { + + this._kind = ApiTypeHelper.requireNonNull(value._actionKind(), this, ""); + this._value = ApiTypeHelper.requireNonNull(value, this, ""); + + } + + private Action(Builder builder) { + + this._kind = ApiTypeHelper.requireNonNull(builder._kind, builder, ""); + this._value = ApiTypeHelper.requireNonNull(builder._value, builder, ""); + + } + + public static Action of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Is this variant instance of kind {@code add_backing_index}? + */ + public boolean isAddBackingIndex() { + return _kind == Kind.AddBackingIndex; + } + + /** + * Get the {@code add_backing_index} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code add_backing_index} + * kind. + */ + public IndexAndDataStreamAction addBackingIndex() { + return TaggedUnionUtils.get(this, Kind.AddBackingIndex); + } + + /** + * Is this variant instance of kind {@code remove_backing_index}? + */ + public boolean isRemoveBackingIndex() { + return _kind == Kind.RemoveBackingIndex; + } + + /** + * Get the {@code remove_backing_index} variant value. + * + * @throws IllegalStateException + * if the current variant is not of the {@code remove_backing_index} + * kind. + */ + public IndexAndDataStreamAction removeBackingIndex() { + return TaggedUnionUtils.get(this, Kind.RemoveBackingIndex); + } + + @Override + @SuppressWarnings("unchecked") + public void serialize(JsonGenerator generator, JsonpMapper mapper) { + + generator.writeStartObject(); + + generator.writeKey(_kind.jsonValue()); + if (_value instanceof JsonpSerializable) { + ((JsonpSerializable) _value).serialize(generator, mapper); + } + + generator.writeEnd(); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private Kind _kind; + private Object _value; + + @Override + protected Builder self() { + return this; + } + public ObjectBuilder addBackingIndex(IndexAndDataStreamAction v) { + this._kind = Kind.AddBackingIndex; + this._value = v; + return this; + } + + public ObjectBuilder addBackingIndex( + Function> fn) { + return this.addBackingIndex(fn.apply(new IndexAndDataStreamAction.Builder()).build()); + } + + public ObjectBuilder removeBackingIndex(IndexAndDataStreamAction v) { + this._kind = Kind.RemoveBackingIndex; + this._value = v; + return this; + } + + public ObjectBuilder removeBackingIndex( + Function> fn) { + return this.removeBackingIndex(fn.apply(new IndexAndDataStreamAction.Builder()).build()); + } + + public Action build() { + _checkSingleUse(); + return new Action(this); + } + + } + + protected static void setupActionDeserializer(ObjectDeserializer op) { + + op.add(Builder::addBackingIndex, IndexAndDataStreamAction._DESERIALIZER, "add_backing_index"); + op.add(Builder::removeBackingIndex, IndexAndDataStreamAction._DESERIALIZER, "remove_backing_index"); + + } + + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Action::setupActionDeserializer, Builder::build); +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/ActionBuilders.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/ActionBuilders.java new file mode 100644 index 000000000..d980702aa --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/ActionBuilders.java @@ -0,0 +1,74 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.modify_data_stream; + +import co.elastic.clients.util.ObjectBuilder; +import java.util.function.Function; + +/** + * Builders for {@link Action} variants. + */ +public class ActionBuilders { + private ActionBuilders() { + } + + /** + * Creates a builder for the {@link IndexAndDataStreamAction add_backing_index} + * {@code Action} variant. + */ + public static IndexAndDataStreamAction.Builder addBackingIndex() { + return new IndexAndDataStreamAction.Builder(); + } + + /** + * Creates a Action of the {@link IndexAndDataStreamAction add_backing_index} + * {@code Action} variant. + */ + public static Action addBackingIndex( + Function> fn) { + Action.Builder builder = new Action.Builder(); + builder.addBackingIndex(fn.apply(new IndexAndDataStreamAction.Builder()).build()); + return builder.build(); + } + + /** + * Creates a builder for the {@link IndexAndDataStreamAction + * remove_backing_index} {@code Action} variant. + */ + public static IndexAndDataStreamAction.Builder removeBackingIndex() { + return new IndexAndDataStreamAction.Builder(); + } + + /** + * Creates a Action of the {@link IndexAndDataStreamAction remove_backing_index} + * {@code Action} variant. + */ + public static Action removeBackingIndex( + Function> fn) { + Action.Builder builder = new Action.Builder(); + builder.removeBackingIndex(fn.apply(new IndexAndDataStreamAction.Builder()).build()); + return builder.build(); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/ActionVariant.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/ActionVariant.java new file mode 100644 index 000000000..14f80097d --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/ActionVariant.java @@ -0,0 +1,37 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.modify_data_stream; + +/** + * Base interface for {@link Action} variants. + */ +public interface ActionVariant { + + Action.Kind _actionKind(); + + default Action _toAction() { + return new Action(this); + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/IndexAndDataStreamAction.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/IndexAndDataStreamAction.java new file mode 100644 index 000000000..e6e889e9c --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/modify_data_stream/IndexAndDataStreamAction.java @@ -0,0 +1,186 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.modify_data_stream; + +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; + +// typedef: indices.modify_data_stream.IndexAndDataStreamAction + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexAndDataStreamAction implements ActionVariant, JsonpSerializable { + private final String dataStream; + + private final String index; + + // --------------------------------------------------------------------------------------------- + + private IndexAndDataStreamAction(Builder builder) { + + this.dataStream = ApiTypeHelper.requireNonNull(builder.dataStream, this, "dataStream"); + this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); + + } + + public static IndexAndDataStreamAction of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Action variant kind. + */ + @Override + public Action.Kind _actionKind() { + return Action.Kind.RemoveBackingIndex; + } + + /** + * Required - Data stream targeted by the action. + *

+ * API name: {@code data_stream} + */ + public final String dataStream() { + return this.dataStream; + } + + /** + * Required - Index for the action. + *

+ * API name: {@code index} + */ + public final String index() { + return this.index; + } + + /** + * 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("data_stream"); + generator.write(this.dataStream); + + generator.writeKey("index"); + generator.write(this.index); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexAndDataStreamAction}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private String dataStream; + + private String index; + + /** + * Required - Data stream targeted by the action. + *

+ * API name: {@code data_stream} + */ + public final Builder dataStream(String value) { + this.dataStream = value; + return this; + } + + /** + * Required - Index for the action. + *

+ * API name: {@code index} + */ + public final Builder index(String value) { + this.index = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexAndDataStreamAction}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexAndDataStreamAction build() { + _checkSingleUse(); + + return new IndexAndDataStreamAction(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexAndDataStreamAction} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexAndDataStreamAction::setupIndexAndDataStreamActionDeserializer); + + protected static void setupIndexAndDataStreamActionDeserializer( + ObjectDeserializer op) { + + op.add(Builder::dataStream, JsonpDeserializer.stringDeserializer(), "data_stream"); + op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/put_index_template/IndexTemplateMapping.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/put_index_template/IndexTemplateMapping.java new file mode 100644 index 000000000..334b0ca4d --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/put_index_template/IndexTemplateMapping.java @@ -0,0 +1,324 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.put_index_template; + +import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; +import co.elastic.clients.elasticsearch.indices.Alias; +import co.elastic.clients.elasticsearch.indices.DataStreamLifecycle; +import co.elastic.clients.elasticsearch.indices.IndexSettings; +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.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.put_index_template.IndexTemplateMapping + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class IndexTemplateMapping implements JsonpSerializable { + private final Map aliases; + + @Nullable + private final TypeMapping mappings; + + @Nullable + private final IndexSettings settings; + + @Nullable + private final DataStreamLifecycle lifecycle; + + // --------------------------------------------------------------------------------------------- + + private IndexTemplateMapping(Builder builder) { + + this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); + this.mappings = builder.mappings; + this.settings = builder.settings; + this.lifecycle = builder.lifecycle; + + } + + public static IndexTemplateMapping of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Aliases to add. If the index template includes a data_stream + * object, these are data stream aliases. Otherwise, these are index aliases. + * Data stream aliases ignore the index_routing, + * routing, and search_routing options. + *

+ * API name: {@code aliases} + */ + public final Map aliases() { + return this.aliases; + } + + /** + * Mapping for fields in the index. If specified, this mapping can include field + * names, field data types, and mapping parameters. + *

+ * API name: {@code mappings} + */ + @Nullable + public final TypeMapping mappings() { + return this.mappings; + } + + /** + * Configuration options for the index. + *

+ * API name: {@code settings} + */ + @Nullable + public final IndexSettings settings() { + return this.settings; + } + + /** + * API name: {@code lifecycle} + */ + @Nullable + public final DataStreamLifecycle lifecycle() { + return this.lifecycle; + } + + /** + * 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.aliases)) { + generator.writeKey("aliases"); + generator.writeStartObject(); + for (Map.Entry item0 : this.aliases.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + if (this.mappings != null) { + generator.writeKey("mappings"); + this.mappings.serialize(generator, mapper); + + } + if (this.settings != null) { + generator.writeKey("settings"); + this.settings.serialize(generator, mapper); + + } + if (this.lifecycle != null) { + generator.writeKey("lifecycle"); + this.lifecycle.serialize(generator, mapper); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link IndexTemplateMapping}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Map aliases; + + @Nullable + private TypeMapping mappings; + + @Nullable + private IndexSettings settings; + + @Nullable + private DataStreamLifecycle lifecycle; + + /** + * Aliases to add. If the index template includes a data_stream + * object, these are data stream aliases. Otherwise, these are index aliases. + * Data stream aliases ignore the index_routing, + * routing, and search_routing options. + *

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

+ * Adds all entries of map to aliases. + */ + public final Builder aliases(Map map) { + this.aliases = _mapPutAll(this.aliases, map); + return this; + } + + /** + * Aliases to add. If the index template includes a data_stream + * object, these are data stream aliases. Otherwise, these are index aliases. + * Data stream aliases ignore the index_routing, + * routing, and search_routing options. + *

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

+ * Adds an entry to aliases. + */ + public final Builder aliases(String key, Alias value) { + this.aliases = _mapPut(this.aliases, key, value); + return this; + } + + /** + * Aliases to add. If the index template includes a data_stream + * object, these are data stream aliases. Otherwise, these are index aliases. + * Data stream aliases ignore the index_routing, + * routing, and search_routing options. + *

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

+ * Adds an entry to aliases using a builder lambda. + */ + public final Builder aliases(String key, Function> fn) { + return aliases(key, fn.apply(new Alias.Builder()).build()); + } + + /** + * Mapping for fields in the index. If specified, this mapping can include field + * names, field data types, and mapping parameters. + *

+ * API name: {@code mappings} + */ + public final Builder mappings(@Nullable TypeMapping value) { + this.mappings = value; + return this; + } + + /** + * Mapping for fields in the index. If specified, this mapping can include field + * names, field data types, and mapping parameters. + *

+ * API name: {@code mappings} + */ + public final Builder mappings(Function> fn) { + return this.mappings(fn.apply(new TypeMapping.Builder()).build()); + } + + /** + * Configuration options for the index. + *

+ * API name: {@code settings} + */ + public final Builder settings(@Nullable IndexSettings value) { + this.settings = value; + return this; + } + + /** + * Configuration options for the index. + *

+ * API name: {@code settings} + */ + public final Builder settings(Function> fn) { + return this.settings(fn.apply(new IndexSettings.Builder()).build()); + } + + /** + * API name: {@code lifecycle} + */ + public final Builder lifecycle(@Nullable DataStreamLifecycle value) { + this.lifecycle = value; + return this; + } + + /** + * API name: {@code lifecycle} + */ + public final Builder lifecycle(Function> fn) { + return this.lifecycle(fn.apply(new DataStreamLifecycle.Builder()).build()); + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link IndexTemplateMapping}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public IndexTemplateMapping build() { + _checkSingleUse(); + + return new IndexTemplateMapping(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link IndexTemplateMapping} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, IndexTemplateMapping::setupIndexTemplateMappingDeserializer); + + protected static void setupIndexTemplateMappingDeserializer(ObjectDeserializer op) { + + op.add(Builder::aliases, JsonpDeserializer.stringMapDeserializer(Alias._DESERIALIZER), "aliases"); + op.add(Builder::mappings, TypeMapping._DESERIALIZER, "mappings"); + op.add(Builder::settings, IndexSettings._DESERIALIZER, "settings"); + op.add(Builder::lifecycle, DataStreamLifecycle._DESERIALIZER, "lifecycle"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/reload_search_analyzers/ReloadDetails.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/reload_search_analyzers/ReloadDetails.java new file mode 100644 index 000000000..7ad011b01 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/reload_search_analyzers/ReloadDetails.java @@ -0,0 +1,234 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.reload_search_analyzers; + +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; + +// typedef: indices.reload_search_analyzers.ReloadDetails + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ReloadDetails implements JsonpSerializable { + private final String index; + + private final List reloadedAnalyzers; + + private final List reloadedNodeIds; + + // --------------------------------------------------------------------------------------------- + + private ReloadDetails(Builder builder) { + + this.index = ApiTypeHelper.requireNonNull(builder.index, this, "index"); + this.reloadedAnalyzers = ApiTypeHelper.unmodifiableRequired(builder.reloadedAnalyzers, this, + "reloadedAnalyzers"); + this.reloadedNodeIds = ApiTypeHelper.unmodifiableRequired(builder.reloadedNodeIds, this, "reloadedNodeIds"); + + } + + public static ReloadDetails of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code index} + */ + public final String index() { + return this.index; + } + + /** + * Required - API name: {@code reloaded_analyzers} + */ + public final List reloadedAnalyzers() { + return this.reloadedAnalyzers; + } + + /** + * Required - API name: {@code reloaded_node_ids} + */ + public final List reloadedNodeIds() { + return this.reloadedNodeIds; + } + + /** + * 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("index"); + generator.write(this.index); + + if (ApiTypeHelper.isDefined(this.reloadedAnalyzers)) { + generator.writeKey("reloaded_analyzers"); + generator.writeStartArray(); + for (String item0 : this.reloadedAnalyzers) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.reloadedNodeIds)) { + generator.writeKey("reloaded_node_ids"); + generator.writeStartArray(); + for (String item0 : this.reloadedNodeIds) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ReloadDetails}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String index; + + private List reloadedAnalyzers; + + private List reloadedNodeIds; + + /** + * Required - API name: {@code index} + */ + public final Builder index(String value) { + this.index = value; + return this; + } + + /** + * Required - API name: {@code reloaded_analyzers} + *

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

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

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

+ * Adds one or more values to reloadedNodeIds. + */ + public final Builder reloadedNodeIds(String value, String... values) { + this.reloadedNodeIds = _listAdd(this.reloadedNodeIds, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ReloadDetails}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ReloadDetails build() { + _checkSingleUse(); + + return new ReloadDetails(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ReloadDetails} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + ReloadDetails::setupReloadDetailsDeserializer); + + protected static void setupReloadDetailsDeserializer(ObjectDeserializer op) { + + op.add(Builder::index, JsonpDeserializer.stringDeserializer(), "index"); + op.add(Builder::reloadedAnalyzers, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "reloaded_analyzers"); + op.add(Builder::reloadedNodeIds, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "reloaded_node_ids"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/reload_search_analyzers/ReloadResult.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/reload_search_analyzers/ReloadResult.java new file mode 100644 index 000000000..568f6a43f --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/reload_search_analyzers/ReloadResult.java @@ -0,0 +1,212 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.reload_search_analyzers; + +import co.elastic.clients.elasticsearch._types.ShardStatistics; +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; + +// typedef: indices.reload_search_analyzers.ReloadResult + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ReloadResult implements JsonpSerializable { + private final List reloadDetails; + + private final ShardStatistics shards; + + // --------------------------------------------------------------------------------------------- + + protected ReloadResult(AbstractBuilder builder) { + + this.reloadDetails = ApiTypeHelper.unmodifiableRequired(builder.reloadDetails, this, "reloadDetails"); + this.shards = ApiTypeHelper.requireNonNull(builder.shards, this, "shards"); + + } + + public static ReloadResult reloadResultOf(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code reload_details} + */ + public final List reloadDetails() { + return this.reloadDetails; + } + + /** + * Required - API name: {@code _shards} + */ + public final ShardStatistics shards() { + return this.shards; + } + + /** + * 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.reloadDetails)) { + generator.writeKey("reload_details"); + generator.writeStartArray(); + for (ReloadDetails item0 : this.reloadDetails) { + item0.serialize(generator, mapper); + + } + generator.writeEnd(); + + } + generator.writeKey("_shards"); + this.shards.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ReloadResult}. + */ + + public static class Builder extends ReloadResult.AbstractBuilder implements ObjectBuilder { + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ReloadResult}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ReloadResult build() { + _checkSingleUse(); + + return new ReloadResult(this); + } + } + + public abstract static class AbstractBuilder> + extends + WithJsonObjectBuilderBase { + private List reloadDetails; + + private ShardStatistics shards; + + /** + * Required - API name: {@code reload_details} + *

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

+ * Adds one or more values to reloadDetails. + */ + public final BuilderT reloadDetails(ReloadDetails value, ReloadDetails... values) { + this.reloadDetails = _listAdd(this.reloadDetails, value, values); + return self(); + } + + /** + * Required - API name: {@code reload_details} + *

+ * Adds a value to reloadDetails using a builder lambda. + */ + public final BuilderT reloadDetails(Function> fn) { + return reloadDetails(fn.apply(new ReloadDetails.Builder()).build()); + } + + /** + * Required - API name: {@code _shards} + */ + public final BuilderT shards(ShardStatistics value) { + this.shards = value; + return self(); + } + + /** + * Required - API name: {@code _shards} + */ + public final BuilderT shards(Function> fn) { + return this.shards(fn.apply(new ShardStatistics.Builder()).build()); + } + + protected abstract BuilderT self(); + + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ReloadResult} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + ReloadResult::setupReloadResultDeserializer); + + protected static > void setupReloadResultDeserializer( + ObjectDeserializer op) { + + op.add(AbstractBuilder::reloadDetails, JsonpDeserializer.arrayDeserializer(ReloadDetails._DESERIALIZER), + "reload_details"); + op.add(AbstractBuilder::shards, ShardStatistics._DESERIALIZER, "_shards"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexAliasItem.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexAliasItem.java new file mode 100644 index 000000000..99cca4d6d --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexAliasItem.java @@ -0,0 +1,191 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.resolve_index; + +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; + +// typedef: indices.resolve_index.ResolveIndexAliasItem + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ResolveIndexAliasItem implements JsonpSerializable { + private final String name; + + private final List indices; + + // --------------------------------------------------------------------------------------------- + + private ResolveIndexAliasItem(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.indices = ApiTypeHelper.unmodifiableRequired(builder.indices, this, "indices"); + + } + + public static ResolveIndexAliasItem 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 indices} + */ + public final List indices() { + return this.indices; + } + + /** + * 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); + + if (ApiTypeHelper.isDefined(this.indices)) { + generator.writeKey("indices"); + generator.writeStartArray(); + for (String item0 : this.indices) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ResolveIndexAliasItem}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private String name; + + private List indices; + + /** + * Required - API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Required - API name: {@code indices} + *

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

+ * Adds one or more values to indices. + */ + public final Builder indices(String value, String... values) { + this.indices = _listAdd(this.indices, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ResolveIndexAliasItem}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ResolveIndexAliasItem build() { + _checkSingleUse(); + + return new ResolveIndexAliasItem(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ResolveIndexAliasItem} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ResolveIndexAliasItem::setupResolveIndexAliasItemDeserializer); + + protected static void setupResolveIndexAliasItemDeserializer(ObjectDeserializer op) { + + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::indices, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "indices"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexDataStreamsItem.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexDataStreamsItem.java new file mode 100644 index 000000000..5cb3e31e4 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexDataStreamsItem.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.resolve_index; + +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; + +// typedef: indices.resolve_index.ResolveIndexDataStreamsItem + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ResolveIndexDataStreamsItem implements JsonpSerializable { + private final String name; + + private final String timestampField; + + private final List backingIndices; + + // --------------------------------------------------------------------------------------------- + + private ResolveIndexDataStreamsItem(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.timestampField = ApiTypeHelper.requireNonNull(builder.timestampField, this, "timestampField"); + this.backingIndices = ApiTypeHelper.unmodifiableRequired(builder.backingIndices, this, "backingIndices"); + + } + + public static ResolveIndexDataStreamsItem 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 timestamp_field} + */ + public final String timestampField() { + return this.timestampField; + } + + /** + * Required - API name: {@code backing_indices} + */ + public final List backingIndices() { + return this.backingIndices; + } + + /** + * 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("timestamp_field"); + generator.write(this.timestampField); + + if (ApiTypeHelper.isDefined(this.backingIndices)) { + generator.writeKey("backing_indices"); + generator.writeStartArray(); + for (String item0 : this.backingIndices) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ResolveIndexDataStreamsItem}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + private String name; + + private String timestampField; + + private List backingIndices; + + /** + * Required - API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Required - API name: {@code timestamp_field} + */ + public final Builder timestampField(String value) { + this.timestampField = value; + return this; + } + + /** + * Required - API name: {@code backing_indices} + *

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

+ * Adds one or more values to backingIndices. + */ + public final Builder backingIndices(String value, String... values) { + this.backingIndices = _listAdd(this.backingIndices, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ResolveIndexDataStreamsItem}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ResolveIndexDataStreamsItem build() { + _checkSingleUse(); + + return new ResolveIndexDataStreamsItem(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ResolveIndexDataStreamsItem} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, ResolveIndexDataStreamsItem::setupResolveIndexDataStreamsItemDeserializer); + + protected static void setupResolveIndexDataStreamsItemDeserializer( + ObjectDeserializer op) { + + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::timestampField, JsonpDeserializer.stringDeserializer(), "timestamp_field"); + op.add(Builder::backingIndices, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "backing_indices"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexItem.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexItem.java new file mode 100644 index 000000000..58e0008d2 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/resolve_index/ResolveIndexItem.java @@ -0,0 +1,263 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.resolve_index; + +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; + +// typedef: indices.resolve_index.ResolveIndexItem + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class ResolveIndexItem implements JsonpSerializable { + private final String name; + + private final List aliases; + + private final List attributes; + + @Nullable + private final String dataStream; + + // --------------------------------------------------------------------------------------------- + + private ResolveIndexItem(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.aliases = ApiTypeHelper.unmodifiable(builder.aliases); + this.attributes = ApiTypeHelper.unmodifiableRequired(builder.attributes, this, "attributes"); + this.dataStream = builder.dataStream; + + } + + public static ResolveIndexItem of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code name} + */ + public final String name() { + return this.name; + } + + /** + * API name: {@code aliases} + */ + public final List aliases() { + return this.aliases; + } + + /** + * Required - API name: {@code attributes} + */ + public final List attributes() { + return this.attributes; + } + + /** + * API name: {@code data_stream} + */ + @Nullable + public final String dataStream() { + return this.dataStream; + } + + /** + * 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); + + if (ApiTypeHelper.isDefined(this.aliases)) { + generator.writeKey("aliases"); + generator.writeStartArray(); + for (String item0 : this.aliases) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (ApiTypeHelper.isDefined(this.attributes)) { + generator.writeKey("attributes"); + generator.writeStartArray(); + for (String item0 : this.attributes) { + generator.write(item0); + + } + generator.writeEnd(); + + } + if (this.dataStream != null) { + generator.writeKey("data_stream"); + generator.write(this.dataStream); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link ResolveIndexItem}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String name; + + @Nullable + private List aliases; + + private List attributes; + + @Nullable + private String dataStream; + + /** + * Required - API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * API name: {@code aliases} + *

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

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

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

+ * Adds one or more values to attributes. + */ + public final Builder attributes(String value, String... values) { + this.attributes = _listAdd(this.attributes, value, values); + return this; + } + + /** + * API name: {@code data_stream} + */ + public final Builder dataStream(@Nullable String value) { + this.dataStream = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link ResolveIndexItem}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public ResolveIndexItem build() { + _checkSingleUse(); + + return new ResolveIndexItem(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link ResolveIndexItem} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + ResolveIndexItem::setupResolveIndexItemDeserializer); + + protected static void setupResolveIndexItemDeserializer(ObjectDeserializer op) { + + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::aliases, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "aliases"); + op.add(Builder::attributes, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "attributes"); + op.add(Builder::dataStream, JsonpDeserializer.stringDeserializer(), "data_stream"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/rollover/RolloverConditions.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/rollover/RolloverConditions.java new file mode 100644 index 000000000..1e65279a7 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/rollover/RolloverConditions.java @@ -0,0 +1,572 @@ +/* + * 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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.rollover; + +import co.elastic.clients.elasticsearch._types.Time; +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.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; + +// typedef: indices.rollover.RolloverConditions + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class RolloverConditions implements JsonpSerializable { + @Nullable + private final Time minAge; + + @Nullable + private final Time maxAge; + + @Nullable + private final Long maxAgeMillis; + + @Nullable + private final Long minDocs; + + @Nullable + private final Long maxDocs; + + @Nullable + private final String maxSize; + + @Nullable + private final Long maxSizeBytes; + + @Nullable + private final String minSize; + + @Nullable + private final Long minSizeBytes; + + @Nullable + private final String maxPrimaryShardSize; + + @Nullable + private final Long maxPrimaryShardSizeBytes; + + @Nullable + private final String minPrimaryShardSize; + + @Nullable + private final Long minPrimaryShardSizeBytes; + + @Nullable + private final Long maxPrimaryShardDocs; + + @Nullable + private final Long minPrimaryShardDocs; + + // --------------------------------------------------------------------------------------------- + + private RolloverConditions(Builder builder) { + + this.minAge = builder.minAge; + this.maxAge = builder.maxAge; + this.maxAgeMillis = builder.maxAgeMillis; + this.minDocs = builder.minDocs; + this.maxDocs = builder.maxDocs; + this.maxSize = builder.maxSize; + this.maxSizeBytes = builder.maxSizeBytes; + this.minSize = builder.minSize; + this.minSizeBytes = builder.minSizeBytes; + this.maxPrimaryShardSize = builder.maxPrimaryShardSize; + this.maxPrimaryShardSizeBytes = builder.maxPrimaryShardSizeBytes; + this.minPrimaryShardSize = builder.minPrimaryShardSize; + this.minPrimaryShardSizeBytes = builder.minPrimaryShardSizeBytes; + this.maxPrimaryShardDocs = builder.maxPrimaryShardDocs; + this.minPrimaryShardDocs = builder.minPrimaryShardDocs; + + } + + public static RolloverConditions of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * API name: {@code min_age} + */ + @Nullable + public final Time minAge() { + return this.minAge; + } + + /** + * API name: {@code max_age} + */ + @Nullable + public final Time maxAge() { + return this.maxAge; + } + + /** + * API name: {@code max_age_millis} + */ + @Nullable + public final Long maxAgeMillis() { + return this.maxAgeMillis; + } + + /** + * API name: {@code min_docs} + */ + @Nullable + public final Long minDocs() { + return this.minDocs; + } + + /** + * API name: {@code max_docs} + */ + @Nullable + public final Long maxDocs() { + return this.maxDocs; + } + + /** + * API name: {@code max_size} + */ + @Nullable + public final String maxSize() { + return this.maxSize; + } + + /** + * API name: {@code max_size_bytes} + */ + @Nullable + public final Long maxSizeBytes() { + return this.maxSizeBytes; + } + + /** + * API name: {@code min_size} + */ + @Nullable + public final String minSize() { + return this.minSize; + } + + /** + * API name: {@code min_size_bytes} + */ + @Nullable + public final Long minSizeBytes() { + return this.minSizeBytes; + } + + /** + * API name: {@code max_primary_shard_size} + */ + @Nullable + public final String maxPrimaryShardSize() { + return this.maxPrimaryShardSize; + } + + /** + * API name: {@code max_primary_shard_size_bytes} + */ + @Nullable + public final Long maxPrimaryShardSizeBytes() { + return this.maxPrimaryShardSizeBytes; + } + + /** + * API name: {@code min_primary_shard_size} + */ + @Nullable + public final String minPrimaryShardSize() { + return this.minPrimaryShardSize; + } + + /** + * API name: {@code min_primary_shard_size_bytes} + */ + @Nullable + public final Long minPrimaryShardSizeBytes() { + return this.minPrimaryShardSizeBytes; + } + + /** + * API name: {@code max_primary_shard_docs} + */ + @Nullable + public final Long maxPrimaryShardDocs() { + return this.maxPrimaryShardDocs; + } + + /** + * API name: {@code min_primary_shard_docs} + */ + @Nullable + public final Long minPrimaryShardDocs() { + return this.minPrimaryShardDocs; + } + + /** + * 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 (this.minAge != null) { + generator.writeKey("min_age"); + this.minAge.serialize(generator, mapper); + + } + if (this.maxAge != null) { + generator.writeKey("max_age"); + this.maxAge.serialize(generator, mapper); + + } + if (this.maxAgeMillis != null) { + generator.writeKey("max_age_millis"); + generator.write(this.maxAgeMillis); + + } + if (this.minDocs != null) { + generator.writeKey("min_docs"); + generator.write(this.minDocs); + + } + if (this.maxDocs != null) { + generator.writeKey("max_docs"); + generator.write(this.maxDocs); + + } + if (this.maxSize != null) { + generator.writeKey("max_size"); + generator.write(this.maxSize); + + } + if (this.maxSizeBytes != null) { + generator.writeKey("max_size_bytes"); + generator.write(this.maxSizeBytes); + + } + if (this.minSize != null) { + generator.writeKey("min_size"); + generator.write(this.minSize); + + } + if (this.minSizeBytes != null) { + generator.writeKey("min_size_bytes"); + generator.write(this.minSizeBytes); + + } + if (this.maxPrimaryShardSize != null) { + generator.writeKey("max_primary_shard_size"); + generator.write(this.maxPrimaryShardSize); + + } + if (this.maxPrimaryShardSizeBytes != null) { + generator.writeKey("max_primary_shard_size_bytes"); + generator.write(this.maxPrimaryShardSizeBytes); + + } + if (this.minPrimaryShardSize != null) { + generator.writeKey("min_primary_shard_size"); + generator.write(this.minPrimaryShardSize); + + } + if (this.minPrimaryShardSizeBytes != null) { + generator.writeKey("min_primary_shard_size_bytes"); + generator.write(this.minPrimaryShardSizeBytes); + + } + if (this.maxPrimaryShardDocs != null) { + generator.writeKey("max_primary_shard_docs"); + generator.write(this.maxPrimaryShardDocs); + + } + if (this.minPrimaryShardDocs != null) { + generator.writeKey("min_primary_shard_docs"); + generator.write(this.minPrimaryShardDocs); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link RolloverConditions}. + */ + + public static class Builder extends WithJsonObjectBuilderBase + implements + ObjectBuilder { + @Nullable + private Time minAge; + + @Nullable + private Time maxAge; + + @Nullable + private Long maxAgeMillis; + + @Nullable + private Long minDocs; + + @Nullable + private Long maxDocs; + + @Nullable + private String maxSize; + + @Nullable + private Long maxSizeBytes; + + @Nullable + private String minSize; + + @Nullable + private Long minSizeBytes; + + @Nullable + private String maxPrimaryShardSize; + + @Nullable + private Long maxPrimaryShardSizeBytes; + + @Nullable + private String minPrimaryShardSize; + + @Nullable + private Long minPrimaryShardSizeBytes; + + @Nullable + private Long maxPrimaryShardDocs; + + @Nullable + private Long minPrimaryShardDocs; + + /** + * API name: {@code min_age} + */ + public final Builder minAge(@Nullable Time value) { + this.minAge = value; + return this; + } + + /** + * API name: {@code min_age} + */ + public final Builder minAge(Function> fn) { + return this.minAge(fn.apply(new Time.Builder()).build()); + } + + /** + * API name: {@code max_age} + */ + public final Builder maxAge(@Nullable Time value) { + this.maxAge = value; + return this; + } + + /** + * API name: {@code max_age} + */ + public final Builder maxAge(Function> fn) { + return this.maxAge(fn.apply(new Time.Builder()).build()); + } + + /** + * API name: {@code max_age_millis} + */ + public final Builder maxAgeMillis(@Nullable Long value) { + this.maxAgeMillis = value; + return this; + } + + /** + * API name: {@code min_docs} + */ + public final Builder minDocs(@Nullable Long value) { + this.minDocs = value; + return this; + } + + /** + * API name: {@code max_docs} + */ + public final Builder maxDocs(@Nullable Long value) { + this.maxDocs = value; + return this; + } + + /** + * API name: {@code max_size} + */ + public final Builder maxSize(@Nullable String value) { + this.maxSize = value; + return this; + } + + /** + * API name: {@code max_size_bytes} + */ + public final Builder maxSizeBytes(@Nullable Long value) { + this.maxSizeBytes = value; + return this; + } + + /** + * API name: {@code min_size} + */ + public final Builder minSize(@Nullable String value) { + this.minSize = value; + return this; + } + + /** + * API name: {@code min_size_bytes} + */ + public final Builder minSizeBytes(@Nullable Long value) { + this.minSizeBytes = value; + return this; + } + + /** + * API name: {@code max_primary_shard_size} + */ + public final Builder maxPrimaryShardSize(@Nullable String value) { + this.maxPrimaryShardSize = value; + return this; + } + + /** + * API name: {@code max_primary_shard_size_bytes} + */ + public final Builder maxPrimaryShardSizeBytes(@Nullable Long value) { + this.maxPrimaryShardSizeBytes = value; + return this; + } + + /** + * API name: {@code min_primary_shard_size} + */ + public final Builder minPrimaryShardSize(@Nullable String value) { + this.minPrimaryShardSize = value; + return this; + } + + /** + * API name: {@code min_primary_shard_size_bytes} + */ + public final Builder minPrimaryShardSizeBytes(@Nullable Long value) { + this.minPrimaryShardSizeBytes = value; + return this; + } + + /** + * API name: {@code max_primary_shard_docs} + */ + public final Builder maxPrimaryShardDocs(@Nullable Long value) { + this.maxPrimaryShardDocs = value; + return this; + } + + /** + * API name: {@code min_primary_shard_docs} + */ + public final Builder minPrimaryShardDocs(@Nullable Long value) { + this.minPrimaryShardDocs = value; + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link RolloverConditions}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public RolloverConditions build() { + _checkSingleUse(); + + return new RolloverConditions(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link RolloverConditions} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer + .lazy(Builder::new, RolloverConditions::setupRolloverConditionsDeserializer); + + protected static void setupRolloverConditionsDeserializer(ObjectDeserializer op) { + + op.add(Builder::minAge, Time._DESERIALIZER, "min_age"); + op.add(Builder::maxAge, Time._DESERIALIZER, "max_age"); + op.add(Builder::maxAgeMillis, JsonpDeserializer.longDeserializer(), "max_age_millis"); + op.add(Builder::minDocs, JsonpDeserializer.longDeserializer(), "min_docs"); + op.add(Builder::maxDocs, JsonpDeserializer.longDeserializer(), "max_docs"); + op.add(Builder::maxSize, JsonpDeserializer.stringDeserializer(), "max_size"); + op.add(Builder::maxSizeBytes, JsonpDeserializer.longDeserializer(), "max_size_bytes"); + op.add(Builder::minSize, JsonpDeserializer.stringDeserializer(), "min_size"); + op.add(Builder::minSizeBytes, JsonpDeserializer.longDeserializer(), "min_size_bytes"); + op.add(Builder::maxPrimaryShardSize, JsonpDeserializer.stringDeserializer(), "max_primary_shard_size"); + op.add(Builder::maxPrimaryShardSizeBytes, JsonpDeserializer.longDeserializer(), "max_primary_shard_size_bytes"); + op.add(Builder::minPrimaryShardSize, JsonpDeserializer.stringDeserializer(), "min_primary_shard_size"); + op.add(Builder::minPrimaryShardSizeBytes, JsonpDeserializer.longDeserializer(), "min_primary_shard_size_bytes"); + op.add(Builder::maxPrimaryShardDocs, JsonpDeserializer.longDeserializer(), "max_primary_shard_docs"); + op.add(Builder::minPrimaryShardDocs, JsonpDeserializer.longDeserializer(), "min_primary_shard_docs"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/simulate_template/Overlapping.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/simulate_template/Overlapping.java new file mode 100644 index 000000000..552939e06 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/simulate_template/Overlapping.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.simulate_template; + +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; + +// typedef: indices.simulate_template.Overlapping + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Overlapping implements JsonpSerializable { + private final String name; + + private final List indexPatterns; + + // --------------------------------------------------------------------------------------------- + + private Overlapping(Builder builder) { + + this.name = ApiTypeHelper.requireNonNull(builder.name, this, "name"); + this.indexPatterns = ApiTypeHelper.unmodifiableRequired(builder.indexPatterns, this, "indexPatterns"); + + } + + public static Overlapping 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 index_patterns} + */ + public final List indexPatterns() { + return this.indexPatterns; + } + + /** + * 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); + + if (ApiTypeHelper.isDefined(this.indexPatterns)) { + generator.writeKey("index_patterns"); + generator.writeStartArray(); + for (String item0 : this.indexPatterns) { + generator.write(item0); + + } + generator.writeEnd(); + + } + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Overlapping}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder { + private String name; + + private List indexPatterns; + + /** + * Required - API name: {@code name} + */ + public final Builder name(String value) { + this.name = value; + return this; + } + + /** + * Required - API name: {@code index_patterns} + *

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

+ * Adds one or more values to indexPatterns. + */ + public final Builder indexPatterns(String value, String... values) { + this.indexPatterns = _listAdd(this.indexPatterns, value, values); + return this; + } + + @Override + protected Builder self() { + return this; + } + + /** + * Builds a {@link Overlapping}. + * + * @throws NullPointerException + * if some of the required fields are null. + */ + public Overlapping build() { + _checkSingleUse(); + + return new Overlapping(this); + } + } + + // --------------------------------------------------------------------------------------------- + + /** + * Json deserializer for {@link Overlapping} + */ + public static final JsonpDeserializer _DESERIALIZER = ObjectBuilderDeserializer.lazy(Builder::new, + Overlapping::setupOverlappingDeserializer); + + protected static void setupOverlappingDeserializer(ObjectDeserializer op) { + + op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name"); + op.add(Builder::indexPatterns, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), + "index_patterns"); + + } + +} diff --git a/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/simulate_template/Template.java b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/simulate_template/Template.java new file mode 100644 index 000000000..57c4ebd16 --- /dev/null +++ b/java-client-serverless/src/main/java/co/elastic/clients/elasticsearch/indices/simulate_template/Template.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. + */ + +//---------------------------------------------------- +// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST. +//---------------------------------------------------- + +package co.elastic.clients.elasticsearch.indices.simulate_template; + +import co.elastic.clients.elasticsearch._types.mapping.TypeMapping; +import co.elastic.clients.elasticsearch.indices.Alias; +import co.elastic.clients.elasticsearch.indices.IndexSettings; +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.Map; +import java.util.Objects; +import java.util.function.Function; +import javax.annotation.Nullable; + +// typedef: indices.simulate_template.Template + +/** + * + * @see API + * specification + */ +@JsonpDeserializable +public class Template implements JsonpSerializable { + private final Map aliases; + + private final TypeMapping mappings; + + private final IndexSettings settings; + + // --------------------------------------------------------------------------------------------- + + private Template(Builder builder) { + + this.aliases = ApiTypeHelper.unmodifiableRequired(builder.aliases, this, "aliases"); + this.mappings = ApiTypeHelper.requireNonNull(builder.mappings, this, "mappings"); + this.settings = ApiTypeHelper.requireNonNull(builder.settings, this, "settings"); + + } + + public static Template of(Function> fn) { + return fn.apply(new Builder()).build(); + } + + /** + * Required - API name: {@code aliases} + */ + public final Map aliases() { + return this.aliases; + } + + /** + * Required - API name: {@code mappings} + */ + public final TypeMapping mappings() { + return this.mappings; + } + + /** + * Required - API name: {@code settings} + */ + public final IndexSettings settings() { + return this.settings; + } + + /** + * 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.aliases)) { + generator.writeKey("aliases"); + generator.writeStartObject(); + for (Map.Entry item0 : this.aliases.entrySet()) { + generator.writeKey(item0.getKey()); + item0.getValue().serialize(generator, mapper); + + } + generator.writeEnd(); + + } + generator.writeKey("mappings"); + this.mappings.serialize(generator, mapper); + + generator.writeKey("settings"); + this.settings.serialize(generator, mapper); + + } + + @Override + public String toString() { + return JsonpUtils.toString(this); + } + + // --------------------------------------------------------------------------------------------- + + /** + * Builder for {@link Template}. + */ + + public static class Builder extends WithJsonObjectBuilderBase implements ObjectBuilder